src/PrinterDialog.h

Thu, 18 Aug 2022 16:11:20 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 18 Aug 2022 16:11:20 +0200
changeset 397
877420a13815
parent 386
2e30c9c20d22
child 459
fbb250c725bb
permissions
-rw-r--r--

Edit Product, split CO2 package pressure in bottles and kegs. BU:RE code cleanup. calcPack() sets the CO2 values on the first tab. Show final EBC on tab 1 if the stage is after brew. Show final ABV and energy on tab 1 if fermentation is done. Removed wrong bottle priming calculation from calcFermentables() because calcPack() does this.

#ifndef	_PRINTERDIALOG_H
#define	_PRINTERDIALOG_H

#include <QDialog>
#include <QPrinter>
#include <QPainter>


enum JobType { PR_SUPPLIES, PR_YEASTBANK, PR_RECIPE, PR_PRODUCT, PR_CHECKLIST, PR_REP_TOTAL, PR_REP_EFF, PR_REP_SVG };

namespace Ui {
class PrinterDialog;
}


class PrinterDialog : public QDialog
{
	Q_OBJECT

public:
    /**
     * @brief Construct a new Printer Dialog
     * @param parent
     */
    explicit PrinterDialog(int job, int rec, QWidget *parent = 0);

    /**
     * @brief Destroy the Printer Dialog
     */
    ~PrinterDialog();

public slots:
    void printDocument(QPrinter *printer);

private:
    int p_job;
    int p_rec;

    void printHeader(QPainter *painter);
    QString strDensity(double density);
    QString strDiff(double v1, double v2, int decimals, QString suffix);
    void checkHeader(QPainter *painter, qreal *y, QString text);
    void checkLine(QPainter *painter, qreal *y, QString text);
    void checkInput(QPainter *painter, qreal *y, QString text, QString prompt);
    bool checkSplit(QPainter *painter, qreal *y, int moment);
};

#endif

mercurial