293 #ifdef DEBUG_YEAST |
293 #ifdef DEBUG_YEAST |
294 qDebug() << " Guessed pitchrate" << product->yeast_pitchrate; |
294 qDebug() << " Guessed pitchrate" << product->yeast_pitchrate; |
295 #endif |
295 #endif |
296 } |
296 } |
297 |
297 |
298 initcells = (product->yeasts.at(i).cells / 1000000) * product->yeasts.at(i).amount * (product->starter_viability / 100.0); |
298 double cells = product->yeasts.at(i).cells; |
|
299 if (product->yeasts.at(i).yp_cells > 0) { // Use from yeastpack if set |
|
300 cells = product->yeasts.at(i).yp_cells; |
|
301 } |
|
302 initcells = (cells / 1000000) * product->yeasts.at(i).amount * (product->starter_viability / 100.0); |
299 if (product->yeasts.at(i).form == YEAST_FORMS_LIQUID) |
303 if (product->yeasts.at(i).form == YEAST_FORMS_LIQUID) |
300 initcells = (product->yeasts.at(i).cells / 1000000000) * product->yeasts.at(i).amount * (product->starter_viability / 100.0); |
304 initcells = (cells / 1000000000) * product->yeasts.at(i).amount * (product->starter_viability / 100.0); |
301 |
305 |
302 needed = round(product->yeast_pitchrate * volume * plato * 10.0) / 10.0; |
306 needed = round(product->yeast_pitchrate * volume * plato * 10.0) / 10.0; |
303 ui->neededShow->setValue(needed); |
307 ui->neededShow->setValue(needed); |
304 if (needed > initcells) { |
308 if ((0.9 * needed) > initcells) { // Allow 90% underpitch without a starter |
305 maybe_starter = true; |
309 maybe_starter = true; |
306 } |
310 } |
307 |
311 |
308 #ifdef DEBUG_YEAST |
312 #ifdef DEBUG_YEAST |
309 qDebug() << " Pitchrate:" << product->yeast_pitchrate << "needed:" << needed << "initcells:" << initcells << "starter" << maybe_starter; |
313 qDebug() << " Pitchrate:" << product->yeast_pitchrate << "needed:" << 0.9 * needed << "/" << needed << "initcells:" << initcells << "starter" << maybe_starter; |
310 #endif |
314 #endif |
311 } |
315 } |
312 break; |
316 break; |
313 } |
317 } |
314 } |
318 } |
335 qDebug() << " Starter calculate.."; |
339 qDebug() << " Starter calculate.."; |
336 #endif |
340 #endif |
337 |
341 |
338 const QStringList labels({tr("Method"), tr("Volume"), tr("Inj. factor"), tr("New cells"), tr("Total cells"), tr("Grow factor"), "" }); |
342 const QStringList labels({tr("Method"), tr("Volume"), tr("Inj. factor"), tr("New cells"), tr("Total cells"), tr("Grow factor"), "" }); |
339 ui->starterTable->show(); |
343 ui->starterTable->show(); |
|
344 ui->restartLabel->show(); |
|
345 ui->restartButton->show(); |
340 ui->starterTable->setEditTriggers(QAbstractItemView::NoEditTriggers); |
346 ui->starterTable->setEditTriggers(QAbstractItemView::NoEditTriggers); |
341 ui->starterTable->clear(); |
347 ui->starterTable->clear(); |
342 ui->starterTable->setColumnCount(7); |
348 ui->starterTable->setColumnCount(7); |
343 ui->starterTable->setRowCount(0); |
349 ui->starterTable->setRowCount(0); |
344 ui->starterTable->setColumnWidth(0, 130); /* Method */ |
350 ui->starterTable->setColumnWidth(0, 130); /* Method */ |
350 ui->starterTable->setColumnWidth(6, 30); /* Edit button */ |
356 ui->starterTable->setColumnWidth(6, 30); /* Edit button */ |
351 ui->starterTable->setHorizontalHeaderLabels(labels); |
357 ui->starterTable->setHorizontalHeaderLabels(labels); |
352 calcSteps(product->starter_type, initcells, needed); |
358 calcSteps(product->starter_type, initcells, needed); |
353 } else { |
359 } else { |
354 ui->starterTable->hide(); |
360 ui->starterTable->hide(); |
|
361 ui->restartLabel->hide(); |
|
362 ui->restartButton->hide(); |
355 } |
363 } |
356 calcBU(); |
364 calcBU(); |
357 } |
365 } |
358 |
366 |
359 |
367 |