61 const QColor y_line( 175, 175, 255, 255); |
61 const QColor y_line( 175, 175, 255, 255); |
62 const QColor mw_line( 240, 140, 130, 255); |
62 const QColor mw_line( 240, 140, 130, 255); |
63 const QColor mf_line( 95, 180, 25, 255); |
63 const QColor mf_line( 95, 180, 25, 255); |
64 const QColor ms_line( 240, 250, 65, 255); |
64 const QColor ms_line( 240, 250, 65, 255); |
65 const QColor mo_line( 210, 245, 255, 255); |
65 const QColor mo_line( 210, 245, 255, 255); |
66 const QColor m_line( 175, 175, 255, 255); // also y_line |
66 const QColor line( 175, 175, 255, 255); // also y_line |
67 const QColor w_line( 120, 255, 250, 255); |
67 const QColor w_line( 120, 255, 250, 255); |
68 |
68 |
69 const QStringList y_unit({tr("pkg"), tr("gr"), tr("ml"), tr("ml"), tr("ml"), tr("ml"), tr("gr")}); |
69 const QStringList y_unit({tr("pkg"), tr("gr"), tr("ml"), tr("ml"), tr("ml"), tr("ml"), tr("gr")}); |
70 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); |
70 const QStringList ibu_method({ "Tinseth", "Rager", "Daniels", "Garetz", "Mosher", "Noonan" }); |
71 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); |
71 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); |
522 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, tr("Cost")); |
522 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, tr("Cost")); |
523 y += 20; |
523 y += 20; |
524 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
524 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
525 double cost_miscs = 0; |
525 double cost_miscs = 0; |
526 for (int i = 0; i < recipe->miscs.size(); i++) { |
526 for (int i = 0; i < recipe->miscs.size(); i++) { |
527 double cost = recipe->miscs.at(i).m_amount * recipe->miscs.at(i).m_cost; |
527 double cost = recipe->miscs.at(i).amount * recipe->miscs.at(i).cost; |
528 cost_miscs += cost; |
528 cost_miscs += cost; |
529 |
529 |
530 if (recipe->miscs.at(i).m_use_use == 2) |
530 if (recipe->miscs.at(i).use_use == 2) |
531 use = misc_uses[recipe->miscs.at(i).m_use_use] + QString(" %1 min").arg(recipe->miscs.at(i).m_time); |
531 use = misc_uses[recipe->miscs.at(i).use_use] + QString(" %1 min").arg(recipe->miscs.at(i).time); |
532 else |
532 else |
533 use = misc_uses[recipe->miscs.at(i).m_use_use]; |
533 use = misc_uses[recipe->miscs.at(i).use_use]; |
534 |
534 |
535 if (recipe->miscs.at(i).m_type == 4) // Water agent |
535 if (recipe->miscs.at(i).type == 4) // Water agent |
536 painter.fillRect( 20, y, 715, 20, mw_line); |
536 painter.fillRect( 20, y, 715, 20, mw_line); |
537 else if (recipe->miscs.at(i).m_type == 3) // Fining |
537 else if (recipe->miscs.at(i).type == 3) // Fining |
538 painter.fillRect( 20, y, 715, 20, mf_line); |
538 painter.fillRect( 20, y, 715, 20, mf_line); |
539 else if (recipe->miscs.at(i).m_type < 3 || recipe->miscs.at(i).m_type == 5) // Spice, Herb, Flavour, Yeast nutrient |
539 else if (recipe->miscs.at(i).type < 3 || recipe->miscs.at(i).type == 5) // Spice, Herb, Flavour, Yeast nutrient |
540 painter.fillRect( 20, y, 715, 20, ms_line); |
540 painter.fillRect( 20, y, 715, 20, ms_line); |
541 else |
541 else |
542 painter.fillRect( 20, y, 715, 20, mo_line); |
542 painter.fillRect( 20, y, 715, 20, mo_line); |
543 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, recipe->miscs.at(i).m_name); |
543 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, recipe->miscs.at(i).name); |
544 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, misc_types[recipe->miscs.at(i).m_type]); |
544 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, misc_types[recipe->miscs.at(i).type]); |
545 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
545 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
546 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
546 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
547 QString("%1 %2").arg(recipe->miscs.at(i).m_amount * 1000.0, 1, 'f', 1).arg(recipe->miscs.at(i).m_amount_is_weight ? "gr":"ml")); |
547 QString("%1 %2").arg(recipe->miscs.at(i).amount * 1000.0, 1, 'f', 1).arg(recipe->miscs.at(i).amount_is_weight ? "gr":"ml")); |
548 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
548 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
549 y += 20; |
549 y += 20; |
550 } |
550 } |
551 painter.fillRect(670, y, 60, 20, c_line1); |
551 painter.fillRect(670, y, 60, 20, c_line1); |
552 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost_miscs, 1, 'f', 3)); |
552 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost_miscs, 1, 'f', 3)); |
572 painter.drawText(585, y+4, 70, 20, Qt::AlignRight, tr("Inf/dec L.")); |
572 painter.drawText(585, y+4, 70, 20, Qt::AlignRight, tr("Inf/dec L.")); |
573 painter.drawText(660, y+4, 70, 20, Qt::AlignRight, tr("Inf/dec °C")); |
573 painter.drawText(660, y+4, 70, 20, Qt::AlignRight, tr("Inf/dec °C")); |
574 y += 20; |
574 y += 20; |
575 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
575 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
576 for (int i = 0; i < recipe->mashs.size(); i++) { |
576 for (int i = 0; i < recipe->mashs.size(); i++) { |
577 painter.fillRect( 20, y, 715, 20, m_line); |
577 painter.fillRect( 20, y, 715, 20, line); |
578 painter.drawText( 20, y+4, 160, 20, Qt::AlignLeft, recipe->mashs.at(i).step_name); |
578 painter.drawText( 20, y+4, 160, 20, Qt::AlignLeft, recipe->mashs.at(i).step_name); |
579 painter.drawText(180, y+4, 80, 20, Qt::AlignLeft, step_types[recipe->mashs.at(i).step_type]); |
579 painter.drawText(180, y+4, 80, 20, Qt::AlignLeft, step_types[recipe->mashs.at(i).step_type]); |
580 painter.drawText(260, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_temp, 1, 'f', 1)); |
580 painter.drawText(260, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_temp, 1, 'f', 1)); |
581 painter.drawText(325, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).end_temp, 1, 'f', 1)); |
581 painter.drawText(325, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).end_temp, 1, 'f', 1)); |
582 painter.drawText(390, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_time, 1, 'f', 0)); |
582 painter.drawText(390, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_time, 1, 'f', 0)); |
938 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, tr("Cost")); |
938 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, tr("Cost")); |
939 y += 20; |
939 y += 20; |
940 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
940 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
941 double cost_miscs = 0; |
941 double cost_miscs = 0; |
942 for (int i = 0; i < product->miscs.size(); i++) { |
942 for (int i = 0; i < product->miscs.size(); i++) { |
943 double cost = product->miscs.at(i).m_amount * product->miscs.at(i).m_cost; |
943 double cost = product->miscs.at(i).amount * product->miscs.at(i).cost; |
944 cost_miscs += cost; |
944 cost_miscs += cost; |
945 |
945 |
946 if (product->miscs.at(i).m_use_use == 2) |
946 if (product->miscs.at(i).use_use == 2) |
947 use = misc_uses[product->miscs.at(i).m_use_use] + QString(" %1 min").arg(product->miscs.at(i).m_time); |
947 use = misc_uses[product->miscs.at(i).use_use] + QString(" %1 min").arg(product->miscs.at(i).time); |
948 else |
948 else |
949 use = misc_uses[product->miscs.at(i).m_use_use]; |
949 use = misc_uses[product->miscs.at(i).use_use]; |
950 |
950 |
951 if (product->miscs.at(i).m_type == 4) // Water agent |
951 if (product->miscs.at(i).type == 4) // Water agent |
952 painter.fillRect( 20, y, 715, 20, mw_line); |
952 painter.fillRect( 20, y, 715, 20, mw_line); |
953 else if (product->miscs.at(i).m_type == 3) // Fining |
953 else if (product->miscs.at(i).type == 3) // Fining |
954 painter.fillRect( 20, y, 715, 20, mf_line); |
954 painter.fillRect( 20, y, 715, 20, mf_line); |
955 else if (product->miscs.at(i).m_type < 3 || product->miscs.at(i).m_type == 5) // Spice, Herb, Flavour, Yeast nutrient |
955 else if (product->miscs.at(i).type < 3 || product->miscs.at(i).type == 5) // Spice, Herb, Flavour, Yeast nutrient |
956 painter.fillRect( 20, y, 715, 20, ms_line); |
956 painter.fillRect( 20, y, 715, 20, ms_line); |
957 else |
957 else |
958 painter.fillRect( 20, y, 715, 20, mo_line); |
958 painter.fillRect( 20, y, 715, 20, mo_line); |
959 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, product->miscs.at(i).m_name); |
959 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, product->miscs.at(i).name); |
960 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, misc_types[product->miscs.at(i).m_type]); |
960 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, misc_types[product->miscs.at(i).type]); |
961 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
961 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
962 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
962 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
963 QString("%1 %2").arg(product->miscs.at(i).m_amount * 1000.0, 1, 'f', 1).arg(product->miscs.at(i).m_amount_is_weight ? "gr":"ml")); |
963 QString("%1 %2").arg(product->miscs.at(i).amount * 1000.0, 1, 'f', 1).arg(product->miscs.at(i).amount_is_weight ? "gr":"ml")); |
964 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
964 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
965 y += 20; |
965 y += 20; |
966 } |
966 } |
967 painter.fillRect(670, y, 60, 20, c_line1); |
967 painter.fillRect(670, y, 60, 20, c_line1); |
968 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost_miscs, 1, 'f', 3)); |
968 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost_miscs, 1, 'f', 3)); |
988 painter.drawText(585, y+4, 70, 20, Qt::AlignRight, tr("Inf/dec L.")); |
988 painter.drawText(585, y+4, 70, 20, Qt::AlignRight, tr("Inf/dec L.")); |
989 painter.drawText(660, y+4, 70, 20, Qt::AlignRight, tr("Inf/dec °C")); |
989 painter.drawText(660, y+4, 70, 20, Qt::AlignRight, tr("Inf/dec °C")); |
990 y += 20; |
990 y += 20; |
991 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
991 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
992 for (int i = 0; i < product->mashs.size(); i++) { |
992 for (int i = 0; i < product->mashs.size(); i++) { |
993 painter.fillRect( 20, y, 715, 20, m_line); |
993 painter.fillRect( 20, y, 715, 20, line); |
994 painter.drawText( 20, y+4, 160, 20, Qt::AlignLeft, product->mashs.at(i).step_name); |
994 painter.drawText( 20, y+4, 160, 20, Qt::AlignLeft, product->mashs.at(i).step_name); |
995 painter.drawText(180, y+4, 80, 20, Qt::AlignLeft, step_types[product->mashs.at(i).step_type]); |
995 painter.drawText(180, y+4, 80, 20, Qt::AlignLeft, step_types[product->mashs.at(i).step_type]); |
996 painter.drawText(260, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_temp, 1, 'f', 1)); |
996 painter.drawText(260, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_temp, 1, 'f', 1)); |
997 painter.drawText(325, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).end_temp, 1, 'f', 1)); |
997 painter.drawText(325, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).end_temp, 1, 'f', 1)); |
998 painter.drawText(390, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_time, 1, 'f', 0)); |
998 painter.drawText(390, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_time, 1, 'f', 0)); |
1134 y = 120; |
1134 y = 120; |
1135 } else { |
1135 } else { |
1136 y += 40; |
1136 y += 40; |
1137 } |
1137 } |
1138 painter.setFont(QFont("Helvetica", 9, QFont::Bold)); |
1138 painter.setFont(QFont("Helvetica", 9, QFont::Bold)); |
1139 painter.fillRect( 20, y, 715, 20, m_line); |
1139 painter.fillRect( 20, y, 715, 20, line); |
1140 painter.drawText( 40, y+4, 250, 20, Qt::AlignLeft, tr("Mash step")); |
1140 painter.drawText( 40, y+4, 250, 20, Qt::AlignLeft, tr("Mash step")); |
1141 painter.drawText(290, y+4, 120, 20, Qt::AlignLeft, tr("Step type")); |
1141 painter.drawText(290, y+4, 120, 20, Qt::AlignLeft, tr("Step type")); |
1142 painter.drawText(400, y+4, 110, 20, Qt::AlignLeft, tr("Temperature")); |
1142 painter.drawText(400, y+4, 110, 20, Qt::AlignLeft, tr("Temperature")); |
1143 painter.drawText(510, y+4, 75, 20, Qt::AlignLeft, tr("Minutes")); |
1143 painter.drawText(510, y+4, 75, 20, Qt::AlignLeft, tr("Minutes")); |
1144 painter.drawText(585, y+4, 75, 20, Qt::AlignLeft, tr("SG")); |
1144 painter.drawText(585, y+4, 75, 20, Qt::AlignLeft, tr("SG")); |
1165 y = 120; |
1165 y = 120; |
1166 } else { |
1166 } else { |
1167 y += 20; |
1167 y += 20; |
1168 } |
1168 } |
1169 painter.setFont(QFont("Helvetica", 9, QFont::Bold)); |
1169 painter.setFont(QFont("Helvetica", 9, QFont::Bold)); |
1170 painter.fillRect( 20, y, 715, 20, m_line); |
1170 painter.fillRect( 20, y, 715, 20, line); |
1171 painter.drawText( 20, y+4, 230, 20, Qt::AlignLeft, tr("Brew item")); |
1171 painter.drawText( 20, y+4, 230, 20, Qt::AlignLeft, tr("Brew item")); |
1172 painter.drawText(250, y+4, 200, 20, Qt::AlignLeft, tr("Expected")); |
1172 painter.drawText(250, y+4, 200, 20, Qt::AlignLeft, tr("Expected")); |
1173 painter.drawText(450, y+4, 200, 20, Qt::AlignLeft, tr("Reached")); |
1173 painter.drawText(450, y+4, 200, 20, Qt::AlignLeft, tr("Reached")); |
1174 painter.drawText(650, y+4, 85, 20, Qt::AlignLeft, tr("Difference")); |
1174 painter.drawText(650, y+4, 85, 20, Qt::AlignLeft, tr("Difference")); |
1175 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
1175 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
1389 painter.drawText( 20, y+4, 715, 20, Qt::AlignLeft, product->package_infuse_notes); |
1389 painter.drawText( 20, y+4, 715, 20, Qt::AlignLeft, product->package_infuse_notes); |
1390 y += 20; |
1390 y += 20; |
1391 } |
1391 } |
1392 y += 5; |
1392 y += 5; |
1393 painter.setFont(QFont("Helvetica", 9, QFont::Bold)); |
1393 painter.setFont(QFont("Helvetica", 9, QFont::Bold)); |
1394 painter.fillRect( 20, y, 330, 20, m_line); |
1394 painter.fillRect( 20, y, 330, 20, line); |
1395 painter.drawText( 20, y+2, 330, 20, Qt::AlignCenter, tr("Bottles")); |
1395 painter.drawText( 20, y+2, 330, 20, Qt::AlignCenter, tr("Bottles")); |
1396 painter.fillRect(405, y, 330, 20, m_line); |
1396 painter.fillRect(405, y, 330, 20, line); |
1397 painter.drawText(405, y+2, 330, 20, Qt::AlignCenter, tr("Kegs")); |
1397 painter.drawText(405, y+2, 330, 20, Qt::AlignCenter, tr("Kegs")); |
1398 y += 20; |
1398 y += 20; |
1399 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
1399 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
1400 painter.fillRect( 20, y, 330, 20, c_line1); |
1400 painter.fillRect( 20, y, 330, 20, c_line1); |
1401 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Bottles volume")); |
1401 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Bottles volume")); |
1600 if (product->w2_name != "" && product->w2_amount > 0) { |
1600 if (product->w2_name != "" && product->w2_amount > 0) { |
1601 checkLine(&painter, &y, QString("%1 liter water %2").arg(product->w2_amount * factor, 1, 'f', 1).arg(product->w2_name)); |
1601 checkLine(&painter, &y, QString("%1 liter water %2").arg(product->w2_amount * factor, 1, 'f', 1).arg(product->w2_name)); |
1602 mashwater += product->w2_amount * factor; |
1602 mashwater += product->w2_amount * factor; |
1603 } |
1603 } |
1604 for (int i = 0; i < product->miscs.size(); i++) { |
1604 for (int i = 0; i < product->miscs.size(); i++) { |
1605 if (product->miscs.at(i).m_type == MISC_TYPES_WATER_AGENT) { |
1605 if (product->miscs.at(i).type == MISC_TYPES_WATER_AGENT) { |
1606 QString unit = (product->miscs.at(i).m_amount_is_weight) ? "gr":"ml"; |
1606 QString unit = (product->miscs.at(i).amount_is_weight) ? "gr":"ml"; |
1607 checkLine(&painter, &y, QString("%1 %2 %3").arg(product->miscs.at(i).m_amount * 1000 * factor, 1, 'f', 2).arg(unit).arg(product->miscs.at(i).m_name)); |
1607 checkLine(&painter, &y, QString("%1 %2 %3").arg(product->miscs.at(i).amount * 1000 * factor, 1, 'f', 2).arg(unit).arg(product->miscs.at(i).name)); |
1608 numsalts++; |
1608 numsalts++; |
1609 } |
1609 } |
1610 } |
1610 } |
1611 y += 20; |
1611 y += 20; |
1612 |
1612 |
1642 checkLine(&painter, &y, QString(tr("Add %1 gram `%2` hop")).arg(product->hops.at(j).h_amount * 1000 * factor, 1, 'f', 1) |
1642 checkLine(&painter, &y, QString(tr("Add %1 gram `%2` hop")).arg(product->hops.at(j).h_amount * 1000 * factor, 1, 'f', 1) |
1643 .arg(product->hops.at(j).h_name)); |
1643 .arg(product->hops.at(j).h_name)); |
1644 } |
1644 } |
1645 } |
1645 } |
1646 for (int j = 0; j < product->miscs.size(); j++) { |
1646 for (int j = 0; j < product->miscs.size(); j++) { |
1647 if ((product->miscs.at(j).m_use_use == MISC_USES_MASH) && (product->miscs.at(j).m_type != MISC_TYPES_WATER_AGENT)) { |
1647 if ((product->miscs.at(j).use_use == MISC_USES_MASH) && (product->miscs.at(j).type != MISC_TYPES_WATER_AGENT)) { |
1648 QString unit = (product->miscs.at(j).m_amount_is_weight) ? "gr":"ml"; |
1648 QString unit = (product->miscs.at(j).amount_is_weight) ? "gr":"ml"; |
1649 checkLine(&painter, &y, QString(tr("Add %1 %2 `%3`")).arg(product->miscs.at(j).m_amount * 1000 * factor, 1, 'f', 2) |
1649 checkLine(&painter, &y, QString(tr("Add %1 %2 `%3`")).arg(product->miscs.at(j).amount * 1000 * factor, 1, 'f', 2) |
1650 .arg(unit).arg(product->miscs.at(j).m_name)); |
1650 .arg(unit).arg(product->miscs.at(j).name)); |
1651 } |
1651 } |
1652 } |
1652 } |
1653 } else { // loop > 0 |
1653 } else { // loop > 0 |
1654 if (product->mashs.at(i).step_type == 0) { // Infusion |
1654 if (product->mashs.at(i).step_type == 0) { // Infusion |
1655 checkLine(&painter, &y, QString(tr("Add %1 liter water of %2°C")).arg(product->mashs.at(i).step_infuse_amount * factor, 1, 'f', 1) |
1655 checkLine(&painter, &y, QString(tr("Add %1 liter water of %2°C")).arg(product->mashs.at(i).step_infuse_amount * factor, 1, 'f', 1) |
1768 checkLine(&painter, &y, QString(tr("%1 gr `%2` at %3 minutes before end of boil")) |
1768 checkLine(&painter, &y, QString(tr("%1 gr `%2` at %3 minutes before end of boil")) |
1769 .arg(product->hops.at(j).h_amount * 1000 * factor, 1, 'f', 2).arg(product->hops.at(j).h_name).arg(i)); |
1769 .arg(product->hops.at(j).h_amount * 1000 * factor, 1, 'f', 2).arg(product->hops.at(j).h_name).arg(i)); |
1770 } |
1770 } |
1771 } |
1771 } |
1772 for (int j = 0; j < product->miscs.size(); j++) { |
1772 for (int j = 0; j < product->miscs.size(); j++) { |
1773 if (product->miscs.at(j).m_use_use == MISC_USES_BOIL && product->miscs.at(j).m_time == i) { |
1773 if (product->miscs.at(j).use_use == MISC_USES_BOIL && product->miscs.at(j).time == i) { |
1774 QString unit = (product->miscs.at(j).m_amount_is_weight) ? "gr":"ml"; |
1774 QString unit = (product->miscs.at(j).amount_is_weight) ? "gr":"ml"; |
1775 if (i == 0) |
1775 if (i == 0) |
1776 checkLine(&painter, &y, QString(tr("%1 %2 `%3` at flameout")) |
1776 checkLine(&painter, &y, QString(tr("%1 %2 `%3` at flameout")) |
1777 .arg(product->miscs.at(j).m_amount * 1000 * factor, 1, 'f', 2).arg(unit).arg(product->miscs.at(j).m_name)); |
1777 .arg(product->miscs.at(j).amount * 1000 * factor, 1, 'f', 2).arg(unit).arg(product->miscs.at(j).name)); |
1778 else |
1778 else |
1779 checkLine(&painter, &y, QString(tr("%1 %2 `%3` at %4 minutes before end of boil")) |
1779 checkLine(&painter, &y, QString(tr("%1 %2 `%3` at %4 minutes before end of boil")) |
1780 .arg(product->miscs.at(j).m_amount * 1000 * factor, 1, 'f', 2).arg(unit).arg(product->miscs.at(j).m_name).arg(i)); |
1780 .arg(product->miscs.at(j).amount * 1000 * factor, 1, 'f', 2).arg(unit).arg(product->miscs.at(j).name).arg(i)); |
1781 } |
1781 } |
1782 } |
1782 } |
1783 } |
1783 } |
1784 checkInput(&painter, &y, QString(tr("Target volume at end of boil: %1 liter (%2 cm below kettle top)")) |
1784 checkInput(&painter, &y, QString(tr("Target volume at end of boil: %1 liter (%2 cm below kettle top)")) |
1785 .arg(product->batch_size * 1.04 * factor, 1, 'f', 1) |
1785 .arg(product->batch_size * 1.04 * factor, 1, 'f', 1) |
1921 if (product->fermentables.at(i).f_added == FERMENTABLE_ADDED_FERMENTATION) |
1921 if (product->fermentables.at(i).f_added == FERMENTABLE_ADDED_FERMENTATION) |
1922 checkLine(&painter, &y, QString(tr("Add %1 kg `%2` on day 3 or 4")).arg(product->fermentables.at(i).f_amount * factor, 1, 'f', 3) |
1922 checkLine(&painter, &y, QString(tr("Add %1 kg `%2` on day 3 or 4")).arg(product->fermentables.at(i).f_amount * factor, 1, 'f', 3) |
1923 .arg(product->fermentables.at(i).f_name)); |
1923 .arg(product->fermentables.at(i).f_name)); |
1924 } |
1924 } |
1925 for (int i = 0; i < product->miscs.size(); i++) { |
1925 for (int i = 0; i < product->miscs.size(); i++) { |
1926 if (product->miscs.at(i).m_use_use == MISC_USES_PRIMARY) { |
1926 if (product->miscs.at(i).use_use == MISC_USES_PRIMARY) { |
1927 QString unit = (product->miscs.at(i).m_amount_is_weight) ? "gr":"ml"; |
1927 QString unit = (product->miscs.at(i).amount_is_weight) ? "gr":"ml"; |
1928 checkLine(&painter, &y, QString(tr("Add %1 %2 `%3` on day 3 or 4")).arg(product->miscs.at(i).m_amount * 1000 * factor, 1, 'f', 3) |
1928 checkLine(&painter, &y, QString(tr("Add %1 %2 `%3` on day 3 or 4")).arg(product->miscs.at(i).amount * 1000 * factor, 1, 'f', 3) |
1929 .arg(unit).arg(product->miscs.at(i).m_name)); |
1929 .arg(unit).arg(product->miscs.at(i).name)); |
1930 } |
1930 } |
1931 } |
1931 } |
1932 } |
1932 } |
1933 if (checkSplit(&painter, &y, 4)) |
1933 if (checkSplit(&painter, &y, 4)) |
1934 factor = 1; |
1934 factor = 1; |