1857 .arg(product->miscs.at(j).amount * 1000 * factor, 1, 'f', 2).arg(unit).arg(product->miscs.at(j).name).arg(i)); |
1857 .arg(product->miscs.at(j).amount * 1000 * factor, 1, 'f', 2).arg(unit).arg(product->miscs.at(j).name).arg(i)); |
1858 } |
1858 } |
1859 } |
1859 } |
1860 } |
1860 } |
1861 checkInput(&painter, &y, QString(tr("Target volume at end of boil: %1 liter (%2 cm below kettle top)")) |
1861 checkInput(&painter, &y, QString(tr("Target volume at end of boil: %1 liter (%2 cm below kettle top)")) |
1862 .arg(product->batch_size * 1.04 * factor, 1, 'f', 1) |
1862 .arg(((product->batch_size * 1.04) + product->eq_chiller_volume) * factor, 1, 'f', 1) |
1863 .arg(Utils::kettle_cm(product->batch_size * 1.04 * factor, product->eq_kettle_volume, product->eq_kettle_height)), |
1863 .arg(Utils::kettle_cm(((product->batch_size * 1.04) + product->eq_chiller_volume) * factor, product->eq_kettle_volume, product->eq_kettle_height)), |
1864 QString(tr("cm"))); |
1864 QString(tr("cm"))); |
1865 checkInput(&painter, &y, QString(tr("Target SG at end of boil: ")) + strDensity(product->est_og3), QString(tr("SG"))); |
1865 checkInput(&painter, &y, QString(tr("Target SG at end of boil: ")) + strDensity(product->est_og3), QString(tr("SG"))); |
1866 checkInput(&painter, &y, "", QString(tr("pH"))); |
1866 if (product->brew_cooling_method == CHILLER_TYPE_IMMERSION) { |
|
1867 messageInput(&painter, &y, QString(tr("Note: target volume includes chiller %1 liter")) |
|
1868 .arg(product->eq_chiller_volume, 1, 'f', 1), QString(tr("pH"))); |
|
1869 } else { |
|
1870 checkInput(&painter, &y, "", QString(tr("pH"))); |
|
1871 } |
1867 if (checkSplit(&painter, &y, 2)) |
1872 if (checkSplit(&painter, &y, 2)) |
1868 factor = 1; |
1873 factor = 1; |
1869 } else { |
1874 } else { |
1870 checkLine(&painter, &y, QString(tr("This is a `no-boil` recipe"))); |
1875 checkLine(&painter, &y, QString(tr("This is a `no-boil` recipe"))); |
1871 } |
1876 } |
2437 painter->drawText(675, *y, 60, 20, Qt::AlignLeft, prompt); |
2442 painter->drawText(675, *y, 60, 20, Qt::AlignLeft, prompt); |
2438 *y += 20; |
2443 *y += 20; |
2439 } |
2444 } |
2440 |
2445 |
2441 |
2446 |
|
2447 void PrinterDialog::messageInput(QPainter *painter, qreal *y, QString text, QString prompt) |
|
2448 { |
|
2449 if (text != "") { |
|
2450 painter->drawText(50, *y,480, 20, Qt::AlignLeft, text); |
|
2451 } |
|
2452 painter->drawText(515, *y, 150, 20, Qt::AlignRight, QString(tr("Measured:")) + QString(" _________")); |
|
2453 painter->drawText(675, *y, 60, 20, Qt::AlignLeft, prompt); |
|
2454 *y += 20; |
|
2455 } |
|
2456 |
|
2457 |
2442 bool PrinterDialog::checkSplit(QPainter *painter, qreal *y, int moment) |
2458 bool PrinterDialog::checkSplit(QPainter *painter, qreal *y, int moment) |
2443 { |
2459 { |
2444 if (product->divide_type && product->divide_type == moment) { |
2460 if (product->divide_type && product->divide_type == moment) { |
2445 *y += 20; |
2461 *y += 20; |
2446 painter->setFont(QFont("Helvetica", 14, QFont::Bold)); |
2462 painter->setFont(QFont("Helvetica", 14, QFont::Bold)); |