src/EditRecipe.h

Wed, 06 Apr 2022 21:41:58 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 06 Apr 2022 21:41:58 +0200
changeset 112
9e0dfa78f349
parent 111
04f5a7c5a1dc
child 113
30a34d639e90
permissions
-rw-r--r--

Load miscs in QList.

92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 #ifndef _EDITRECIPE_H
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 #define _EDITRECIPE_H
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 #include <QDialog>
101
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
5 #include <QStringList>
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
6 #include <QJsonDocument>
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
7 #include <QJsonObject>
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
8 #include <QDoubleSpinBox>
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
9 #include <QCheckBox>
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
10 #include <QComboBox>
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
11 #include <QLineEdit>
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
12 #include <QDialogButtonBox>
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
13 #include <QList>
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
14
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
15
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
16 /*
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
17 * Fermentables, Hops, Miscs, Yeasts and Mashs are stored in the
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
18 * database in json arrays. These are the QList structures.
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
19 */
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
20 struct Fermentables
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
21 {
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
22 QString f_name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
23 QString f_origin;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
24 QString f_supplier;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
25 double f_amount;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
26 double f_cost;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
27 int f_type;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
28 double f_yield;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
29 double f_color;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
30 double f_coarse_fine_diff;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
31 double f_moisture;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
32 double f_diastatic_power;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
33 double f_protein;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
34 double f_dissolved_protein;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
35 double f_max_in_batch;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
36 int f_graintype;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
37 int f_added;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
38 bool f_recommend_mash;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
39 bool f_add_after_boil;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
40 bool f_adjust_to_total_100;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
41 double f_percentage;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
42 double f_di_ph;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
43 double f_acid_to_ph_57;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
44 };
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
45
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
46
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
47 struct Hops
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
48 {
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
49 QString h_name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
50 QString h_origin;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
51 double h_amount;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
52 double h_cost;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
53 int h_type;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
54 int h_form;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
55 int h_useat;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
56 double h_time;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
57 double h_alpha;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
58 double h_beta;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
59 double h_hsi;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
60 double h_humulene;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
61 double h_caryophyllene;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
62 double h_cohumulone;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
63 double h_myrcene;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
64 double h_total_oil;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
65 };
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
66
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
67
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
68 struct Miscs
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
69 {
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
70 QString m_name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
71 double m_amount;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
72 int m_type;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
73 int m_use_use;
112
9e0dfa78f349 Load miscs in QList.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
74 double m_time;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
75 bool m_amount_is_weight;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
76 double m_cost;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
77 };
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
78
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
79
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
80 struct Yeasts
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
81 {
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
82 QString y_name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
83 QString y_laboratory;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
84 QString y_product_id;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
85 double y_amount;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
86 int y_type;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
87 int y_form;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
88 double y_min_temperature;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
89 double y_max_temperature;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
90 int y_flocculation;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
91 double y_attenuation;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
92 double y_cells;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
93 double y_tolerance;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
94 double y_inventory;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
95 int y_use;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
96 bool y_sta1;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
97 bool y_bacteria;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
98 bool y_harvest_top;
111
04f5a7c5a1dc Load yeasts in QList.
Michiel Broek <mbroek@mbse.eu>
parents: 110
diff changeset
99 int y_harvest_time;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
100 double y_pitch_temperature;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
101 bool y_pofpos;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
102 int y_zymocide;
111
04f5a7c5a1dc Load yeasts in QList.
Michiel Broek <mbroek@mbse.eu>
parents: 110
diff changeset
103 int y_gr_hl_lo;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
104 double y_sg_lo;
111
04f5a7c5a1dc Load yeasts in QList.
Michiel Broek <mbroek@mbse.eu>
parents: 110
diff changeset
105 int y_gr_hl_hi;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
106 double y_sg_hi;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
107 double y_cost;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
108 };
92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109
105
e79079bf013d Hide not visible fermentables data inside the fermentablesTable so that all data stays together. Format the fermentables json data again after changes. Add confirmation message to delete a fermentable row. Added buttons for a fermentables row editor.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
110
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
111 struct Mashs
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
112 {
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
113 QString step_name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
114 int step_type;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
115 double step_volume; // May not be present
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
116 double step_infuse_amount; // May not be present
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
117 double step_infuse_temp; // May not be present
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
118 double step_temp;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
119 double step_time;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
120 double ramp_time;
109
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
121 double end_temp;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
122 double step_wg_ratio; // May not be present
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
123 };
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
124
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
125
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
126 /*
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
127 * The main recipe record stored in the database.
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
128 */
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
129 struct Recipe
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
130 {
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
131 int record;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
132 QString uuid;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
133 bool locked;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
134 QString st_name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
135 QString st_letter;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
136 QString st_guide;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
137 QString st_category;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
138 int st_category_number;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
139 int st_type;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
140 double st_og_min;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
141 double st_og_max;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
142 double st_fg_min;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
143 double st_fg_max;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
144 double st_ibu_min;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
145 double st_ibu_max;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
146 double st_color_min;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
147 double st_color_max;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
148 double st_carb_min;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
149 double st_carb_max;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
150 double st_abv_min;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
151 double st_abv_max;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
152
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
153 QString name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
154 QString notes;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
155 int type;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
156 double batch_size;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
157 double boil_size;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
158 double boil_time;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
159 double efficiency;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
160 double est_og;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
161 double est_fg;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
162 double est_abv;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
163 double est_color;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
164 int color_method;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
165 double est_ibu;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
166 int ibu_method;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
167 double est_carb;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
168
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
169 double sparge_temp;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
170 double sparge_ph;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
171 double sparge_volume;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
172 int sparge_source;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
173 int sparge_acid_type;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
174 double sparge_acid_perc;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
175 double sparge_acid_amount;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
176 double mash_ph;
109
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
177 QString mash_name;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
178 bool calc_acid;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
179
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
180 QString w1_name; ///< Water source 1
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
181 double w1_amount;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
182 double w1_calcium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
183 double w1_sulfate;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
184 double w1_chloride;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
185 double w1_sodium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
186 double w1_magnesium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
187 double w1_total_alkalinity;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
188 double w1_ph;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
189 double w1_cost;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
190 QString w2_name; ///< Water source 2
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
191 double w2_amount;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
192 double w2_calcium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
193 double w2_sulfate;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
194 double w2_chloride;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
195 double w2_sodium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
196 double w2_magnesium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
197 double w2_total_alkalinity;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
198 double w2_ph;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
199 double w2_cost;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
200 double wg_amount; ///< Mixed water
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
201 double wg_calcium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
202 double wg_sulfate;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
203 double wg_chloride;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
204 double wg_sodium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
205 double wg_magnesium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
206 double wg_total_alkalinity;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
207 double wg_ph;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
208 double wb_calcium; ///< Treated water
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
209 double wb_sulfate;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
210 double wb_chloride;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
211 double wb_sodium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
212 double wb_magnesium;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
213 double wb_total_alkalinity;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
214 double wb_ph;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
215 double wa_acid_name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
216 double wa_acid_perc;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
217 double wa_base_name;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
218
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
219 QList<Fermentables> fermentables;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
220 QList<Hops> hops;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
221 QList<Miscs> miscs;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
222 QList<Yeasts> yeasts;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
223 QList<Mashs> mashs;
109
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
224
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
225 /*
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
226 * These are not in the MySL database, but are global variables
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
227 * that belong with the loaded recipe data and are present to
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
228 * make things easier.
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
229 */
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
230 int fermentables_current; ///< Current record, -1 is invalid.
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
231 bool fermentables_use100; ///< Use percentages instead of amount
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
232 int hops_current;
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
233 int misc_current;
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
234 int yeasts_current;
1ce50e72a6b1 Completed read MySQL recipe record. Mash schedule moved to recipe QList.
Michiel Broek <mbroek@mbse.eu>
parents: 108
diff changeset
235 int mashs_current;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
236 };
105
e79079bf013d Hide not visible fermentables data inside the fermentablesTable so that all data stays together. Format the fermentables json data again after changes. Add confirmation message to delete a fermentable row. Added buttons for a fermentables row editor.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
237
e79079bf013d Hide not visible fermentables data inside the fermentablesTable so that all data stays together. Format the fermentables json data again after changes. Add confirmation message to delete a fermentable row. Added buttons for a fermentables row editor.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
238
92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
239 namespace Ui {
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 class EditRecipe;
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241 }
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
242
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243 class EditRecipe : public QDialog
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
244 {
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 Q_OBJECT
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
246
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
247 signals:
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248 void entry_changed();
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250 public:
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251 explicit EditRecipe(int id, QWidget *parent = 0);
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
252 ~EditRecipe();
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
254 private slots:
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
255 void on_saveButton_clicked();
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
256 void on_quitButton_clicked();
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
257 void on_deleteButton_clicked();
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
258 void is_changed();
101
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
259 void style_changed();
102
b017001850df Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
260 void colormethod_changed();
101
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
261 void refreshFermentables();
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
262 void refreshHops();
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
263 void refreshMiscs();
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
264 void refreshYeasts();
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
265 void refreshMashs();
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
266 void refreshAll();
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
267 void ferment_amount_changed(double val);
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
268 void ferment_pct_changed(double val);
101
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
269 void on_deleteFermentRow_clicked();
105
e79079bf013d Hide not visible fermentables data inside the fermentablesTable so that all data stays together. Format the fermentables json data again after changes. Add confirmation message to delete a fermentable row. Added buttons for a fermentables row editor.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
270 void on_editFermentRow_clicked();
92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271
102
b017001850df Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
272 void on_perc_mash_valueChanged(int value);
b017001850df Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
273 void on_perc_sugars_valueChanged(int value);
b017001850df Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
274 void on_perc_cara_valueChanged(int value);
b017001850df Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
275 void on_lintner_valueChanged(int value);
b017001850df Almost finished calcFermentables()
Michiel Broek <mbroek@mbse.eu>
parents: 101
diff changeset
276
92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 private:
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
278 Ui::EditRecipe *ui;
101
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
279 QStringList s_types = { tr("Lager"), tr("Ale"), tr("Mead"), tr("Wheat"), tr("Mixed"), tr("Cider") };
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
280 QStringList f_types = { tr("Grain"), tr("Sugar"), tr("Extract"), tr("Dry extract"), tr("Adjunct") };
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
281 QStringList f_graintypes = { tr("Base"), tr("Roast"), tr("Crystal"), tr("Kilned"), tr("Sour Malt"), tr("Special"), tr("No malt")};
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
282 QStringList f_added = { tr("Mash"), tr("Boil"), tr("Fermentation"), tr("Lagering"), tr("Bottle"), tr("Kegs") };
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
283 QString bar_red = "QProgressBar::chunk {background: #FF0000;}";
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
284 QString bar_orange = "QProgressBar::chunk {background: #EB7331;}";
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
285 QString bar_green = "QProgressBar::chunk {background: #008C00;}";
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
286 int recno, editrow;
92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 bool textIsChanged = false;
101
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
288 bool ignoreChanges = false;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
289 Recipe *recipe;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
290 /*
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
291 * Variables for popup ingredients editing.
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
292 */
112
9e0dfa78f349 Load miscs in QList.
Michiel Broek <mbroek@mbse.eu>
parents: 111
diff changeset
293 QJsonDocument hops;
108
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
294 QComboBox *selectEdit, *addedEdit;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
295 QLineEdit *nameEdit, *supplierEdit;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
296 QDoubleSpinBox *amountEdit, *pctEdit, *maxEdit;
ecfcbee4a9b2 Redesign the database interface for the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 107
diff changeset
297 QCheckBox *to100Edit, *instockEdit;
92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298
110
224be4d9f8eb Fermentables are loaded in the main recipe record in a QList. The refresh table function does the sorting, on added moment (mash first), amount and finally color of the malt. Removed the old hidden table columns. Do all manipulation on the recipe record with QList arrays. The ferment_amount_changed() slot is complete. The whole recipe editor is going in the right direction.
Michiel Broek <mbroek@mbse.eu>
parents: 109
diff changeset
299 static bool ferment_sort_test(const Fermentables &D1, const Fermentables &D2);
92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 void WindowTitle();
105
e79079bf013d Hide not visible fermentables data inside the fermentablesTable so that all data stays together. Format the fermentables json data again after changes. Add confirmation message to delete a fermentable row. Added buttons for a fermentables row editor.
Michiel Broek <mbroek@mbse.eu>
parents: 103
diff changeset
301 void fermentable_Json();
101
1d14d3bf2465 Added change beerstyle, the fermentables table, and first part of calcFermentables to the recipe editor.
Michiel Broek <mbroek@mbse.eu>
parents: 92
diff changeset
302 void calcFermentables();
92
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 };
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304
fb0bb9a2a7e1 Added support to build designer plugins, but it is nog yet complete. Added RangedSlider fro the brewtarget project to make our version of it. Started EditRecipe screen.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
305 #endif

mercurial