Fri, 29 Jul 2022 13:12:26 +0200
First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | #ifndef _SETUP_H |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | #define _SETUP_H |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | #include <QDialog> |
41
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
5 | #include <QFileDialog> |
78
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
6 | #include <QtGui/QIcon> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
7 | #include <QtWidgets/QApplication> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
8 | #include <QtWidgets/QComboBox> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
9 | #include <QtWidgets/QDialog> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
10 | #include <QtWidgets/QDoubleSpinBox> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
11 | #include <QtWidgets/QFrame> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
12 | #include <QtWidgets/QGridLayout> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
13 | #include <QtWidgets/QLabel> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
14 | #include <QtWidgets/QLineEdit> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
15 | #include <QtWidgets/QPushButton> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
16 | #include <QtWidgets/QSpinBox> |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
17 | #include <QtWidgets/QWidget> |
41
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
18 | |
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
19 | QT_BEGIN_NAMESPACE |
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
20 | class QLabel; |
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
21 | QT_END_NAMESPACE |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | namespace Ui { |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | class Setup; |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | } |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | class Setup : public QDialog |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | { |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | Q_OBJECT |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | public: |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | explicit Setup(QWidget *parent = nullptr); |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | ~Setup(); |
41
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
34 | bool loadFile(const QString &); |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | signals: |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | void firstWindow(); |
78
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
38 | void setTitle(QString); |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | private slots: |
41
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
41 | void on_openButton_clicked(); |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | void on_quitButton_clicked(); |
16
a5d8e783a7b0
Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents:
15
diff
changeset
|
43 | void on_saveButton_clicked(); |
a5d8e783a7b0
Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents:
15
diff
changeset
|
44 | void is_changed(); |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | private: |
41
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
47 | QByteArray logoByteArray; |
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
48 | QImage image; |
78
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
49 | QLabel *logoLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
50 | QLabel *breweryLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
51 | QLabel *fwhLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
52 | QLabel *mashhopLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
53 | QLabel *pelletLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
54 | QLabel *hopplugLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
55 | QLabel *wethopLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
56 | QLabel *cryohopLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
57 | QLabel *grainLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
58 | QLabel *brixLabel; |
337
8133cdb19aa1
Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents:
78
diff
changeset
|
59 | QLabel *heightLabel; |
78
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
60 | QLabel *titleLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
61 | QLabel *colorLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
62 | QLabel *ibuLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
63 | QLabel *waterLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
64 | QLabel *yeastLabel; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
65 | |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
66 | QLineEdit *breweryEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
67 | |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
68 | QSpinBox *fwhEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
69 | QSpinBox *mashhopEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
70 | QSpinBox *pelletEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
71 | QSpinBox *hopplugEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
72 | QSpinBox *wethopEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
73 | QSpinBox *cryohopEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
74 | QComboBox *waterEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
75 | QDoubleSpinBox *grainEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
76 | QDoubleSpinBox *brixEdit; |
337
8133cdb19aa1
Added my_height global variable and edit in profile setup. This sets the height of the brewery above or below sealevel. Added calculations for the air pressure, boilpoint and IBU_reduction that all depend on the height. Currently not yet in use. Split out the real IBU calculation from the generic toIBU function. This has no effect on the results.
Michiel Broek <mbroek@mbse.eu>
parents:
78
diff
changeset
|
77 | QSpinBox *heightEdit; |
78
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
78 | QComboBox *colorEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
79 | QComboBox *ibuEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
80 | QComboBox *yeastEdit; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
81 | QPushButton *quitButton; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
82 | QPushButton *saveButton; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
83 | QPushButton *openButton; |
3a6cba2dd05d
Status and Windowtitle messages via signals and slots. Global setup now on the mainwindow.
Michiel Broek <mbroek@mbse.eu>
parents:
41
diff
changeset
|
84 | |
41
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
85 | double scaleFactor = 1; |
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
86 | |
dc4b659a320b
Added logo load and save in profile setup.
Michiel Broek <mbroek@mbse.eu>
parents:
16
diff
changeset
|
87 | void setImage(const QImage &newImage); |
16
a5d8e783a7b0
Completed the global setup editor.
Michiel Broek <mbroek@mbse.eu>
parents:
15
diff
changeset
|
88 | bool fieldIsChanged = false; |
15
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
89 | }; |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
90 | |
c58b82549713
Started adding the global setup screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | #endif |