305 |
305 |
306 /* |
306 /* |
307 * Calculate the apparant attenuation. |
307 * Calculate the apparant attenuation. |
308 */ |
308 */ |
309 double svg = 0; |
309 double svg = 0; |
|
310 bool sta1 = false; |
310 if (recipe->yeasts.size() > 0) { |
311 if (recipe->yeasts.size() > 0) { |
311 for (i = 0; i < recipe->yeasts.size(); i++) { |
312 for (i = 0; i < recipe->yeasts.size(); i++) { |
312 if (recipe->yeasts.at(i).use == 0) { // Used in primary |
313 if (recipe->yeasts.at(i).use == 0) { // Used in primary |
313 if (recipe->yeasts.at(i).attenuation > svg) |
314 if (recipe->yeasts.at(i).attenuation > svg) |
314 svg = recipe->yeasts.at(i).attenuation; // Take the highest if multiple yeasts. |
315 svg = recipe->yeasts.at(i).attenuation; // Take the highest if multiple yeasts. |
|
316 if (recipe->yeasts.at(i).sta1) |
|
317 sta1 = true; |
315 } |
318 } |
316 // TODO: brett or others in secondary. |
319 // TODO: brett or others in secondary. |
317 } |
320 } |
318 qDebug() << " SVG" << svg; |
321 qDebug() << " SVG" << svg; |
319 } |
322 } |
321 svg = 77.0; |
324 svg = 77.0; |
322 ui->est_svgEdit->setValue(svg); |
325 ui->est_svgEdit->setValue(svg); |
323 |
326 |
324 double fg; |
327 double fg; |
325 if (recipe->mashs_kg > 0 && mashinfuse > 0 && mashtime > 0 && mashtemp > 0) |
328 if (recipe->mashs_kg > 0 && mashinfuse > 0 && mashtime > 0 && mashtemp > 0) |
326 fg = Utils::estimate_fg(psugar, pcara, mashinfuse / recipe->mashs_kg, mashtime, mashtemp, svg, og); |
329 fg = Utils::estimate_fg(psugar, pcara, mashinfuse / recipe->mashs_kg, mashtime, mashtemp, svg, og, sta1); |
327 else |
330 else |
328 fg = Utils::estimate_fg(psugar, pcara, 0, 0, 0, svg, og); |
331 fg = Utils::estimate_fg(psugar, pcara, 0, 0, 0, svg, og, sta1); |
329 qDebug() << " FG" << ui->est_fgEdit->value() << fg; |
332 qDebug() << " FG" << ui->est_fgEdit->value() << fg; |
330 recipe->est_fg = fg; |
333 recipe->est_fg = fg; |
331 ui->est_fgEdit->setValue(fg); |
334 ui->est_fgEdit->setValue(fg); |
332 ui->est_fg3Edit->setValue(fg); |
335 ui->est_fg3Edit->setValue(fg); |
333 ui->est_fgShow->setValue(fg); |
336 ui->est_fgShow->setValue(fg); |