Fri, 13 Jan 2023 12:00:58 +0100
Added a button to automatic recreate the yeast starter steps. Some code cleanup
127 | 1 | /** |
2 | * EditRecipe.cpp is part of bmsapp. | |
3 | * | |
4 | * Tab 1, generic settings. | |
5 | * | |
6 | * bmsapp is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * bmsapp is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | */ | |
19 | ||
20 | ||
395
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
21 | void EditRecipe::calcStyle() |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
22 | { |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
23 | /* |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
24 | * https://www.homebrewersassociation.org/forum/index.php?topic=10548.0 |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
25 | * |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
26 | * Calculate the ideal BU:GU and BU:RE ranges. These values |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
27 | * will be used in the RangedSliders. |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
28 | */ |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
29 | double bugu_min = recipe->st_ibu_min / ((recipe->st_og_min - 1) * 1000); |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
30 | double bugu_max = recipe->st_ibu_max / ((recipe->st_og_max - 1) * 1000); |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
31 | ui->est_buguShow->setRange(bugu_min, bugu_max); |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
32 | |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
33 | double fg_min = recipe->st_fg_min; |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
34 | if (fg_min < 1.002) /* Use 1.002 fg as lowest minimal value */ |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
35 | fg_min = 1.002; |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
36 | |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
37 | /* |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
38 | * Real Extract (RE) |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
39 | */ |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
40 | double re = ((0.1808 * ((Utils::sg_to_plato(recipe->st_og_min) + Utils::sg_to_plato(recipe->st_og_max)) / 2)) + |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
41 | (0.8192 * ((Utils::sg_to_plato(fg_min) + Utils::sg_to_plato(recipe->st_fg_max)) / 2))); |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
42 | |
397
877420a13815
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.
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
43 | /* |
877420a13815
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.
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
44 | * BU:RE |
877420a13815
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.
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
45 | * Divide over average RE gives the best ranges. |
877420a13815
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.
Michiel Broek <mbroek@mbse.eu>
parents:
395
diff
changeset
|
46 | */ |
395
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
47 | double bure_min = recipe->st_ibu_min / re; |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
48 | double bure_max = recipe->st_ibu_max / re; |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
49 | ui->est_bufguShow->setRange(bure_min, bure_max); |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
50 | } |
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
51 | |
127 | 52 | |
53 | void EditRecipe::name_changed(QString name) | |
54 | { | |
55 | recipe->name = name; | |
56 | is_changed(); | |
57 | } | |
58 | ||
59 | ||
60 | void EditRecipe::notes_changed() | |
61 | { | |
62 | /* The text cannot be passed in a simple way :) */ | |
63 | recipe->notes = ui->notesEdit->toPlainText(); | |
64 | is_changed(); | |
65 | } | |
66 | ||
67 | ||
68 | /* | |
69 | * New beerstyle is selected. | |
70 | */ | |
150
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
71 | void EditRecipe::style_changed(int val) |
127 | 72 | { |
73 | QSqlQuery query; | |
74 | ||
75 | query.prepare("SELECT * FROM profile_styles ORDER BY style_guide,style_letter,name"); | |
76 | query.exec(); | |
77 | query.first(); | |
78 | // Skip to the record index. | |
150
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
79 | for (int i = 0; i < (val - 1); i++) { |
127 | 80 | query.next(); |
81 | } | |
82 | // Set relevant fields and update ranges. | |
83 | recipe->st_name = query.value(1).toString(); | |
84 | recipe->st_category = query.value(2).toString(); | |
85 | recipe->st_category_number = query.value(3).toInt(); | |
86 | recipe->st_letter = query.value(4).toString(); | |
87 | recipe->st_guide = query.value(5).toString(); | |
88 | recipe->st_type = query.value(6).toInt(); | |
89 | recipe->st_og_min = query.value(7).toDouble(); | |
90 | recipe->st_og_max = query.value(8).toDouble(); | |
91 | recipe->st_fg_min = query.value(9).toDouble(); | |
92 | recipe->st_fg_max = query.value(10).toDouble(); | |
93 | recipe->st_ibu_min = query.value(11).toDouble(); | |
94 | recipe->st_ibu_max = query.value(12).toDouble(); | |
95 | recipe->st_color_min = query.value(13).toDouble(); | |
96 | recipe->st_color_max = query.value(14).toDouble(); | |
97 | recipe->st_carb_min = query.value(15).toDouble(); | |
98 | recipe->st_carb_max = query.value(16).toDouble(); | |
99 | recipe->st_abv_min = query.value(17).toDouble(); | |
100 | recipe->st_abv_max = query.value(18).toDouble(); | |
101 | ||
102 | ui->st_nameEdit->setText(recipe->st_name); | |
103 | ui->st_groupEdit->setText(recipe->st_letter); | |
104 | ui->st_guideEdit->setText(recipe->st_guide); | |
105 | ui->st_catEdit->setText(recipe->st_category); | |
106 | ui->st_catnrEdit->setText(QString("%1").arg(recipe->st_category_number)); | |
301
fe6346211b5b
Finally the translation of string arrays is working.
Michiel Broek <mbroek@mbse.eu>
parents:
171
diff
changeset
|
107 | ui->st_typeEdit->setText(QCoreApplication::translate("BeerType", g_style_types[recipe->st_type])); |
127 | 108 | |
109 | ui->est_ogShow->setRange(query.value(7).toDouble(), query.value(8).toDouble()); | |
110 | ui->est_fgShow->setRange(query.value(9).toDouble(), query.value(10).toDouble()); | |
111 | ui->est_ibuShow->setRange(query.value(11).toDouble(), query.value(12).toDouble()); | |
112 | ui->est_colorShow->setRange(query.value(13).toDouble(), query.value(14).toDouble()); | |
113 | ui->est_carbShow->setRange(query.value(15).toDouble(), query.value(16).toDouble()); | |
114 | ui->est_abvShow->setRange(query.value(17).toDouble(), query.value(18).toDouble()); | |
115 | ||
395
7212b980a527
Added Bitterness Unit to Real Extract unit calculation and display. In product use final values if possible for the BU:GU and BU:RE calculations depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents:
361
diff
changeset
|
116 | calcStyle(); |
127 | 117 | is_changed(); |
118 | } | |
119 | ||
120 | ||
150
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
121 | void EditRecipe::colormethod_changed(int val) |
127 | 122 | { |
150
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
123 | recipe->color_method = val; |
127 | 124 | calcFermentables(); |
125 | is_changed(); | |
126 | } | |
127 | ||
128 | ||
150
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
129 | void EditRecipe::ibumethod_changed(int val) |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
130 | { |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
131 | recipe->ibu_method = val; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
132 | calcIBUs(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
133 | is_changed(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
134 | } |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
135 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
136 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
137 | void EditRecipe::est_og_changed(double val) |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
138 | { |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
139 | recipe->est_og = val; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
140 | calcFermentablesFromOG(val);// Adjust fermentables amounts |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
141 | calcFermentables(); // Update the recipe details |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
142 | calcIBUs(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
143 | calcMash(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
144 | is_changed(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
145 | emit refreshAll(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
146 | } |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
147 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
148 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
149 | void EditRecipe::efficiency_changed(double val) |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
150 | { |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
151 | double estog = recipe->est_og; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
152 | recipe->efficiency = val; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
153 | calcFermentablesFromOG(estog); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
154 | calcFermentables(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
155 | calcIBUs(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
156 | is_changed(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
157 | emit refreshAll(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
158 | } |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
159 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
160 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
161 | void EditRecipe::boil_time_changed(int val) |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
162 | { |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
163 | qDebug() << "boil_time_changed" << val; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
164 | double new_evap = (0.1 * recipe->batch_size) * val / 60.0; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
165 | recipe->boil_size = recipe->batch_size + new_evap; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
166 | recipe->boil_time = val; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
167 | ui->boil_sizeEdit->setValue(recipe->boil_size); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
168 | calcFermentables(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
169 | calcIBUs(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
170 | is_changed(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
171 | } |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
172 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
173 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
174 | void EditRecipe::batch_size_changed(double val) |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
175 | { |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
176 | qDebug() << "batch_size_changed" << val << "old" << recipe->batch_size; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
177 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
178 | double evap = (0.1 * val) * recipe->boil_time / 60.0; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
179 | recipe->boil_size = val + evap; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
180 | double factor = val / recipe->batch_size; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
181 | ui->boil_sizeEdit->setValue(recipe->boil_size); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
182 | recipe->sparge_volume *= factor; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
183 | ui->sp_volEdit->setValue(recipe->sparge_volume); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
184 | recipe->batch_size = val; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
185 | calcFermentablesFromOG(recipe->est_og); // Keep the OG |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
186 | adjustWaters(factor); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
187 | calcFermentables(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
188 | adjustHops(factor); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
189 | adjustMiscs(factor); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
190 | adjustYeasts(factor); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
191 | calcIBUs(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
192 | calcWater(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
193 | calcMash(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
194 | is_changed(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
195 | emit refreshAll(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
196 | } |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
197 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
198 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
199 | void EditRecipe::brew_type_changed(int val) |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
200 | { |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
201 | recipe->type; |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
202 | is_changed(); |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
203 | } |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
204 | |
fd568cc1dd0e
Implemented the last widgets on the first tab and added the needed functions for them such as scaling the recipe. This is the last part of the recipe editor, now ready for testing.
Michiel Broek <mbroek@mbse.eu>
parents:
127
diff
changeset
|
205 | |
171
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
206 | void EditRecipe::locked_changed(bool val) |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
207 | { |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
208 | qDebug() << "locked_changed" << val; |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
209 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
210 | recipe->locked = val; |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
211 | setLocked(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
212 | is_changed(); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
213 | } |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
214 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
215 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
216 | void EditRecipe::setLocked(bool val) |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
217 | { |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
218 | /* Tab 1, generic */ |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
219 | ui->typeEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
220 | ui->color_methodEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
221 | ui->ibu_methodEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
222 | ui->beerstyleEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
223 | ui->nameEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
224 | ui->notesEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
225 | ui->batch_sizeEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
226 | ui->batch_sizeEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
227 | ui->boil_timeEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
228 | ui->boil_timeEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
229 | ui->efficiencyEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
230 | ui->efficiencyEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
231 | ui->est_ogEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
232 | ui->est_ogEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
233 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
234 | /* Tab 2, fermentables */ |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
235 | ui->est_og2Edit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
236 | ui->est_og2Edit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
237 | ui->addFermentable->setEnabled(! val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
238 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
239 | /* Tab 3, hops */ |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
240 | ui->addHop->setEnabled(! val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
241 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
242 | /* Tab 4, miscs */ |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
243 | ui->addMisc->setEnabled(! val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
244 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
245 | /* Tab 5, yeasts */ |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
246 | ui->addYeast->setEnabled(! val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
247 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
248 | /* Tab 6, mash */ |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
249 | ui->addMash->setEnabled(! val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
250 | ui->mash_nameEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
251 | ui->mash_pickEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
252 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
253 | /* Tab 7, water */ |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
254 | ui->wt_sourceEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
255 | ui->w1_nameEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
256 | ui->w2_nameEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
257 | ui->mw_acidPick->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
258 | ui->sp_acidtypeEdit->setDisabled(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
259 | ui->w2_volEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
260 | ui->w2_volEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
261 | ui->sp_volEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
262 | ui->sp_volEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
263 | ui->bs_cacl2Edit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
264 | ui->bs_cacl2Edit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
265 | ui->bs_caso4Edit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
266 | ui->bs_caso4Edit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
267 | ui->bs_mgso4Edit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
268 | ui->bs_mgso4Edit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
269 | ui->bs_naclEdit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
270 | ui->bs_naclEdit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
271 | ui->bs_mgcl2Edit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
272 | ui->bs_mgcl2Edit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
273 | ui->bs_nahco3Edit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
274 | ui->bs_nahco3Edit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
275 | ui->bs_caco3Edit->setReadOnly(val); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
276 | ui->bs_caco3Edit->setButtonSymbols(val ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
277 | if (val) { |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
278 | ui->mw_phEdit->setReadOnly(true); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
279 | ui->mw_phEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
280 | ui->mw_acidvolEdit->setReadOnly(true); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
281 | ui->mw_acidvolEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); |
359
dfbb012c631c
Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents:
301
diff
changeset
|
282 | ui->sp_phEdit->setReadOnly(true); |
dfbb012c631c
Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents:
301
diff
changeset
|
283 | ui->sp_phEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); |
dfbb012c631c
Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents:
301
diff
changeset
|
284 | ui->sp_acidvolEdit->setReadOnly(true); |
dfbb012c631c
Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents:
301
diff
changeset
|
285 | ui->sp_acidvolEdit->setButtonSymbols(QAbstractSpinBox::NoButtons); |
171
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
286 | } else { |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
287 | ui->mw_phEdit->setReadOnly(! recipe->calc_acid); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
288 | ui->mw_phEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
289 | ui->mw_acidvolEdit->setReadOnly(recipe->calc_acid); |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
290 | ui->mw_acidvolEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
359
dfbb012c631c
Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents:
301
diff
changeset
|
291 | ui->sp_phEdit->setReadOnly(! recipe->calc_acid); |
dfbb012c631c
Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents:
301
diff
changeset
|
292 | ui->sp_phEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); |
dfbb012c631c
Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents:
301
diff
changeset
|
293 | ui->sp_acidvolEdit->setReadOnly(recipe->calc_acid); |
dfbb012c631c
Redesign of the water tabs in product and recipe editors. Prepare for sparge water salt additions. Acid additions are now automatic or manual for mash and sparge. Fixed error in acid calculation strength. Fixed phophoric SG value.
Michiel Broek <mbroek@mbse.eu>
parents:
301
diff
changeset
|
294 | ui->sp_acidvolEdit->setButtonSymbols(recipe->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
171
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
295 | } |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
296 | ui->mw_autoEdit->setDisabled(val); |
361
ec8de79f6ff6
Improved selection logic for the sparge water.
Michiel Broek <mbroek@mbse.eu>
parents:
359
diff
changeset
|
297 | setButtons(val); |
171
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
298 | } |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
299 | |
6cd2d808d863
Implemented recipe lock setting.
Michiel Broek <mbroek@mbse.eu>
parents:
154
diff
changeset
|
300 |