11 #include <QLineEdit> |
11 #include <QLineEdit> |
12 #include <QDialogButtonBox> |
12 #include <QDialogButtonBox> |
13 #include <QList> |
13 #include <QList> |
14 #include <QLabel> |
14 #include <QLabel> |
15 |
15 |
16 |
16 #include "global.h" |
17 /* |
|
18 * Fermentables, Hops, Miscs, Yeasts and Mashs are stored in the |
|
19 * database in json arrays. These are the QList structures. |
|
20 */ |
|
21 struct Fermentables |
|
22 { |
|
23 QString f_name; |
|
24 QString f_origin; |
|
25 QString f_supplier; |
|
26 double f_amount; |
|
27 double f_cost; |
|
28 int f_type; |
|
29 double f_yield; |
|
30 double f_color; |
|
31 double f_coarse_fine_diff; |
|
32 double f_moisture; |
|
33 double f_diastatic_power; |
|
34 double f_protein; |
|
35 double f_dissolved_protein; |
|
36 double f_max_in_batch; |
|
37 int f_graintype; |
|
38 int f_added; |
|
39 bool f_recommend_mash; |
|
40 bool f_add_after_boil; |
|
41 bool f_adjust_to_total_100; |
|
42 double f_percentage; |
|
43 double f_di_ph; |
|
44 double f_acid_to_ph_57; |
|
45 }; |
|
46 |
|
47 |
|
48 struct Hops |
|
49 { |
|
50 QString h_name; |
|
51 QString h_origin; |
|
52 double h_amount; |
|
53 double h_cost; |
|
54 int h_type; |
|
55 int h_form; |
|
56 int h_useat; |
|
57 double h_time; |
|
58 double h_alpha; |
|
59 double h_beta; |
|
60 double h_hsi; |
|
61 double h_humulene; |
|
62 double h_caryophyllene; |
|
63 double h_cohumulone; |
|
64 double h_myrcene; |
|
65 double h_total_oil; |
|
66 }; |
|
67 |
|
68 |
|
69 struct Miscs |
|
70 { |
|
71 QString m_name; |
|
72 double m_amount; |
|
73 int m_type; |
|
74 int m_use_use; |
|
75 double m_time; |
|
76 bool m_amount_is_weight; |
|
77 double m_cost; |
|
78 }; |
|
79 |
|
80 |
|
81 struct Yeasts |
|
82 { |
|
83 QString y_name; |
|
84 QString y_laboratory; |
|
85 QString y_product_id; |
|
86 double y_amount; |
|
87 int y_type; |
|
88 int y_form; |
|
89 double y_min_temperature; |
|
90 double y_max_temperature; |
|
91 int y_flocculation; |
|
92 double y_attenuation; |
|
93 double y_cells; |
|
94 double y_tolerance; |
|
95 double y_inventory; |
|
96 int y_use; |
|
97 bool y_sta1; |
|
98 bool y_bacteria; |
|
99 bool y_harvest_top; |
|
100 int y_harvest_time; |
|
101 double y_pitch_temperature; |
|
102 bool y_pofpos; |
|
103 int y_zymocide; |
|
104 int y_gr_hl_lo; |
|
105 double y_sg_lo; |
|
106 int y_gr_hl_hi; |
|
107 double y_sg_hi; |
|
108 double y_cost; |
|
109 }; |
|
110 |
|
111 |
|
112 struct Mashs |
|
113 { |
|
114 QString step_name; |
|
115 int step_type; |
|
116 double step_volume; ///< The water volume upto this step. |
|
117 double step_infuse_amount; ///< Infuse/decoction volume this step. |
|
118 double step_infuse_temp; ///< Infuse/decoction temperature. |
|
119 double step_temp; ///< Start tmperature this step. |
|
120 double step_time; ///< Step rest time. |
|
121 double ramp_time; ///< Estimated ramp time to this step. |
|
122 double end_temp; ///< End temperature this step. |
|
123 double step_wg_ratio; ///< Current water/grain ratio. |
|
124 }; |
|
125 |
|
126 |
|
127 /* |
|
128 * The main recipe record stored in the database. |
|
129 */ |
|
130 struct Recipe |
|
131 { |
|
132 int record; |
|
133 QString uuid; |
|
134 bool locked; |
|
135 QString st_name; |
|
136 QString st_letter; |
|
137 QString st_guide; |
|
138 QString st_category; |
|
139 int st_category_number; |
|
140 int st_type; |
|
141 double st_og_min; |
|
142 double st_og_max; |
|
143 double st_fg_min; |
|
144 double st_fg_max; |
|
145 double st_ibu_min; |
|
146 double st_ibu_max; |
|
147 double st_color_min; |
|
148 double st_color_max; |
|
149 double st_carb_min; |
|
150 double st_carb_max; |
|
151 double st_abv_min; |
|
152 double st_abv_max; |
|
153 |
|
154 QString name; |
|
155 QString notes; |
|
156 int type; |
|
157 double batch_size; |
|
158 double boil_size; |
|
159 double boil_time; |
|
160 double efficiency; |
|
161 double est_og; |
|
162 double est_fg; |
|
163 double est_abv; |
|
164 double est_color; |
|
165 int color_method; |
|
166 double est_ibu; |
|
167 int ibu_method; |
|
168 double est_carb; |
|
169 |
|
170 double sparge_temp; |
|
171 double sparge_ph; |
|
172 double sparge_volume; |
|
173 int sparge_source; |
|
174 int sparge_acid_type; |
|
175 double sparge_acid_perc; |
|
176 double sparge_acid_amount; |
|
177 double mash_ph; |
|
178 QString mash_name; |
|
179 bool calc_acid; |
|
180 |
|
181 QString w1_name; ///< Water source 1 |
|
182 double w1_amount; |
|
183 double w1_calcium; |
|
184 double w1_sulfate; |
|
185 double w1_chloride; |
|
186 double w1_sodium; |
|
187 double w1_magnesium; |
|
188 double w1_total_alkalinity; |
|
189 double w1_ph; |
|
190 double w1_cost; |
|
191 QString w2_name; ///< Water source 2 |
|
192 double w2_amount; |
|
193 double w2_calcium; |
|
194 double w2_sulfate; |
|
195 double w2_chloride; |
|
196 double w2_sodium; |
|
197 double w2_magnesium; |
|
198 double w2_total_alkalinity; |
|
199 double w2_ph; |
|
200 double w2_cost; |
|
201 double wg_amount; ///< Mixed water |
|
202 double wg_calcium; |
|
203 double wg_sulfate; |
|
204 double wg_chloride; |
|
205 double wg_sodium; |
|
206 double wg_magnesium; |
|
207 double wg_total_alkalinity; |
|
208 double wg_ph; |
|
209 double wb_calcium; ///< Treated water |
|
210 double wb_sulfate; |
|
211 double wb_chloride; |
|
212 double wb_sodium; |
|
213 double wb_magnesium; |
|
214 double wb_total_alkalinity; |
|
215 double wb_ph; |
|
216 int wa_acid_name; |
|
217 double wa_acid_perc; |
|
218 int wa_base_name; |
|
219 |
|
220 QList<Fermentables> fermentables; |
|
221 QList<Hops> hops; |
|
222 QList<Miscs> miscs; |
|
223 QList<Yeasts> yeasts; |
|
224 QList<Mashs> mashs; |
|
225 |
|
226 /* |
|
227 * These are not in the MySL database, but are global variables |
|
228 * that belong with the loaded recipe data and are present to |
|
229 * make things easier. |
|
230 */ |
|
231 int fermentables_row; ///< Current row, -1 is invalid. |
|
232 bool fermentables_use100; ///< Use percentages instead of amount |
|
233 int hops_row; |
|
234 int miscs_row; |
|
235 int yeasts_row; |
|
236 int mashs_row; |
|
237 double mashs_kg; ///< Kg fermentables in the mash. |
|
238 int mashs_time; ///< Total mash time. |
|
239 double preboil_sg; |
|
240 }; |
|
241 |
|
242 |
17 |
243 namespace Ui { |
18 namespace Ui { |
244 class EditRecipe; |
19 class EditRecipe; |
245 } |
20 } |
246 |
21 |
359 QString bar_60 = "QProgressBar::chunk {background: #00BF00;}"; |
134 QString bar_60 = "QProgressBar::chunk {background: #00BF00;}"; |
360 QString bar_80 = "QProgressBar::chunk {background: #00FF00;}"; |
135 QString bar_80 = "QProgressBar::chunk {background: #00FF00;}"; |
361 QString bar_100 = "QProgressBar::chunk {background: #80FF80;}"; |
136 QString bar_100 = "QProgressBar::chunk {background: #80FF80;}"; |
362 int recno; |
137 int recno; |
363 bool textIsChanged = false; |
138 bool textIsChanged = false; |
364 Recipe *recipe; |
139 // Recipe *recipe; |
365 /* |
140 /* |
366 * Variables for popup ingredients editing. |
141 * Variables for popup ingredients editing. |
367 */ |
142 */ |
368 QComboBox *fselectEdit, *faddedEdit, *hselectEdit,*haddedEdit, *useatEdit, *mselectEdit, *yselectEdit; |
143 QComboBox *fselectEdit, *faddedEdit, *hselectEdit,*haddedEdit, *useatEdit, *mselectEdit, *yselectEdit; |
369 QLineEdit *fnameEdit, *fsupplierEdit, *hnameEdit, *horiginEdit, *mnameEdit, *ynameEdit, *ylaboratoryEdit, *yproduct_idEdit, *stepnameEdit; |
144 QLineEdit *fnameEdit, *fsupplierEdit, *hnameEdit, *horiginEdit, *mnameEdit, *ynameEdit, *ylaboratoryEdit, *yproduct_idEdit, *stepnameEdit; |