396 double svg = 0; |
396 double svg = 0; |
397 double initcells = 0; |
397 double initcells = 0; |
398 product->yeasts_ok = true; |
398 product->yeasts_ok = true; |
399 if (product->yeasts.size() > 0) { |
399 if (product->yeasts.size() > 0) { |
400 for (i = 0; i < product->yeasts.size(); i++) { |
400 for (i = 0; i < product->yeasts.size(); i++) { |
401 if (product->yeasts.at(i).y_use == 0) { // Used in primary |
401 if (product->yeasts.at(i).use == 0) { // Used in primary |
402 if (product->yeasts.at(i).y_attenuation > svg) |
402 if (product->yeasts.at(i).attenuation > svg) |
403 svg = product->yeasts.at(i).y_attenuation; // Take the highest if multiple yeasts. |
403 svg = product->yeasts.at(i).attenuation; // Take the highest if multiple yeasts. |
404 } |
404 } |
405 if (product->yeasts.at(i).y_form == 0) |
405 if (product->yeasts.at(i).form == 0) |
406 initcells += (product->yeasts.at(i).y_cells / 1000000000) * product->yeasts.at(i).y_amount * (product->starter_viability / 100); |
406 initcells += (product->yeasts.at(i).cells / 1000000000) * product->yeasts.at(i).amount * (product->starter_viability / 100); |
407 else |
407 else |
408 initcells += (product->yeasts.at(i).y_cells / 1000000) * product->yeasts.at(i).y_amount * (product->starter_viability / 100); |
408 initcells += (product->yeasts.at(i).cells / 1000000) * product->yeasts.at(i).amount * (product->starter_viability / 100); |
409 // TODO: brett or others in secondary. |
409 // TODO: brett or others in secondary. |
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).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).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).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).use == 3))) && // Bottle |
414 (product->yeasts.at(i).y_inventory < product->yeasts.at(i).y_amount)) { |
414 (product->yeasts.at(i).inventory < product->yeasts.at(i).amount)) { |
415 product->yeasts_ok = false; |
415 product->yeasts_ok = false; |
416 } |
416 } |
417 } |
417 } |
418 qDebug() << " SVG" << svg; |
418 qDebug() << " SVG" << svg; |
419 } |
419 } |