src/EditRecipe.cpp

changeset 104
c02dfb7bb2f9
parent 103
6da4e93b6ceb
child 105
e79079bf013d
equal deleted inserted replaced
103:6da4e93b6ceb 104:c02dfb7bb2f9
604 * Calculate kilocalories/liter. Formula from brouwhulp. 604 * Calculate kilocalories/liter. Formula from brouwhulp.
605 * Take the alcohol and sugar parts and then combine. 605 * Take the alcohol and sugar parts and then combine.
606 */ 606 */
607 double alc = 1881.22 * fg * (og - fg) / (1.775 - og); 607 double alc = 1881.22 * fg * (og - fg) / (1.775 - og);
608 double sug = 3550 * fg * (0.1808 * og + 0.8192 * fg - 1.0004); 608 double sug = 3550 * fg * (0.1808 * og + 0.8192 * fg - 1.0004);
609 qDebug() << " kcal" << round((alc + sug) / (12 * 0.0295735296)); 609 ui->calEdit->setValue(round((alc + sug) / (12 * 0.0295735296)));
610 610
611 // If to_100 then make all amount fields t/o and percent fields r/w 611 // If to_100 then make all amount fields t/o and percent fields r/w
612 612
613 } 613 }
614 614

mercurial