254 } |
254 } |
255 qDebug() << " colort" << colort << "colorh" << colorh << "colorn" << colorn; |
255 qDebug() << " colort" << colort << "colorh" << colorh << "colorn" << colorn; |
256 qDebug() << " psugar" << psugar << "pcara" << pcara << "mvol" << mvol; |
256 qDebug() << " psugar" << psugar << "pcara" << pcara << "mvol" << mvol; |
257 qDebug() << " sugarsf" << sugarsf << "sugarsm" << sugarsm; |
257 qDebug() << " sugarsf" << sugarsf << "sugarsm" << sugarsm; |
258 |
258 |
259 double og = Utils::estimate_sg(sugarsf + addedS, ui->batch_sizeEdit->value()); |
259 double og = Utils::estimate_sg(sugarsf + addedS, recipe->batch_size); |
260 qDebug() << " OG" << ui->est_ogEdit->value() << og; |
260 qDebug() << " OG" << ui->est_ogEdit->value() << og; |
261 recipe->est_og = og; |
261 recipe->est_og = og; |
262 ui->est_ogEdit->setValue(og); |
262 ui->est_ogEdit->setValue(og); |
263 ui->est_og2Edit->setValue(og); |
263 ui->est_og2Edit->setValue(og); |
264 ui->est_og3Edit->setValue(og); |
264 ui->est_og3Edit->setValue(og); |
265 ui->est_ogShow->setValue(og); |
265 ui->est_ogShow->setValue(og); |
266 |
266 |
267 recipe->preboil_sg = Utils::estimate_sg(sugarsm, ui->boil_sizeEdit->value()); |
267 recipe->preboil_sg = Utils::estimate_sg(sugarsm, recipe->boil_size); |
268 qDebug() << " preboil SG" << recipe->preboil_sg; |
268 qDebug() << " preboil SG" << recipe->preboil_sg; |
269 |
269 |
270 /* |
270 /* |
271 * Color of the wort |
271 * Color of the wort |
272 */ |
272 */ |
273 if (recipe->color_method == 4) { // Naudts |
273 if (recipe->color_method == 4) { // Naudts |
274 color = round(((Utils::sg_to_plato(og) / 8.6) * colorn) + (ui->boil_timeEdit->value() / 60)); |
274 color = round(((Utils::sg_to_plato(og) / 8.6) * colorn) + (recipe->boil_time / 60)); |
275 } else if (recipe->color_method == 3) { // Hans Halberstadt |
275 } else if (recipe->color_method == 3) { // Hans Halberstadt |
276 double bv = 0.925; // Beer loss efficiency |
276 double bv = 0.925; // Beer loss efficiency |
277 double sr = 0.95; // Mash and sparge efficiency |
277 double sr = 0.95; // Mash and sparge efficiency |
278 color = round((4.46 * bv * sr) / ui->batch_sizeEdit->value() * colorh); |
278 color = round((4.46 * bv * sr) / recipe->batch_size * colorh); |
279 } else { |
279 } else { |
280 double cw = colort / ui->batch_sizeEdit->value() * 8.34436; |
280 double cw = colort / recipe->batch_size * 8.34436; |
281 color = Utils::kw_to_ebc(recipe->color_method, cw); |
281 color = Utils::kw_to_ebc(recipe->color_method, cw); |
282 } |
282 } |
283 qDebug() << " color" << ui->est_colorEdit->value() << color << recipe->est_color; |
283 qDebug() << " color" << ui->est_colorEdit->value() << color << recipe->est_color; |
284 recipe->est_color = color; |
284 recipe->est_color = color; |
285 ui->est_colorEdit->setValue(color); |
285 ui->est_colorEdit->setValue(color); |
290 |
290 |
291 /* |
291 /* |
292 * We don't have a equipment profile in recipes, |
292 * We don't have a equipment profile in recipes, |
293 * so we assume a certain guessed mashtun size. |
293 * so we assume a certain guessed mashtun size. |
294 */ |
294 */ |
295 ui->perc_mashShow->setValue(round(recipe->mashs_kg / (ui->boil_sizeEdit->value() / 3) * 100)); |
295 ui->perc_mashShow->setValue(round(recipe->mashs_kg / (recipe->boil_size / 3) * 100)); |
296 ui->perc_sugarsShow->setValue(round(psugar)); |
296 ui->perc_sugarsShow->setValue(round(psugar)); |
297 ui->perc_caraShow->setValue(round(pcara)); |
297 ui->perc_caraShow->setValue(round(pcara)); |
298 if (recipe->mashs_kg > 0) { |
298 if (recipe->mashs_kg > 0) { |
299 qDebug() << " lintner" << lintner << " mashkg" << recipe->mashs_kg << "final" << round(lintner / recipe->mashs_kg); |
299 qDebug() << " lintner" << lintner << " mashkg" << recipe->mashs_kg << "final" << round(lintner / recipe->mashs_kg); |
300 ui->lintnerShow->setValue(round(lintner / recipe->mashs_kg)); |
300 ui->lintnerShow->setValue(round(lintner / recipe->mashs_kg)); |