393 /* |
393 /* |
394 * Calculate the apparant attenuation. |
394 * Calculate the apparant attenuation. |
395 */ |
395 */ |
396 double svg = 0; |
396 double svg = 0; |
397 double initcells = 0; |
397 double initcells = 0; |
|
398 product->yeasts_ok = true; |
398 if (product->yeasts.size() > 0) { |
399 if (product->yeasts.size() > 0) { |
399 for (i = 0; i < product->yeasts.size(); i++) { |
400 for (i = 0; i < product->yeasts.size(); i++) { |
400 if (product->yeasts.at(i).y_use == 0) { // Used in primary |
401 if (product->yeasts.at(i).y_use == 0) { // Used in primary |
401 if (product->yeasts.at(i).y_attenuation > svg) |
402 if (product->yeasts.at(i).y_attenuation > svg) |
402 svg = product->yeasts.at(i).y_attenuation; // Take the highest if multiple yeasts. |
403 svg = product->yeasts.at(i).y_attenuation; // Take the highest if multiple yeasts. |
404 if (product->yeasts.at(i).y_form == 0) |
405 if (product->yeasts.at(i).y_form == 0) |
405 initcells += (product->yeasts.at(i).y_cells / 1000000000) * product->yeasts.at(i).y_amount * (product->starter_viability / 100); |
406 initcells += (product->yeasts.at(i).y_cells / 1000000000) * product->yeasts.at(i).y_amount * (product->starter_viability / 100); |
406 else |
407 else |
407 initcells += (product->yeasts.at(i).y_cells / 1000000) * product->yeasts.at(i).y_amount * (product->starter_viability / 100); |
408 initcells += (product->yeasts.at(i).y_cells / 1000000) * product->yeasts.at(i).y_amount * (product->starter_viability / 100); |
408 // TODO: brett or others in secondary. |
409 // TODO: brett or others in secondary. |
409 product->yeasts_ok = true; |
|
410 if ((((product->inventory_reduced <= PROD_STAGE_PRIMARY) && (product->yeasts.at(i).y_use == 0)) || // Primary |
410 if ((((product->inventory_reduced <= PROD_STAGE_PRIMARY) && (product->yeasts.at(i).y_use == 0)) || // Primary |
411 ((product->inventory_reduced <= PROD_STAGE_SECONDARY) && (product->yeasts.at(i).y_use == 1)) || // Secondary |
411 ((product->inventory_reduced <= PROD_STAGE_SECONDARY) && (product->yeasts.at(i).y_use == 1)) || // Secondary |
412 ((product->inventory_reduced <= PROD_STAGE_TERTIARY) && (product->yeasts.at(i).y_use == 2)) || // Tertiary |
412 ((product->inventory_reduced <= PROD_STAGE_TERTIARY) && (product->yeasts.at(i).y_use == 2)) || // Tertiary |
413 ((product->inventory_reduced <= PROD_STAGE_PACKAGE) && (product->yeasts.at(i).y_use == 3))) && // Bottle |
413 ((product->inventory_reduced <= PROD_STAGE_PACKAGE) && (product->yeasts.at(i).y_use == 3))) && // Bottle |
414 (product->yeasts.at(i).y_inventory < product->yeasts.at(i).y_amount)) { |
414 (product->yeasts.at(i).y_inventory < product->yeasts.at(i).y_amount)) { |