Fri, 20 May 2022 22:06:06 +0200
Version 0.2.1. Updated translations.
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /** |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | * EditProduct.cpp is part of bmsapp. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * bmsapp is free software: you can redistribute it and/or modify |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * it under the terms of the GNU General Public License as published by |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * the Free Software Foundation, either version 3 of the License, or |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * (at your option) any later version. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * bmsapp is distributed in the hope that it will be useful, |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * GNU General Public License for more details. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * You should have received a copy of the GNU General Public License |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | #include "MainWindow.h" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | #include "EditProduct.h" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | #include "PrinterDialog.h" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | #include "../ui/ui_EditProduct.h" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | #include "Utils.h" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | #include "global.h" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | EditProduct::EditProduct(int id, QWidget *parent) : QDialog(parent), ui(new Ui::EditProduct) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | QSqlQuery query, wquery, yquery; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | qDebug() << "EditProduct record:" << id; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | product = new Product; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | ui->setupUi(this); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | product->fermentables_row = product->hops_row = product->miscs_row = product->yeasts_row = product->mashs_row = -1; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | product->fermentables_use100 = false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | this->recno = id; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | WindowTitle(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | ui->typeEdit->addItem(tr("Extract")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | ui->typeEdit->addItem(tr("Partial Mash")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
41 | ui->typeEdit->addItem(tr("All Grain")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
43 | ui->color_methodEdit->addItem("Morey"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | ui->color_methodEdit->addItem("Mosher"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | ui->color_methodEdit->addItem("Daniels"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | ui->color_methodEdit->addItem("Halberstadt"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | ui->color_methodEdit->addItem("Naudts"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
49 | ui->ibu_methodEdit->addItem("Tinseth"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | ui->ibu_methodEdit->addItem("Rager"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
51 | ui->ibu_methodEdit->addItem("Daniels"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
52 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
53 | for (int i = 0; i < my_acids.size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
54 | ui->mw_acidPick->addItem(my_acids.at(i).name_en); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | ui->sp_acidtypeEdit->addItem(my_acids.at(i).name_en); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
56 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
57 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
58 | ui->sp_sourceEdit->addItem(tr("Source 1")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
59 | ui->sp_sourceEdit->addItem(tr("Source 2")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
60 | ui->sp_sourceEdit->addItem(tr("Mixed")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
62 | query.prepare("SELECT name FROM inventory_waters ORDER BY record"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
63 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
64 | ui->w1_nameEdit->addItem(""); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
65 | ui->w2_nameEdit->addItem(""); |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
66 | while (query.next()) { |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
67 | ui->w1_nameEdit->addItem(query.value(0).toString()); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
68 | ui->w2_nameEdit->addItem(query.value(0).toString()); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
69 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
70 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
71 | query.prepare("SELECT name FROM profile_water ORDER BY name"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
72 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
73 | ui->wt_sourceEdit->addItem(""); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
74 | while (query.next()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | ui->wt_sourceEdit->addItem(query.value(0).toString()); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
77 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | query.prepare("SELECT name FROM profile_mash ORDER BY name"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
80 | ui->mash_pickEdit->addItem(""); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
81 | while (query.next()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
82 | ui->mash_pickEdit->addItem(query.value(0).toString()); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
83 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
84 | |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
85 | ui->beerstyleEdit->addItem(product->st_name); // First add a dummy, the current style |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
86 | query.prepare("SELECT style_guide,style_letter,name FROM profile_styles ORDER BY style_guide,style_letter,name"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
87 | query.exec(); |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
88 | while (query.next()) { |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
89 | ui->beerstyleEdit->addItem(query.value(0).toString()+" "+query.value(1).toString()+" "+query.value(2).toString()); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
90 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | |
185
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
92 | ui->brew_coolwithEdit->addItem("-"); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
93 | ui->brew_coolwithEdit->addItem(tr("Emersion chiller")); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
94 | ui->brew_coolwithEdit->addItem(tr("Counterflow chiller")); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
95 | ui->brew_coolwithEdit->addItem(tr("Au bain marie")); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
96 | ui->brew_coolwithEdit->addItem(tr("Natural")); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
97 | |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
98 | ui->brew_aerwithEdit->addItem(tr("None")); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
99 | ui->brew_aerwithEdit->addItem(tr("Air")); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
100 | ui->brew_aerwithEdit->addItem(tr("Oxygen")); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
101 | |
187
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
102 | ui->bottle_sugarEdit->addItem(""); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
103 | ui->keg_sugarEdit->addItem(""); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
104 | query.prepare("SELECT name FROM inventory_fermentables WHERE type = '1' OR type = '3' ORDER BY name"); // Sugars or dry extract |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
105 | query.exec(); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
106 | while (query.next()) { |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
107 | ui->bottle_sugarEdit->addItem(query.value(0).toString()); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
108 | ui->keg_sugarEdit->addItem(query.value(0).toString()); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
109 | } |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
110 | |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
111 | if (id >= 0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
112 | query.prepare("SELECT * FROM products WHERE record = :recno"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
113 | query.bindValue(":recno", id); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
114 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
115 | if (! query.first()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
116 | qDebug() << "EditProduct seek error record" << id; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
117 | QMessageBox::warning(this, tr("Database error"), tr("MySQL error: record %1 not found").arg(id)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
118 | this->done(QDialog::Rejected); // At this stage, this doesn't work because the dialog is not yet visible. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
119 | return; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
120 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
121 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
122 | QSqlRecord rec = query.record(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
123 | for (int i = 0; i < rec.count(); i++) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
124 | qDebug() << i << rec.fieldName(i) << query.value(i); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
125 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
126 | product->record = query.value("record").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
127 | product->uuid = query.value("uuid").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
128 | product->name = query.value("name").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
129 | product->code = query.value("code").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
130 | product->birth = query.value("birth").toDate(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
131 | product->stage = query.value("stage").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
132 | product->notes = query.value("notes").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
133 | product->log_brew = query.value("log_brew").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
134 | product->log_fermentation = query.value("log_fermentation").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
135 | product->log_ispindel = query.value("log_ispindel").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
136 | product->log_co2pressure = query.value("log_co2pressure").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
137 | product->inventory_reduced = query.value("inventory_reduced").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
138 | product->locked = query.value("locked").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
139 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
140 | product->eq_name = query.value("eq_name").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
141 | product->eq_notes = query.value("eq_notes").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
142 | product->eq_boil_size = query.value("eq_boil_size").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
143 | product->eq_batch_size = query.value("eq_batch_size").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
144 | product->eq_tun_volume = query.value("eq_tun_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
145 | product->eq_tun_weight = query.value("eq_tun_weight").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
146 | product->eq_tun_specific_heat = query.value("eq_tun_specific_heat").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
147 | product->eq_tun_material = query.value("eq_tun_material").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
148 | product->eq_tun_height = query.value("eq_tun_height").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
149 | product->eq_top_up_water = query.value("eq_top_up_water").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
150 | product->eq_trub_chiller_loss = query.value("eq_trub_chiller_loss").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
151 | product->eq_evap_rate = query.value("eq_evap_rate").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
152 | product->eq_boil_time = query.value("eq_boil_time").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
153 | product->eq_calc_boil_volume = query.value("eq_calc_boil_volume").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
154 | product->eq_top_up_kettle = query.value("eq_top_up_kettle").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
155 | product->eq_hop_utilization = query.value("eq_hop_utilization").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
156 | product->eq_lauter_volume = query.value("eq_lauter_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
157 | product->eq_lauter_height = query.value("eq_lauter_height").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
158 | product->eq_lauter_deadspace = query.value("eq_lauter_deadspace").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
159 | product->eq_kettle_volume = query.value("eq_kettle_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
160 | product->eq_kettle_height = query.value("eq_kettle_height").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
161 | product->eq_mash_volume = query.value("eq_mash_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
162 | product->eq_mash_max = query.value("eq_mash_max").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
163 | product->eq_efficiency = query.value("eq_efficiency").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
164 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
165 | product->brew_date_start = query.value("brew_date_start").toDateTime(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
166 | product->brew_mash_ph = query.value("brew_mash_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
167 | product->brew_mash_sg = query.value("brew_mash_sg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
168 | product->brew_mash_efficiency = query.value("brew_mash_efficiency").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
169 | product->brew_sparge_temperature = query.value("brew_sparge_temperature").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
170 | product->brew_sparge_volume = query.value("brew_sparge_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
171 | product->brew_sparge_est = query.value("brew_sparge_est").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
172 | product->brew_sparge_ph = query.value("brew_sparge_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
173 | product->brew_preboil_volume = query.value("brew_preboil_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
174 | product->brew_preboil_sg = query.value("brew_preboil_sg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
175 | product->brew_preboil_ph = query.value("brew_preboil_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
176 | product->brew_preboil_efficiency = query.value("brew_preboil_efficiency").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
177 | product->brew_aboil_volume = query.value("brew_aboil_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
178 | product->brew_aboil_sg = query.value("brew_aboil_sg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
179 | product->brew_aboil_ph = query.value("brew_aboil_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
180 | product->brew_aboil_efficiency = query.value("brew_aboil_efficiency").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
181 | product->brew_cooling_method = query.value("brew_cooling_method").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
182 | product->brew_cooling_time = query.value("brew_cooling_time").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
183 | product->brew_cooling_to = query.value("brew_cooling_to").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
184 | product->brew_whirlpool9 = query.value("brew_whirlpool9").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
185 | product->brew_whirlpool7 = query.value("brew_whirlpool7").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
186 | product->brew_whirlpool6 = query.value("brew_whirlpool6").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
187 | product->brew_whirlpool2 = query.value("brew_whirlpool2").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
188 | product->brew_fermenter_volume = query.value("brew_fermenter_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
189 | product->brew_fermenter_extrawater = query.value("brew_fermenter_extrawater").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
190 | product->brew_fermenter_tcloss = query.value("brew_fermenter_tcloss").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
191 | product->brew_aeration_time = query.value("brew_aeration_time").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
192 | product->brew_aeration_speed = query.value("brew_aeration_speed").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
193 | product->brew_aeration_type = query.value("brew_aeration_type").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
194 | product->brew_fermenter_sg = query.value("brew_fermenter_sg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
195 | product->brew_fermenter_ibu = query.value("brew_fermenter_ibu").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
196 | product->brew_fermenter_color = query.value("brew_fermenter_color").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
197 | product->brew_date_end = query.value("brew_date_end").toDateTime(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
198 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
199 | product->og = query.value("og").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
200 | product->fg = query.value("fg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
201 | product->primary_start_temp = query.value("primary_start_temp").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
202 | product->primary_max_temp = query.value("primary_max_temp").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
203 | product->primary_end_temp = query.value("primary_end_temp").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
204 | product->primary_end_sg = query.value("primary_end_sg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
205 | product->primary_end_date = query.value("primary_end_date").toDate(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
206 | product->secondary_temp = query.value("secondary_temp").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
207 | product->secondary_end_sg = query.value("secondary_end_sg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
208 | product->secondary_end_date = query.value("secondary_end_date").toDate(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
209 | product->tertiary_temp = query.value("tertiary_temp").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
210 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
211 | product->package_date = query.value("package_date").toDate(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
212 | product->package_volume = query.value("package_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
213 | product->package_infuse_amount = query.value("package_infuse_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
214 | product->package_infuse_abv = query.value("package_infuse_abv").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
215 | product->package_infuse_notes = query.value("package_infuse_notes").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
216 | product->package_abv = query.value("package_abv").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
217 | product->package_ph = query.value("package_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
218 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
219 | product->bottle_amount = query.value("bottle_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
220 | product->bottle_carbonation = query.value("bottle_carbonation").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
221 | product->bottle_priming_sugar = query.value("bottle_priming_sugar").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
222 | product->bottle_priming_amount = query.value("bottle_priming_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
223 | product->bottle_priming_water = query.value("bottle_priming_water").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
224 | product->bottle_carbonation_temp = query.value("bottle_carbonation_temp").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
225 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
226 | product->keg_amount = query.value("keg_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
227 | product->keg_carbonation = query.value("keg_carbonation").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
228 | product->keg_priming_sugar = query.value("keg_priming_sugar").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
229 | product->keg_priming_amount = query.value("keg_priming_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
230 | product->keg_priming_water = query.value("keg_priming_water").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
231 | product->keg_carbonation_temp = query.value("keg_carbonation_temp").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
232 | product->keg_forced_carb = query.value("keg_forced_carb").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
233 | product->keg_pressure = query.value("keg_pressure").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
234 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
235 | product->taste_notes = query.value("taste_notes").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
236 | product->taste_rate = query.value("taste_rate").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
237 | product->taste_date = query.value("taste_date").toDate(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
238 | product->taste_color = query.value("taste_color").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
239 | product->taste_transparency = query.value("taste_transparency").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
240 | product->taste_head = query.value("taste_head").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
241 | product->taste_aroma = query.value("taste_aroma").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
242 | product->taste_taste = query.value("taste_taste").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
243 | product->taste_mouthfeel = query.value("taste_mouthfeel").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
244 | product->taste_aftertaste = query.value("taste_aftertaste").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
245 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
246 | product->st_name = query.value("st_name").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
247 | product->st_letter = query.value("st_letter").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
248 | product->st_guide = query.value("st_guide").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
249 | product->st_category = query.value("st_category").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
250 | product->st_category_number = query.value("st_category_number").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
251 | product->st_type = query.value("st_type").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
252 | product->st_og_min = query.value("st_og_min").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
253 | product->st_og_max = query.value("st_og_max").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
254 | product->st_fg_min = query.value("st_fg_min").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
255 | product->st_fg_max = query.value("st_fg_max").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
256 | product->st_ibu_min = query.value("st_ibu_min").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
257 | product->st_ibu_max = query.value("st_ibu_max").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
258 | product->st_color_min = query.value("st_color_min").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
259 | product->st_color_max = query.value("st_color_max").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
260 | product->st_carb_min = query.value("st_carb_min").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
261 | product->st_carb_max = query.value("st_carb_max").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
262 | product->st_abv_min = query.value("st_abv_min").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
263 | product->st_abv_max = query.value("st_abv_max").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
264 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
265 | product->type = query.value("type").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
266 | product->batch_size = query.value("batch_size").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
267 | product->boil_size = query.value("boil_size").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
268 | product->boil_time = query.value("boil_time").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
269 | product->efficiency = query.value("efficiency").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
270 | product->est_og = query.value("est_og").toDouble(); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
271 | product->est_og3 = query.value("est_og3").toDouble(); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
272 | product->est_fg = query.value("est_fg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
273 | product->est_abv = query.value("est_abv").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
274 | product->est_color = query.value("est_color").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
275 | product->color_method = query.value("color_method").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
276 | product->est_ibu = query.value("est_ibu").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
277 | product->ibu_method = query.value("ibu_method").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
278 | product->est_carb = query.value("est_carb").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
279 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
280 | product->sparge_temp = query.value("sparge_temp").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
281 | product->sparge_ph = query.value("sparge_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
282 | product->sparge_volume = query.value("sparge_volume").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
283 | product->sparge_source = query.value("sparge_source").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
284 | product->sparge_acid_type = query.value("sparge_acid_type").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
285 | product->sparge_acid_perc = query.value("sparge_acid_perc").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
286 | product->sparge_acid_amount = query.value("sparge_acid_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
287 | product->mash_ph = query.value("mash_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
288 | product->mash_name = query.value("mash_name").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
289 | product->calc_acid = query.value("calc_acid").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
290 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
291 | product->w1_name = query.value("w1_name").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
292 | product->w1_amount = query.value("w1_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
293 | product->w1_calcium = query.value("w1_calcium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
294 | product->w1_sulfate = query.value("w1_sulfate").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
295 | product->w1_chloride = query.value("w1_chloride").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
296 | product->w1_sodium = query.value("w1_sodium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
297 | product->w1_magnesium = query.value("w1_magnesium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
298 | product->w1_total_alkalinity = query.value("w1_total_alkalinity").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
299 | product->w1_ph = query.value("w1_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
300 | product->w1_cost = query.value("w1_cost").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
301 | product->w2_name = query.value("w2_name").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
302 | product->w2_amount = query.value("w2_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
303 | product->w2_calcium = query.value("w2_calcium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
304 | product->w2_sulfate = query.value("w2_sulfate").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
305 | product->w2_chloride = query.value("w2_chloride").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
306 | product->w2_sodium = query.value("w2_sodium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
307 | product->w2_magnesium = query.value("w2_magnesium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
308 | product->w2_total_alkalinity = query.value("w2_total_alkalinity").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
309 | product->w2_ph = query.value("w2_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
310 | product->w2_cost = query.value("w2_cost").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
311 | product->wg_amount = query.value("wg_amount").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
312 | product->wg_calcium = query.value("wg_calcium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
313 | product->wg_sulfate = query.value("wg_sulfate").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
314 | product->wg_chloride = query.value("wg_chloride").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
315 | product->wg_sodium = query.value("wg_sodium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
316 | product->wg_magnesium = query.value("wg_magnesium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
317 | product->wg_total_alkalinity = query.value("wg_total_alkalinity").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
318 | product->wg_ph = query.value("wg_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
319 | product->wb_calcium = query.value("wb_calcium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
320 | product->wb_sulfate = query.value("wb_sulfate").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
321 | product->wb_chloride = query.value("wb_chloride").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
322 | product->wb_sodium = query.value("wb_sodium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
323 | product->wb_magnesium = query.value("wb_magnesium").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
324 | product->wb_total_alkalinity = query.value("wb_total_alkalinity").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
325 | product->wb_ph = query.value("wb_ph").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
326 | product->wa_acid_name = query.value("wa_acid_name").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
327 | product->wa_acid_perc = query.value("wa_acid_perc").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
328 | product->wa_base_name = query.value("wa_base_name").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
329 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
330 | product->starter_enable = query.value("starter_enable").toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
331 | product->starter_type = query.value("starter_type").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
332 | product->starter_sg = query.value("starter_sg").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
333 | product->starter_viability = query.value("starter_viability").toInt(); |
198
904591820c3d
Added yeast viability calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
334 | if (query.value("yeast_prod_date").toString().length() == 10) |
904591820c3d
Added yeast viability calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
335 | product->yeast_prod_date = query.value("yeast_prod_date").toDate(); |
904591820c3d
Added yeast viability calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
336 | else |
904591820c3d
Added yeast viability calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
337 | product->yeast_prod_date = QDate(); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
338 | product->yeast_pitchrate = query.value("yeast_pitchrate").toDouble(); |
196
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
339 | product->prop_type[0] = query.value("prop1_type").toInt(); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
340 | product->prop_volume[0] = query.value("prop1_volume").toDouble(); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
341 | product->prop_type[1] = query.value("prop2_type").toInt(); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
342 | product->prop_volume[1] = query.value("prop2_volume").toDouble(); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
343 | product->prop_type[2] = query.value("prop3_type").toInt(); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
344 | product->prop_volume[2] = query.value("prop3_volume").toDouble(); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
345 | product->prop_type[3] = query.value("prop4_type").toInt(); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
346 | product->prop_volume[3] = query.value("prop4_volume").toDouble(); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
347 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
348 | product->divide_type = query.value("divide_type").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
349 | product->divide_size = query.value("divide_size").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
350 | product->divide_factor = query.value("divide_factor").toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
351 | product->divide_parts = query.value("divide_parts").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
352 | product->divide_part = query.value("divide_part").toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
353 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
354 | QJsonParseError parseError; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
355 | const auto& f_json = query.value("json_fermentables").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
356 | if (!f_json.trimmed().isEmpty()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
357 | const auto& formattedJson = QString("%1").arg(f_json); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
358 | QJsonDocument fermentables = QJsonDocument::fromJson(formattedJson.toUtf8(), &parseError); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
359 | if (parseError.error != QJsonParseError::NoError) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
360 | qDebug() << "Parse error: " << parseError.errorString() << "at" << parseError.offset ; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
361 | } else if (fermentables.isArray()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
362 | double percentcheck = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
363 | for (int i = 0; i < fermentables.array().size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
364 | QJsonObject obj = fermentables.array().at(i).toObject(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
365 | //qDebug() << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
366 | Fermentables f; |
177
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
367 | f.f_inventory = 0; |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
368 | f.f_avail = false; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
369 | f.f_name = obj["f_name"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
370 | f.f_origin = obj["f_origin"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
371 | f.f_supplier = obj["f_supplier"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
372 | f.f_amount = obj["f_amount"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
373 | f.f_cost = obj["f_cost"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
374 | f.f_type = obj["f_type"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
375 | f.f_yield = obj["f_yield"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
376 | f.f_color = obj["f_color"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
377 | f.f_coarse_fine_diff = obj["f_coarse_fine_diff"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
378 | f.f_moisture = obj["f_moisture"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
379 | f.f_diastatic_power = obj["f_diastatic_power"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
380 | f.f_protein = obj["f_protein"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
381 | f.f_dissolved_protein = obj["f_dissolved_protein"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
382 | f.f_max_in_batch = obj["f_max_in_batch"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
383 | f.f_graintype = obj["f_graintype"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
384 | f.f_added = obj["f_added"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
385 | f.f_recommend_mash = obj["f_recommend_mash"].toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
386 | f.f_add_after_boil = obj["f_add_after_boil"].toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
387 | f.f_adjust_to_total_100 = obj["f_adjust_to_total_100"].toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
388 | f.f_percentage = obj["f_percentage"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
389 | f.f_di_ph = obj["f_di_ph"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
390 | f.f_acid_to_ph_57 = obj["f_acid_to_ph_57"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
391 | if (f.f_adjust_to_total_100) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
392 | product->fermentables_use100 = true; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
393 | percentcheck += f.f_percentage; |
177
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
394 | /* Check and update inventory */ |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
395 | yquery.prepare("SELECT inventory FROM inventory_fermentables WHERE name=:name AND supplier=:supplier AND origin=:origin"); |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
396 | yquery.bindValue(":name", f.f_name); |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
397 | yquery.bindValue(":supplier", f.f_supplier); |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
398 | yquery.bindValue(":origin", f.f_origin); |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
399 | yquery.exec(); |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
400 | if (yquery.first()) { |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
401 | f.f_avail = true; |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
402 | f.f_inventory = yquery.value(0).toDouble(); |
62b8d701cd88
Fermentables inventory is updated during initial product load. Total mash volume is calculated against the used equipment profile. Display mash weight. Mash infuse temperatures are calculated against the used equipment profile.
Michiel Broek <mbroek@mbse.eu>
parents:
176
diff
changeset
|
403 | } |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
404 | product->fermentables.append(f); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
405 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
406 | qDebug() << "fermentables" << product->fermentables.size() << percentcheck; |
188
ff09c95d9e44
Fix fermentable percent check if there are no fermentables.
Michiel Broek <mbroek@mbse.eu>
parents:
187
diff
changeset
|
407 | if (percentcheck == 0 && product->fermentables.size()) { |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
408 | /* Missing percentages, fix it. */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
409 | double total = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
410 | for (int i = 0; i < product->fermentables.size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
411 | if (product->fermentables.at(i).f_added < 4) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
412 | total += product->fermentables.at(i).f_amount; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
413 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
414 | for (int i = 0; i < product->fermentables.size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
415 | if (product->fermentables.at(i).f_added < 4) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
416 | product->fermentables[i].f_percentage = round((product->fermentables.at(i).f_amount / total) * 10000.0) / 100.0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
417 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
418 | qDebug() << " fixed missing percentages"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
419 | is_changed(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
420 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
421 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
422 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
423 | qDebug() << "empty fermentables"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
424 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
425 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
426 | const auto& h_json = query.value("json_hops").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
427 | if (!h_json.trimmed().isEmpty()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
428 | const auto& formattedJson = QString("%1").arg(h_json); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
429 | QJsonDocument hops = QJsonDocument::fromJson(formattedJson.toUtf8(), &parseError); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
430 | if (parseError.error != QJsonParseError::NoError) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
431 | qDebug() << "Parse error: " << parseError.errorString() << "at" << parseError.offset; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
432 | } else if (hops.isArray()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
433 | for (int i = 0; i < hops.array().size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
434 | QJsonObject obj = hops.array().at(i).toObject(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
435 | //qDebug() << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
436 | Hops h; |
178
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
437 | h.h_avail = false; |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
438 | h.h_inventory = 0; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
439 | h.h_name = obj["h_name"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
440 | h.h_origin = obj["h_origin"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
441 | h.h_amount = obj["h_amount"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
442 | h.h_cost = obj["h_cost"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
443 | h.h_type = obj["h_type"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
444 | h.h_form = obj["h_form"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
445 | h.h_useat = obj["h_useat"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
446 | h.h_time = obj["h_time"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
447 | h.h_alpha = obj["h_alpha"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
448 | h.h_beta = obj["h_beta"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
449 | h.h_hsi = obj["h_hsi"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
450 | h.h_humulene = obj["h_humulene"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
451 | h.h_caryophyllene = obj["h_caryophyllene"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
452 | h.h_cohumulone = obj["h_cohumulone"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
453 | h.h_myrcene = obj["h_myrcene"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
454 | h.h_total_oil = obj["h_total_oil"].toDouble(); |
178
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
455 | /* Check and update inventory */ |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
456 | yquery.prepare("SELECT inventory FROM inventory_hops WHERE name=:name AND origin=:origin"); |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
457 | yquery.bindValue(":name", h.h_name); |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
458 | yquery.bindValue(":origin", h.h_origin); |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
459 | yquery.exec(); |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
460 | if (yquery.first()) { |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
461 | h.h_avail = true; |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
462 | h.h_inventory = yquery.value(0).toDouble(); |
1091fd9feffe
Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents:
177
diff
changeset
|
463 | } |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
464 | product->hops.append(h); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
465 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
466 | qDebug() << "hops" << product->hops.size(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
467 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
468 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
469 | qDebug() << "empty hops"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
470 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
471 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
472 | const auto& m_json = query.value("json_miscs").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
473 | if (!m_json.trimmed().isEmpty()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
474 | const auto& formattedJson = QString("%1").arg(m_json); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
475 | QJsonDocument miscs = QJsonDocument::fromJson(formattedJson.toUtf8(), &parseError); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
476 | if (parseError.error != QJsonParseError::NoError) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
477 | qDebug() << "Parse error: " << parseError.errorString() << "at" << parseError.offset; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
478 | } else if (miscs.isArray()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
479 | for (int i = 0; i < miscs.array().size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
480 | QJsonObject obj = miscs.array().at(i).toObject(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
481 | //qDebug() << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
482 | Miscs m; |
179
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
483 | m.m_avail = false; |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
484 | m.m_inventory = 0; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
485 | m.m_name = obj["m_name"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
486 | m.m_amount = obj["m_amount"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
487 | m.m_type = obj["m_type"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
488 | m.m_use_use = obj["m_use_use"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
489 | m.m_time = obj["m_time"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
490 | m.m_amount_is_weight = obj["m_amount_is_weight"].toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
491 | m.m_cost = obj["m_cost"].toDouble(); |
179
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
492 | /* Check and update inventory */ |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
493 | yquery.prepare("SELECT inventory FROM inventory_miscs WHERE name=:name"); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
494 | yquery.bindValue(":name", m.m_name); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
495 | yquery.exec(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
496 | if (yquery.first()) { |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
497 | m.m_avail = true; |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
498 | m.m_inventory = yquery.value(0).toDouble(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
499 | } |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
500 | product->miscs.append(m); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
501 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
502 | qDebug() << "miscs" << product->miscs.size(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
503 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
504 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
505 | qDebug() << "empty miscs"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
506 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
507 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
508 | const auto& y_json = query.value("json_yeasts").toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
509 | if (!y_json.trimmed().isEmpty()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
510 | const auto& formattedJson = QString("%1").arg(y_json); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
511 | QJsonDocument yeasts = QJsonDocument::fromJson(formattedJson.toUtf8(), &parseError); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
512 | if (parseError.error != QJsonParseError::NoError) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
513 | qDebug() << "Parse error: " << parseError.errorString() << "at" << parseError.offset ; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
514 | } else if (yeasts.isArray()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
515 | for (int i = 0; i < yeasts.array().size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
516 | QJsonObject obj = yeasts.array().at(i).toObject(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
517 | //qDebug() << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
518 | Yeasts y; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
519 | /* First some defaults for newer fields. */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
520 | y.y_tolerance = y.y_harvest_time = y.y_pitch_temperature = y.y_zymocide = 0; |
179
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
521 | y.y_avail = y.y_sta1 = y.y_bacteria = y.y_harvest_top = y.y_pofpos = false; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
522 | y.y_gr_hl_lo = 50; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
523 | y.y_sg_lo = 1.04; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
524 | y.y_gr_hl_hi = 80; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
525 | y.y_sg_hi = 1.08; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
526 | /* Now get what we have got */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
527 | y.y_name = obj["y_name"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
528 | y.y_laboratory = obj["y_laboratory"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
529 | y.y_product_id = obj["y_product_id"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
530 | y.y_amount = obj["y_amount"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
531 | y.y_type = obj["y_type"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
532 | y.y_form = obj["y_form"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
533 | y.y_min_temperature = obj["y_min_temperature"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
534 | y.y_max_temperature = obj["y_max_temperature"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
535 | y.y_flocculation = obj["y_flocculation"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
536 | y.y_attenuation = obj["y_attenuation"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
537 | y.y_cells = obj["y_cells"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
538 | y.y_tolerance = obj["y_tolerance"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
539 | y.y_inventory = obj["y_inventory"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
540 | y.y_use = obj["y_use"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
541 | y.y_sta1 = obj["y_sta1"].toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
542 | y.y_bacteria = obj["y_bacteria"].toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
543 | y.y_harvest_top = obj["y_harvest_top"].toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
544 | y.y_harvest_time = obj["y_harvest_time"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
545 | y.y_pitch_temperature = obj["y_pitch_temperature"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
546 | y.y_pofpos = obj["y_pofpos"].toInt() ? true:false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
547 | y.y_zymocide = obj["y_zymocide"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
548 | y.y_gr_hl_lo = obj["y_gr_hl_lo"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
549 | y.y_sg_lo = obj["y_sg_lo"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
550 | y.y_gr_hl_hi = obj["y_gr_hl_hi"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
551 | y.y_sg_hi = obj["y_sg_hi"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
552 | y.y_cost = obj["y_cost"].toDouble(); |
179
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
553 | /* |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
554 | * Possible data upgrade needed. |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
555 | */ |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
556 | yquery.prepare("SELECT tolerance,cells,sta1,bacteria,harvest_top,harvest_time,pitch_temperature," |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
557 | "pofpos,zymocide,gr_hl_lo,sg_lo,gr_hl_hi,sg_hi,inventory " |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
558 | "FROM inventory_yeasts WHERE name=:name AND laboratory=:laboratory AND product_id=:product_id"); |
179
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
559 | yquery.bindValue(":name", y.y_name); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
560 | yquery.bindValue(":laboratory", y.y_laboratory); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
561 | yquery.bindValue(":product_id", y.y_product_id); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
562 | yquery.exec(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
563 | if (yquery.first()) { |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
564 | if (y.y_tolerance == 0 || y.y_cells == 0) { |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
565 | y.y_tolerance = yquery.value(0).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
566 | y.y_cells = yquery.value(1).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
567 | } |
179
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
568 | y.y_sta1 = yquery.value(2).toInt() ? true:false; |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
569 | y.y_bacteria = yquery.value(3).toInt() ? true:false; |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
570 | y.y_harvest_top = yquery.value(4).toInt() ? true:false; |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
571 | y.y_harvest_time = yquery.value(5).toInt(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
572 | y.y_pitch_temperature = yquery.value(6).toDouble(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
573 | y.y_pofpos = yquery.value(7).toInt() ? true:false; |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
574 | y.y_zymocide = yquery.value(8).toInt(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
575 | y.y_gr_hl_lo = yquery.value(9).toInt(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
576 | y.y_sg_lo = yquery.value(10).toDouble(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
577 | y.y_gr_hl_hi = yquery.value(11).toInt(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
578 | y.y_sg_hi = yquery.value(12).toDouble(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
579 | y.y_inventory = yquery.value(13).toDouble(); |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
580 | y.y_avail = true; |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
581 | } else { |
512f492358e3
Miscs updates the current inventory during recipe load. Yeasts updates the current inventory during recipe load and does a better job for the fields to upgrade.
Michiel Broek <mbroek@mbse.eu>
parents:
178
diff
changeset
|
582 | qDebug() << y.y_name << y.y_product_id << "not found for upgrade"; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
583 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
584 | product->yeasts.append(y); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
585 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
586 | qDebug() << "yeasts" << product->yeasts.size(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
587 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
588 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
589 | qDebug() << "empty yeasts"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
590 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
591 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
592 | const auto& ma_json = query.value("json_mashs").toString().trimmed(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
593 | if (!ma_json.trimmed().isEmpty()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
594 | const auto& formattedJson = QString("%1").arg(ma_json); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
595 | QJsonDocument mashs = QJsonDocument::fromJson(formattedJson.toUtf8(), &parseError); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
596 | if (parseError.error != QJsonParseError::NoError) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
597 | qDebug() << "Parse error: " << parseError.errorString() << "at" << parseError.offset ; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
598 | } else if (mashs.isArray()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
599 | for (int i = 0; i < mashs.array().size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
600 | QJsonObject obj = mashs.array().at(i).toObject(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
601 | qDebug() << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
602 | Mashs m; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
603 | m.step_name = obj["step_name"].toString(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
604 | m.step_type = obj["step_type"].toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
605 | m.step_volume = obj["step_volume"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
606 | m.step_infuse_amount = obj["step_infuse_amount"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
607 | m.step_infuse_temp = obj["step_infuse_temp"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
608 | m.step_temp = obj["step_temp"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
609 | m.step_time = obj["step_time"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
610 | m.ramp_time = obj["ramp_time"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
611 | m.end_temp = obj["end_temp"].toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
612 | m.step_wg_ratio = obj["step_wg_ratio"].toDouble(); |
202
49ec4fdee5a6
Added mash steps pH and SG values.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
613 | m.step_ph = obj["step_ph"].toDouble(); |
49ec4fdee5a6
Added mash steps pH and SG values.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
614 | m.step_sg = obj["step_sg"].toDouble(); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
615 | product->mashs.append(m); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
616 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
617 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
618 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
619 | qDebug() << "empty mashs"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
620 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
621 | qDebug() << "mashs" << product->mashs.size(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
622 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
623 | } else { |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
624 | /* New product, set some defaults */ |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
625 | product->locked = product->log_brew = product->log_fermentation = product->log_ispindel = product->log_co2pressure = false; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
626 | product->st_name = ""; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
627 | product->st_letter = ""; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
628 | product->st_guide = ""; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
629 | product->st_category = ""; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
630 | product->st_category_number = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
631 | product->st_type = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
632 | product->st_og_min = 1.025; product->st_og_max = 1.100; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
633 | product->st_fg_min = 1.000; product->st_fg_max = 1.020; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
634 | product->st_ibu_min = 5; product->st_ibu_max = 200; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
635 | product->st_color_min = 3; product->st_color_max = 100; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
636 | product->st_carb_min = 1.0; product->st_carb_max = 4.5; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
637 | product->st_abv_min = 1; product->st_abv_max = 15; |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
638 | product->eq_name = product->eq_notes = product->name = product->code = ""; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
639 | product->eq_tun_specific_heat = 0.11; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
640 | product->eq_tun_material = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
641 | product->eq_tun_volume = product->eq_tun_height = 20; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
642 | product->eq_tun_weight = 2; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
643 | product->eq_top_up_water = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
644 | product->eq_trub_chiller_loss = 0.5; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
645 | product->eq_evap_rate = 1.8; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
646 | product->eq_calc_boil_volume = true; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
647 | product->eq_top_up_kettle = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
648 | product->eq_hop_utilization = 100; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
649 | product->eq_lauter_volume = product->eq_lauter_height = product->eq_kettle_volume = product->eq_kettle_height = product->eq_mash_volume = 20; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
650 | product->eq_lauter_deadspace = 0.5; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
651 | product->eq_mash_max = 6; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
652 | product->eq_efficiency = 75; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
653 | product->birth = QDate::currentDate(); |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
654 | product->stage = product->inventory_reduced = PROD_STAGE_PLAN; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
655 | product->notes = ""; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
656 | product->efficiency = 75; |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
657 | product->eq_batch_size = product->batch_size = 20; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
658 | product->eq_boil_time = product->boil_time = 60; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
659 | product->eq_boil_size = product->boil_size = product->batch_size + (round(product->batch_size * product->boil_time / 60.0) / 10.0); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
660 | product->type = 2; |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
661 | product->est_og = product->est_og3 = product->est_fg = product->est_color = product->est_ibu = product->est_abv = 0; |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
662 | product->brew_date_start = product->brew_date_end = QDateTime(); |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
663 | product->brew_mash_ph = product->brew_mash_sg = product->brew_mash_efficiency = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
664 | product->brew_sparge_temperature = product->brew_sparge_volume = product->brew_sparge_est = product->brew_sparge_ph = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
665 | product->brew_preboil_volume = product->brew_preboil_sg = product->brew_preboil_ph = product->brew_preboil_efficiency = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
666 | product->brew_aboil_volume = product->brew_aboil_sg = product->brew_aboil_ph = product->brew_aboil_efficiency = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
667 | product->brew_cooling_method = product->brew_cooling_time = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
668 | product->brew_cooling_to = 20; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
669 | product->brew_whirlpool9 = product->brew_whirlpool7 = product->brew_whirlpool6 = product->brew_whirlpool2 = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
670 | product->brew_fermenter_volume = product->brew_fermenter_extrawater = product->brew_fermenter_tcloss = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
671 | product->brew_aeration_time = product->brew_aeration_speed = product->brew_aeration_type = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
672 | product->brew_fermenter_sg = product->brew_fermenter_ibu = product->brew_fermenter_color = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
673 | product->og = product->fg = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
674 | product->primary_start_temp = product->primary_max_temp = product->primary_end_temp = product->primary_end_sg = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
675 | product->primary_end_date = product->secondary_end_date = QDate(); |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
676 | product->secondary_temp = product->secondary_end_sg = product->tertiary_temp = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
677 | product->package_date = QDate(); |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
678 | product->package_volume = product->package_infuse_amount = product->package_infuse_abv = product->package_abv = product->package_ph = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
679 | product->package_infuse_notes = ""; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
680 | product->bottle_amount = product->bottle_carbonation = product->bottle_priming_amount = product->bottle_carbonation_temp = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
681 | product->keg_amount = product->keg_carbonation = product->keg_priming_amount = product->keg_priming_water = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
682 | product->keg_carbonation_temp = product->keg_pressure = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
683 | product->bottle_priming_water = product->keg_priming_sugar = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
684 | product->taste_rate = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
685 | product->taste_date = QDate(); |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
686 | product->taste_notes = product->taste_color = product->taste_transparency = product->taste_head = ""; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
687 | product->taste_aroma = product->taste_taste = product->taste_mouthfeel = product->taste_aftertaste = ""; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
688 | product->sparge_temp = 80; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
689 | product->sparge_ph = 5.4; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
690 | product->sparge_volume = 8; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
691 | product->sparge_source = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
692 | product->sparge_acid_type = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
693 | product->sparge_acid_perc = 80; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
694 | product->sparge_acid_amount = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
695 | product->mash_ph = 5.4; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
696 | product->mash_name = ""; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
697 | product->calc_acid = true; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
698 | product->w1_name = ""; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
699 | product->w1_amount = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
700 | product->w1_calcium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
701 | product->w1_sulfate = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
702 | product->w1_chloride = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
703 | product->w1_sodium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
704 | product->w1_magnesium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
705 | product->w1_total_alkalinity = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
706 | product->w1_ph = 7; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
707 | product->w1_cost = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
708 | product->w2_name = ""; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
709 | product->w2_amount = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
710 | product->w2_calcium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
711 | product->w2_sulfate = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
712 | product->w2_chloride = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
713 | product->w2_sodium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
714 | product->w2_magnesium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
715 | product->w2_total_alkalinity = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
716 | product->w2_ph = 7; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
717 | product->w2_cost = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
718 | product->wg_amount = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
719 | product->wg_calcium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
720 | product->wg_sulfate = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
721 | product->wg_chloride = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
722 | product->wg_sodium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
723 | product->wg_magnesium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
724 | product->wg_total_alkalinity = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
725 | product->wg_ph = 7; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
726 | product->wb_calcium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
727 | product->wb_sulfate = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
728 | product->wb_chloride = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
729 | product->wb_sodium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
730 | product->wb_magnesium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
731 | product->wb_total_alkalinity = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
732 | product->wb_ph = 7; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
733 | product->wa_acid_name = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
734 | product->wa_acid_perc = 80; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
735 | product->wa_base_name = 0; |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
736 | product->starter_enable = false; |
196
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
737 | product->starter_type = product->prop_type[0] = product->prop_type[1] = product->prop_type[2] = product->prop_type[3] = 0; |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
738 | product->starter_viability = 100; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
739 | product->starter_sg = 1.037; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
740 | product->yeast_prod_date = QDate(); |
196
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
741 | product->yeast_pitchrate = product->prop_volume[0] = product->prop_volume[1] = product->prop_volume[2] = product->prop_volume[3] = 0; |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
742 | product->divide_type = product->divide_parts = product->divide_part = 0; |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
743 | product->divide_size = product->divide_factor = 0; |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
744 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
745 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
746 | // Tab generic. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
747 | ui->lockedEdit->setChecked(product->locked); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
748 | ui->st_nameEdit->setText(product->st_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
749 | ui->st_groupEdit->setText(product->st_letter); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
750 | ui->st_guideEdit->setText(product->st_guide); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
751 | ui->st_catEdit->setText(product->st_category); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
752 | ui->st_catnrEdit->setText(QString("%1").arg(product->st_category_number)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
753 | ui->st_typeEdit->setText(style_types[product->st_type]); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
754 | ui->nameEdit->setText(product->name); |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
755 | ui->codeEdit->setText(product->code); |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
756 | ui->birthEdit->setText(product->birth.toString("dd MMM yyyy")); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
757 | ui->notesEdit->setPlainText(product->notes); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
758 | ui->typeEdit->setCurrentIndex(product->type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
759 | ui->batch_sizeEdit->setValue(product->batch_size); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
760 | ui->boil_sizeEdit->setValue(product->boil_size); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
761 | ui->boil_timeEdit->setValue(product->boil_time); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
762 | ui->efficiencyEdit->setValue(product->efficiency); |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
763 | if (product->divide_type > 0) |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
764 | ui->splitatEdit->setText(QString(tr("%1, part %2 of %3").arg(prod_split[product->divide_type]) |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
765 | .arg(product->divide_part + 1) |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
766 | .arg(product->divide_parts + 1))); |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
767 | else |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
768 | ui->splitatEdit->setText(prod_split[product->divide_type]); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
769 | ui->est_ogEdit->setValue(product->est_og); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
770 | ui->est_ogShow->setRange(product->st_og_min, product->st_og_max); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
771 | ui->est_ogShow->setPrecision(3); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
772 | ui->est_ogShow->setMarkerTextIsValue(true); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
773 | ui->est_ogShow->setValue(product->est_og); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
774 | ui->est_fgEdit->setValue(product->est_fg); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
775 | ui->est_fgShow->setRange(product->st_fg_min, product->st_fg_max); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
776 | ui->est_fgShow->setPrecision(3); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
777 | ui->est_fgShow->setMarkerTextIsValue(true); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
778 | ui->est_fgShow->setValue(product->est_fg); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
779 | ui->est_abvEdit->setValue(product->est_abv); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
780 | ui->est_abvShow->setRange(product->st_abv_min, product->st_abv_max); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
781 | ui->est_abvShow->setPrecision(1); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
782 | ui->est_abvShow->setMarkerTextIsValue(true); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
783 | ui->est_abvShow->setValue(product->est_abv); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
784 | ui->est_colorEdit->setValue(product->est_color); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
785 | ui->est_colorEdit->setStyleSheet(Utils::ebc_to_style(product->est_color)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
786 | ui->est_colorShow->setPrecision(0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
787 | ui->est_colorShow->setMarkerTextIsValue(true); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
788 | ui->est_colorShow->setRange(product->st_color_min, product->st_color_max); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
789 | ui->est_colorShow->setValue(product->est_color); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
790 | ui->color_methodEdit->setCurrentIndex(product->color_method); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
791 | ui->est_ibuEdit->setValue(product->est_ibu); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
792 | ui->est_ibuShow->setPrecision(0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
793 | ui->est_ibuShow->setMarkerTextIsValue(true); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
794 | ui->est_ibuShow->setRange(product->st_ibu_min, product->st_ibu_max); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
795 | ui->est_ibuShow->setValue(product->est_ibu); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
796 | ui->ibu_methodEdit->setCurrentIndex(product->ibu_method); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
797 | ui->est_carbEdit->setValue(product->est_carb); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
798 | ui->est_carbShow->setPrecision(1); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
799 | ui->est_carbShow->setMarkerTextIsValue(true); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
800 | ui->est_carbShow->setRange(product->st_carb_min, product->st_carb_max); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
801 | ui->est_carbShow->setValue(product->est_carb); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
802 | |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
803 | // Tab equipment. |
189 | 804 | initEquipment(); |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
805 | |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
806 | // Tab fermentables. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
807 | ui->est_og2Edit->setValue(product->est_og); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
808 | ui->est_color2Edit->setValue(product->est_color); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
809 | ui->est_color2Edit->setStyleSheet(Utils::ebc_to_style(product->est_color)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
810 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
811 | // Tab hops. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
812 | ui->est_ibu2Edit->setValue(product->est_ibu); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
813 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
814 | // Tab yeasts. |
195
9887278c4fbe
The framework to calculate yeast starters added.
Michiel Broek <mbroek@mbse.eu>
parents:
194
diff
changeset
|
815 | initYeast(); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
816 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
817 | // Tab mashs. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
818 | ui->mash_nameEdit->setText(product->mash_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
819 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
820 | // Tab waters. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
821 | qDebug() << "water 1" << product->w1_name << "default" << my_default_water; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
822 | if (product->w1_ph > 4.0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
823 | /* |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
824 | * Water data seems present, use that and set the name between [] |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
825 | */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
826 | ui->w1_nameEdit->setPlaceholderText(QString("["+product->w1_name+"]")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
827 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
828 | bool found = false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
829 | if (product->w1_name != "") { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
830 | /* |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
831 | * We have a name, but do we know it? |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
832 | */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
833 | query.prepare("SELECT * FROM inventory_waters WHERE name=:water"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
834 | query.bindValue(":water", product->w1_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
835 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
836 | found = query.first(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
837 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
838 | if (!found) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
839 | /* |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
840 | * Try to load default water |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
841 | */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
842 | query.prepare("SELECT * FROM inventory_waters WHERE record=:record"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
843 | query.bindValue(":record", my_default_water); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
844 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
845 | found = query.first(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
846 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
847 | if (found) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
848 | product->w1_calcium = query.value(3).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
849 | product->w1_magnesium = query.value(8).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
850 | product->w1_total_alkalinity = query.value(11).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
851 | product->w1_sodium = query.value(7).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
852 | product->w1_chloride = query.value(6).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
853 | product->w1_sulfate = query.value(5).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
854 | product->w1_ph = query.value(9).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
855 | ui->w1_nameEdit->setCurrentIndex(query.value(0).toInt()); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
856 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
857 | product->w1_calcium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
858 | product->w1_magnesium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
859 | product->w1_total_alkalinity = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
860 | product->w1_sodium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
861 | product->w1_chloride = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
862 | product->w1_sulfate = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
863 | product->w1_ph = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
864 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
865 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
866 | ui->w1_volEdit->setValue(product->w1_amount); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
867 | ui->w1_caEdit->setValue(product->w1_calcium); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
868 | ui->w1_mgEdit->setValue(product->w1_magnesium); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
869 | ui->w1_hco3Edit->setValue(product->w1_total_alkalinity * 1.22); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
870 | ui->w1_caco3Edit->setValue(product->w1_total_alkalinity); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
871 | ui->w1_naEdit->setValue(product->w1_sodium); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
872 | ui->w1_clEdit->setValue(product->w1_chloride); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
873 | ui->w1_so4Edit->setValue(product->w1_sulfate); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
874 | ui->w1_phEdit->setValue(product->w1_ph); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
875 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
876 | qDebug() << "water 2" << product->w2_name; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
877 | if (product->w2_ph > 4.0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
878 | ui->w2_nameEdit->setPlaceholderText(QString("["+product->w2_name+"]")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
879 | } else if (product->w2_name != "") { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
880 | query.prepare("SELECT * FROM inventory_waters WHERE name=:water"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
881 | query.bindValue(":water", product->w2_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
882 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
883 | if (query.first()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
884 | product->w2_calcium = query.value(3).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
885 | product->w2_magnesium = query.value(8).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
886 | product->w2_total_alkalinity = query.value(11).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
887 | product->w2_sodium = query.value(7).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
888 | product->w2_chloride = query.value(6).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
889 | product->w2_sulfate = query.value(5).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
890 | product->w2_ph = query.value(9).toDouble(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
891 | ui->w2_nameEdit->setCurrentIndex(query.value(0).toInt()); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
892 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
893 | product->w2_calcium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
894 | product->w2_magnesium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
895 | product->w2_total_alkalinity = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
896 | product->w2_sodium = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
897 | product->w2_chloride = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
898 | product->w2_sulfate = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
899 | product->w2_ph = 0; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
900 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
901 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
902 | ui->w2_volEdit->setValue(product->w2_amount); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
903 | ui->w2_caEdit->setValue(product->w2_calcium); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
904 | ui->w2_mgEdit->setValue(product->w2_magnesium); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
905 | ui->w2_hco3Edit->setValue(product->w2_total_alkalinity * 1.22); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
906 | ui->w2_caco3Edit->setValue(product->w2_total_alkalinity); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
907 | ui->w2_naEdit->setValue(product->w2_sodium); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
908 | ui->w2_clEdit->setValue(product->w2_chloride); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
909 | ui->w2_so4Edit->setValue(product->w2_sulfate); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
910 | ui->w2_phEdit->setValue(product->w2_ph); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
911 | ui->mw_autoEdit->setChecked(product->calc_acid); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
912 | ui->mw_phEdit->setReadOnly(! product->calc_acid); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
913 | ui->mw_phEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
914 | ui->mw_acidvolEdit->setReadOnly(product->calc_acid); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
915 | ui->mw_acidvolEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
916 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
917 | ui->sp_volEdit->setValue(product->sparge_volume); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
918 | ui->sp_tempEdit->setValue(product->sparge_temp); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
919 | ui->sp_phEdit->setValue(product->sparge_ph); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
920 | ui->sp_sourceEdit->setCurrentIndex(product->sparge_source); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
921 | ui->sp_acidtypeEdit->setCurrentIndex(product->sparge_acid_type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
922 | ui->sp_acidpercEdit->setValue(product->sparge_acid_perc); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
923 | ui->sp_acidvolEdit->setValue(product->sparge_acid_amount); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
924 | |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
925 | // Tab brewday. |
205
ae6109192fb2
First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents:
204
diff
changeset
|
926 | updateBrewday(); |
182
545d31130844
Added brewday mash results box.
Michiel Broek <mbroek@mbse.eu>
parents:
181
diff
changeset
|
927 | ui->brew_mashphEdit->setValue(product->brew_mash_ph); |
545d31130844
Added brewday mash results box.
Michiel Broek <mbroek@mbse.eu>
parents:
181
diff
changeset
|
928 | ui->brew_mashphShow->setValue(product->mash_ph); |
545d31130844
Added brewday mash results box.
Michiel Broek <mbroek@mbse.eu>
parents:
181
diff
changeset
|
929 | ui->brew_mashsgEdit->setValue(product->brew_mash_sg); |
545d31130844
Added brewday mash results box.
Michiel Broek <mbroek@mbse.eu>
parents:
181
diff
changeset
|
930 | ui->brew_mashsgShow->setValue(0); |
545d31130844
Added brewday mash results box.
Michiel Broek <mbroek@mbse.eu>
parents:
181
diff
changeset
|
931 | ui->brew_masheffShow->setValue(product->brew_mash_efficiency); |
183
bce87b8b604b
Added brewday sparge and lauter results box.
Michiel Broek <mbroek@mbse.eu>
parents:
182
diff
changeset
|
932 | ui->brew_spargetempShow->setValue(product->sparge_temp); |
bce87b8b604b
Added brewday sparge and lauter results box.
Michiel Broek <mbroek@mbse.eu>
parents:
182
diff
changeset
|
933 | ui->brew_spargevolShow->setValue(product->sparge_volume); |
bce87b8b604b
Added brewday sparge and lauter results box.
Michiel Broek <mbroek@mbse.eu>
parents:
182
diff
changeset
|
934 | ui->brew_spargeestShow->setValue(product->brew_sparge_est); |
bce87b8b604b
Added brewday sparge and lauter results box.
Michiel Broek <mbroek@mbse.eu>
parents:
182
diff
changeset
|
935 | ui->brew_spargephEdit->setValue(product->brew_sparge_ph); |
185
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
936 | ui->brew_spargephShow->setValue(product->sparge_ph); |
183
bce87b8b604b
Added brewday sparge and lauter results box.
Michiel Broek <mbroek@mbse.eu>
parents:
182
diff
changeset
|
937 | |
184
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
938 | ui->brew_preboilphEdit->setValue(product->brew_preboil_ph); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
939 | ui->brew_preboilsgEdit->setValue(product->brew_preboil_sg); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
940 | ui->brew_preboilvolEdit->setValue(product->brew_preboil_volume); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
941 | ui->brew_preboilvolShow->setValue(product->boil_size * 1.04); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
942 | ui->brew_preboileffShow->setValue(product->brew_preboil_efficiency); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
943 | ui->brew_aboilphEdit->setValue(product->brew_aboil_ph); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
944 | ui->brew_aboilsgEdit->setValue(product->brew_aboil_sg); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
945 | ui->brew_aboilvolEdit->setValue(product->brew_aboil_volume); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
946 | ui->brew_aboilvolShow->setValue(product->batch_size * 1.04); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
947 | ui->brew_aboileffShow->setValue(product->brew_aboil_efficiency); |
185
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
948 | ui->brew_whirlpool9Edit->setValue(product->brew_whirlpool9); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
949 | ui->brew_whirlpool7Edit->setValue(product->brew_whirlpool7); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
950 | ui->brew_whirlpool6Edit->setValue(product->brew_whirlpool6); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
951 | ui->brew_whirlpool2Edit->setValue(product->brew_whirlpool2); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
952 | ui->brew_cooltoEdit->setValue(product->brew_cooling_to); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
953 | ui->brew_coolwithEdit->setCurrentIndex(product->brew_cooling_method); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
954 | ui->brew_cooltimeEdit->setValue(product->brew_cooling_time); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
955 | |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
956 | ui->brew_trublossEdit->setValue(product->brew_fermenter_tcloss); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
957 | ui->brew_topupwaterEdit->setValue(product->brew_fermenter_extrawater); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
958 | ui->brew_tofermentEdit->setValue(product->brew_fermenter_volume); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
959 | ui->brew_fermentsgShow->setValue(product->brew_fermenter_sg); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
960 | ui->brew_fermentcolorShow->setValue(product->brew_fermenter_color); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
961 | ui->brew_fermentcolorShow->setStyleSheet(Utils::ebc_to_style(product->brew_fermenter_color)); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
962 | ui->brew_fermentibuShow->setValue(product->brew_fermenter_ibu); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
963 | |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
964 | ui->brew_aerwithEdit->setCurrentIndex(product->brew_aeration_type); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
965 | ui->brew_aertimeEdit->setValue(product->brew_aeration_time); |
405bb68c1ea4
Added the last groupboxes on the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
184
diff
changeset
|
966 | ui->brew_aerspeedEdit->setValue(product->brew_aeration_speed); |
184
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
967 | |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
968 | // Tab fermentation. |
186
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
969 | ui->prim_ogShow->setValue(product->brew_fermenter_sg); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
970 | ui->prim_startCEdit->setValue(product->primary_start_temp); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
971 | ui->prim_maxCEdit->setValue(product->primary_max_temp); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
972 | ui->prim_endCEdit->setValue(product->primary_end_temp); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
973 | ui->prim_endsgEdit->setValue(product->primary_end_sg); |
218
725da10db56c
Fixed wrong colors of the bars on the fermentation tab. Don't show 100% SVG if OG or FG data is missing. Changed prompts om the fermentation tab.
Michiel Broek <mbroek@mbse.eu>
parents:
214
diff
changeset
|
974 | ui->prim_enddateEdit->setDate(product->primary_end_date); |
186
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
975 | ui->prim_attShow->setValue(Utils::calc_svg(product->brew_fermenter_sg, product->primary_end_sg)); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
976 | ui->sec_tempEdit->setValue(product->secondary_temp); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
977 | ui->sec_sgEdit->setValue(product->secondary_end_sg); |
218
725da10db56c
Fixed wrong colors of the bars on the fermentation tab. Don't show 100% SVG if OG or FG data is missing. Changed prompts om the fermentation tab.
Michiel Broek <mbroek@mbse.eu>
parents:
214
diff
changeset
|
978 | ui->sec_enddateEdit->setDate(product->secondary_end_date); |
186
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
979 | ui->sec_attShow->setValue(Utils::calc_svg(product->brew_fermenter_sg, product->secondary_end_sg)); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
980 | ui->tert_tempEdit->setValue(product->tertiary_temp); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
981 | ui->tert_estsgShow->setValue(product->est_fg); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
982 | ui->tert_sgEdit->setValue(product->fg); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
983 | ui->tert_attShow->setValue(Utils::calc_svg(product->brew_fermenter_sg, product->fg)); |
96e239584db5
Created the tab fermentation.
Michiel Broek <mbroek@mbse.eu>
parents:
185
diff
changeset
|
984 | ui->tert_abvShow->setValue(Utils::abvol(product->brew_fermenter_sg, product->fg)); |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
985 | |
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
986 | // Tab packaging. |
220
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
987 | ui->pack_dateEdit->setDate(product->package_date); |
187
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
988 | ui->pack_carbloShow->setValue(product->st_carb_min); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
989 | ui->pack_carbhiShow->setValue(product->st_carb_max); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
990 | ui->pack_volumeEdit->setValue(product->package_volume); |
220
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
991 | ui->pack_volumeEdit->setMaximum(product->brew_fermenter_volume); |
187
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
992 | ui->pack_addvolEdit->setValue(product->package_infuse_amount); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
993 | ui->pack_addabvEdit->setValue(product->package_infuse_abv); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
994 | ui->pack_notesEdit->setText(product->package_infuse_notes); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
995 | ui->pack_abvShow->setValue(product->package_abv); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
996 | ui->pack_phEdit->setValue(product->package_ph); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
997 | |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
998 | ui->bottle_volumeEdit->setValue(product->bottle_amount); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
999 | ui->bottle_carbEdit->setValue(product->bottle_carbonation); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1000 | ui->bottle_sug_amountShow->setValue(product->bottle_priming_amount); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1001 | ui->bottle_sug_waterEdit->setValue(product->bottle_priming_water); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1002 | ui->bottle_tempEdit->setValue(product->bottle_carbonation_temp); |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
1003 | |
223
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1004 | ui->keg_volumeEdit->setValue(product->keg_amount); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1005 | ui->keg_carbEdit->setValue(product->keg_carbonation); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1006 | ui->keg_sug_amountShow->setValue(product->keg_priming_amount); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1007 | ui->keg_sug_waterEdit->setValue(product->keg_priming_water); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1008 | ui->keg_tempEdit->setValue(product->keg_carbonation_temp); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1009 | ui->keg_forcedEdit->setChecked(product->keg_forced_carb); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1010 | |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
1011 | // Tab taste. |
225
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1012 | ui->taste_dateEdit->setDate(product->taste_date); |
187
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1013 | ui->taste_rateEdit->setValue(product->taste_rate); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1014 | ui->taste_notesEdit->setPlainText(product->taste_notes); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1015 | ui->taste_colorEdit->setText(product->taste_color); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1016 | ui->taste_transparencyEdit->setText(product->taste_transparency); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1017 | ui->taste_headEdit->setText(product->taste_head); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1018 | ui->taste_aromaEdit->setText(product->taste_aroma); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1019 | ui->taste_tasteEdit->setText(product->taste_taste); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1020 | ui->taste_mouthfeelEdit->setText(product->taste_mouthfeel); |
91af2c697345
Completed the design of the package and taste tabs.
Michiel Broek <mbroek@mbse.eu>
parents:
186
diff
changeset
|
1021 | ui->taste_aftertasteEdit->setText(product->taste_aftertaste); |
176
69a033e099a2
Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents:
175
diff
changeset
|
1022 | |
218
725da10db56c
Fixed wrong colors of the bars on the fermentation tab. Don't show 100% SVG if OG or FG data is missing. Changed prompts om the fermentation tab.
Michiel Broek <mbroek@mbse.eu>
parents:
214
diff
changeset
|
1023 | qDebug() << "== Start connecting =="; |
725da10db56c
Fixed wrong colors of the bars on the fermentation tab. Don't show 100% SVG if OG or FG data is missing. Changed prompts om the fermentation tab.
Michiel Broek <mbroek@mbse.eu>
parents:
214
diff
changeset
|
1024 | |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1025 | // All signals from tab "Generic" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1026 | connect(ui->lockedEdit, &QCheckBox::stateChanged, this, &EditProduct::is_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1027 | connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditProduct::name_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1028 | connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(notes_changed())); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1029 | connect(ui->typeEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::brew_type_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1030 | connect(ui->batch_sizeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::batch_size_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1031 | connect(ui->boil_timeEdit, QOverload<int>::of(&QSpinBox::valueChanged), this, &EditProduct::boil_time_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1032 | connect(ui->efficiencyEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::efficiency_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1033 | connect(ui->beerstyleEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::style_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1034 | connect(ui->est_ogEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::est_og_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1035 | connect(ui->color_methodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::colormethod_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1036 | connect(ui->ibu_methodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::ibumethod_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1037 | connect(ui->lockedEdit, &QCheckBox::stateChanged, this, &EditProduct::locked_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1038 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1039 | // All signals from tab "Fermentables" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1040 | ui->fermentablesTable->setEditTriggers(QAbstractItemView::NoEditTriggers); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1041 | connect(ui->est_og2Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::est_og_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1042 | connect(ui->perc_mashShow, &QProgressBar::valueChanged, this, &EditProduct::ferment_perc_mash_valueChanged); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1043 | connect(ui->perc_sugarsShow, &QProgressBar::valueChanged, this, &EditProduct::ferment_perc_sugars_valueChanged); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1044 | connect(ui->perc_caraShow, &QProgressBar::valueChanged, this, &EditProduct::ferment_perc_cara_valueChanged); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1045 | connect(ui->lintnerShow, &QProgressBar::valueChanged, this, &EditProduct::ferment_lintner_valueChanged); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1046 | connect(ui->addFermentable, SIGNAL(clicked()), this, SLOT(addFermentRow_clicked())); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1047 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1048 | // All signals from tab "Hops" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1049 | ui->hopsTable->setEditTriggers(QAbstractItemView::NoEditTriggers); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1050 | connect(ui->hop_tasteShow, &QProgressBar::valueChanged, this, &EditProduct::hop_Flavour_valueChanged); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1051 | connect(ui->hop_aromaShow, &QProgressBar::valueChanged, this, &EditProduct::hop_Aroma_valueChanged); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1052 | connect(ui->addHop, SIGNAL(clicked()), this, SLOT(addHopRow_clicked())); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1053 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1054 | // All signals from tab "Miscs" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1055 | ui->miscsTable->setEditTriggers(QAbstractItemView::NoEditTriggers); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1056 | connect(ui->addMisc, SIGNAL(clicked()), this, SLOT(addMiscRow_clicked())); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1057 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1058 | // All signals from tab "Yeasts" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1059 | connect(ui->addYeast, SIGNAL(clicked()), this, SLOT(addYeastRow_clicked())); |
195
9887278c4fbe
The framework to calculate yeast starters added.
Michiel Broek <mbroek@mbse.eu>
parents:
194
diff
changeset
|
1060 | connect(ui->stmethodEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::yeast_method_changed); |
9887278c4fbe
The framework to calculate yeast starters added.
Michiel Broek <mbroek@mbse.eu>
parents:
194
diff
changeset
|
1061 | connect(ui->startersgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::yeast_starter_sg_changed); |
198
904591820c3d
Added yeast viability calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
1062 | connect(ui->productionButton1, SIGNAL(clicked()), this, SLOT(yeast_prod_date_today())); |
904591820c3d
Added yeast viability calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
1063 | connect(ui->productionButton2, SIGNAL(clicked()), this, SLOT(yeast_prod_date_clear())); |
904591820c3d
Added yeast viability calculation.
Michiel Broek <mbroek@mbse.eu>
parents:
196
diff
changeset
|
1064 | connect(ui->productionEdit, &QDateEdit::dateChanged, this, &EditProduct::yeast_prod_date_changed); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1065 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1066 | // All signals from tab "Mash" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1067 | ui->mashsTable->setEditTriggers(QAbstractItemView::NoEditTriggers); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1068 | connect(ui->addMash, SIGNAL(clicked()), this, SLOT(addMashRow_clicked())); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1069 | connect(ui->mash_pickEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::mash_select_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1070 | connect(ui->mash_nameEdit, &QLineEdit::textChanged, this, &EditProduct::mash_name_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1071 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1072 | // All signals from tab "Water" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1073 | connect(ui->bs_cacl2Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_cacl2_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1074 | connect(ui->bs_caso4Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_caso4_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1075 | connect(ui->bs_mgso4Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_mgso4_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1076 | connect(ui->bs_naclEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_nacl_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1077 | connect(ui->bs_mgcl2Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_mgcl2_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1078 | connect(ui->bs_nahco3Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_nahco3_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1079 | connect(ui->bs_caco3Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::wb_caco3_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1080 | connect(ui->mw_autoEdit, &QCheckBox::stateChanged, this, &EditProduct::mw_calc_acid_clicked); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1081 | connect(ui->mw_phEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::mw_ph_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1082 | connect(ui->mw_acidvolEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::mw_acid_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1083 | connect(ui->mw_acidPick, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::mw_type_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1084 | connect(ui->wt_sourceEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::wt_target_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1085 | connect(ui->w1_nameEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::w1_name_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1086 | connect(ui->w2_nameEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::w2_name_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1087 | connect(ui->w2_volEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::w2_volume_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1088 | connect(ui->sp_sourceEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::sp_source_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1089 | connect(ui->sp_acidtypeEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::sp_type_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1090 | connect(ui->sp_phEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_ph_changed); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1091 | |
205
ae6109192fb2
First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents:
204
diff
changeset
|
1092 | /* All signals from tab Brewday */ |
218
725da10db56c
Fixed wrong colors of the bars on the fermentation tab. Don't show 100% SVG if OG or FG data is missing. Changed prompts om the fermentation tab.
Michiel Broek <mbroek@mbse.eu>
parents:
214
diff
changeset
|
1093 | calcEfficiencyBeforeBoil(); |
725da10db56c
Fixed wrong colors of the bars on the fermentation tab. Don't show 100% SVG if OG or FG data is missing. Changed prompts om the fermentation tab.
Michiel Broek <mbroek@mbse.eu>
parents:
214
diff
changeset
|
1094 | calcEfficiencyAfterBoil(); |
205
ae6109192fb2
First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents:
204
diff
changeset
|
1095 | connect(ui->brew_startButton1, SIGNAL(clicked()), this, SLOT(brew_date_today())); |
ae6109192fb2
First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents:
204
diff
changeset
|
1096 | connect(ui->brew_startButton2, SIGNAL(clicked()), this, SLOT(brew_date_clear())); |
ae6109192fb2
First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents:
204
diff
changeset
|
1097 | connect(ui->brew_startDate, &QDateEdit::dateChanged, this, &EditProduct::brew_start_date_changed); |
214
641540dc6ef2
Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents:
213
diff
changeset
|
1098 | connect(ui->brew_startTime, &QTimeEdit::timeChanged, this, &EditProduct::brew_start_time_changed); |
641540dc6ef2
Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents:
213
diff
changeset
|
1099 | connect(ui->brew_endDate, &QDateEdit::dateChanged, this, &EditProduct::brew_end_date_changed); |
641540dc6ef2
Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents:
213
diff
changeset
|
1100 | connect(ui->brew_endTime, &QTimeEdit::timeChanged, this, &EditProduct::brew_end_time_changed); |
641540dc6ef2
Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents:
213
diff
changeset
|
1101 | connect(ui->brew_endButton1, SIGNAL(clicked()), this, SLOT(brew_end_today())); |
641540dc6ef2
Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents:
213
diff
changeset
|
1102 | connect(ui->brew_ackButton, SIGNAL(clicked()), this, SLOT(brew_date_ack())); |
207
3b164a0aea90
Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.
Michiel Broek <mbroek@mbse.eu>
parents:
205
diff
changeset
|
1103 | connect(ui->brew_mashphEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_mashph_changed); |
3b164a0aea90
Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.
Michiel Broek <mbroek@mbse.eu>
parents:
205
diff
changeset
|
1104 | connect(ui->brew_mashsgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_mashsg_changed); |
3b164a0aea90
Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.
Michiel Broek <mbroek@mbse.eu>
parents:
205
diff
changeset
|
1105 | connect(ui->brew_spargephEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_spargeph_changed); |
3b164a0aea90
Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.
Michiel Broek <mbroek@mbse.eu>
parents:
205
diff
changeset
|
1106 | connect(ui->brew_preboilphEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_preboilph_changed); |
209
19c50b1f58d3
Implemented pre and after boil volume and sg settings included all calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
1107 | connect(ui->brew_preboilsgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_preboilsg_changed); |
19c50b1f58d3
Implemented pre and after boil volume and sg settings included all calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
1108 | connect(ui->brew_preboilvolEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_preboilvol_changed); |
212
8b84dd3579ef
Added calculation tools to measure volume in the boil kettle using measured centimeters.
Michiel Broek <mbroek@mbse.eu>
parents:
210
diff
changeset
|
1109 | connect(ui->brew_preboilButton, SIGNAL(clicked()), this, SLOT(brew_preboil_button())); |
207
3b164a0aea90
Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.
Michiel Broek <mbroek@mbse.eu>
parents:
205
diff
changeset
|
1110 | connect(ui->brew_aboilphEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilph_changed); |
209
19c50b1f58d3
Implemented pre and after boil volume and sg settings included all calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
1111 | connect(ui->brew_aboilsgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilsg_changed); |
19c50b1f58d3
Implemented pre and after boil volume and sg settings included all calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
207
diff
changeset
|
1112 | connect(ui->brew_aboilvolEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilvol_changed); |
212
8b84dd3579ef
Added calculation tools to measure volume in the boil kettle using measured centimeters.
Michiel Broek <mbroek@mbse.eu>
parents:
210
diff
changeset
|
1113 | connect(ui->brew_aboilButton, SIGNAL(clicked()), this, SLOT(brew_aboil_button())); |
210
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1114 | connect(ui->brew_coolwithEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::brew_cooling_method_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1115 | connect(ui->brew_cooltoEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_cooling_to_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1116 | connect(ui->brew_cooltimeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_cooling_time_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1117 | connect(ui->brew_whirlpool9Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool9_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1118 | connect(ui->brew_whirlpool7Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool7_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1119 | connect(ui->brew_whirlpool6Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool6_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1120 | connect(ui->brew_whirlpool2Edit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool2_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1121 | connect(ui->brew_aerwithEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::brew_aerwith_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1122 | connect(ui->brew_aerspeedEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aerspeed_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1123 | connect(ui->brew_aertimeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aertime_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1124 | connect(ui->brew_trublossEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_trubloss_changed); |
b45bd6da5220
Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents:
209
diff
changeset
|
1125 | connect(ui->brew_topupwaterEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_topupwater_changed); |
213
a167ee979cac
Added brew_log popup window.
Michiel Broek <mbroek@mbse.eu>
parents:
212
diff
changeset
|
1126 | connect(ui->brew_logButton, SIGNAL(clicked()), this, SLOT(brew_log_button())); |
205
ae6109192fb2
First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents:
204
diff
changeset
|
1127 | |
219
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1128 | /* All signals from tab Fermentation */ |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1129 | connect(ui->prim_startCEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::primary_start_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1130 | connect(ui->prim_maxCEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::primary_peak_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1131 | connect(ui->prim_endCEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::primary_end_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1132 | connect(ui->prim_endsgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::primary_sg_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1133 | connect(ui->prim_endsgButton, SIGNAL(clicked()), this, SLOT(primary_sg_button())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1134 | connect(ui->prim_enddateEdit, &QDateEdit::dateChanged, this, &EditProduct::primary_date_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1135 | connect(ui->prim_enddateButton, SIGNAL(clicked()), this, SLOT(primary_date_button())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1136 | connect(ui->prim_ackButton, SIGNAL(clicked()), this, SLOT(primary_date_ack())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1137 | connect(ui->sec_tempEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::secondary_temp_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1138 | connect(ui->sec_sgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::secondary_sg_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1139 | connect(ui->sec_sgButton, SIGNAL(clicked()), this, SLOT(secondary_sg_button())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1140 | connect(ui->sec_enddateEdit, &QDateEdit::dateChanged, this, &EditProduct::secondary_date_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1141 | connect(ui->sec_enddateButton, SIGNAL(clicked()), this, SLOT(secondary_date_button())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1142 | connect(ui->sec_ackButton, SIGNAL(clicked()), this, SLOT(secondary_date_ack())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1143 | connect(ui->tert_tempEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::tertiary_temp_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1144 | connect(ui->tert_sgEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::tertiary_sg_changed); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1145 | connect(ui->tert_sgButton, SIGNAL(clicked()), this, SLOT(tertiary_sg_button())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1146 | connect(ui->ferm_log1Button, SIGNAL(clicked()), this, SLOT(ferm_log1_button())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1147 | connect(ui->ferm_log2Button, SIGNAL(clicked()), this, SLOT(ferm_log2_button())); |
fa7cad488e27
Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents:
218
diff
changeset
|
1148 | |
220
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1149 | /* All signals from tab Package */ |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1150 | calcPack(); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1151 | connect(ui->pack_dateEdit, &QDateEdit::dateChanged, this, &EditProduct::pack_date_changed); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1152 | connect(ui->pack_dateButton, SIGNAL(clicked()), this, SLOT(pack_date_button())); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1153 | connect(ui->pack_ackButton, SIGNAL(clicked()), this, SLOT(pack_date_ack())); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1154 | connect(ui->pack_volumeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::pack_volume_changed); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1155 | connect(ui->pack_phEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::pack_ph_changed); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1156 | connect(ui->pack_addvolEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::pack_infusion_vol_changed); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1157 | connect(ui->pack_addabvEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::pack_infusion_abv_changed); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1158 | connect(ui->pack_notesEdit, &QLineEdit::textChanged, this, &EditProduct::pack_infusion_txt_changed); |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1159 | connect(ui->pack_abvShow, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::pack_abv_changed); |
221
54828816233f
Added bottles priming calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
220
diff
changeset
|
1160 | connect(ui->bottle_volumeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::bottle_volume_changed); |
54828816233f
Added bottles priming calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
220
diff
changeset
|
1161 | connect(ui->bottle_carbEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::bottle_co2_changed); |
54828816233f
Added bottles priming calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
220
diff
changeset
|
1162 | connect(ui->bottle_sugarEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::bottle_sugar_changed); |
54828816233f
Added bottles priming calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
220
diff
changeset
|
1163 | connect(ui->bottle_sug_waterEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::bottle_water_changed); |
54828816233f
Added bottles priming calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
220
diff
changeset
|
1164 | connect(ui->bottle_tempEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::bottle_temp_changed); |
223
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1165 | connect(ui->keg_volumeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::kegs_volume_changed); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1166 | connect(ui->keg_carbEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::kegs_co2_changed); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1167 | connect(ui->keg_sugarEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditProduct::kegs_sugar_changed); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1168 | connect(ui->keg_sug_waterEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::kegs_water_changed); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1169 | connect(ui->keg_tempEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::kegs_temp_changed); |
37bac72eff61
Added keg priming and forced carbonation.
Michiel Broek <mbroek@mbse.eu>
parents:
221
diff
changeset
|
1170 | connect(ui->keg_forcedEdit, &QCheckBox::stateChanged, this, &EditProduct::kegs_forced_changed); |
220
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1171 | |
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1172 | /* All signals from tab Tasting */ |
225
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1173 | connect(ui->taste_dateEdit, &QDateEdit::dateChanged, this, &EditProduct::taste_date_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1174 | connect(ui->taste_dateButton, SIGNAL(clicked()), this, SLOT(taste_date_button())); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1175 | connect(ui->taste_ackButton, SIGNAL(clicked()), this, SLOT(taste_date_ack())); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1176 | connect(ui->taste_rateEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::taste_rate_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1177 | connect(ui->taste_colorEdit, &QLineEdit::textChanged, this, &EditProduct::taste_color_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1178 | connect(ui->taste_transparencyEdit, &QLineEdit::textChanged, this, &EditProduct::taste_transparency_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1179 | connect(ui->taste_headEdit, &QLineEdit::textChanged, this, &EditProduct::taste_head_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1180 | connect(ui->taste_aromaEdit, &QLineEdit::textChanged, this, &EditProduct::taste_aroma_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1181 | connect(ui->taste_tasteEdit, &QLineEdit::textChanged, this, &EditProduct::taste_taste_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1182 | connect(ui->taste_mouthfeelEdit, &QLineEdit::textChanged, this, &EditProduct::taste_mouthfeel_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1183 | connect(ui->taste_aftertasteEdit, &QLineEdit::textChanged, this, &EditProduct::taste_aftertaste_changed); |
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1184 | connect(ui->taste_notesEdit, SIGNAL(textChanged()), this, SLOT(taste_notes_changed())); |
220
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1185 | |
184
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
1186 | setStage(); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1187 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1188 | ui->saveButton->setEnabled(false); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1189 | ui->deleteButton->setEnabled((id >= 0 && ! product->locked) ? true:false); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1190 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1191 | emit refreshAll(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1192 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1193 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1194 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1195 | EditProduct::~EditProduct() |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1196 | { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1197 | qDebug() << "EditProduct done start"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1198 | delete ui; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1199 | emit entry_changed(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1200 | qDebug() << "EditProduct done final"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1201 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1202 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1203 | |
190
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1204 | void EditProduct::calcSupplies() |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1205 | { |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1206 | if (product->inventory_reduced > PROD_STAGE_PACKAGE) { |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1207 | ui->ok_pmptLabel->setVisible(false); |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1208 | ui->ok_pmptIcon->setVisible(false); |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1209 | return; |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1210 | } |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1211 | |
202
49ec4fdee5a6
Added mash steps pH and SG values.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
1212 | qDebug() << "calcSupplies() f:" << product->fermentables_ok << "h:" << product->hops_ok << "m:" << product->miscs_ok << "y:" << product->yeasts_ok /*<< "w:" << product->waters_ok*/; |
49ec4fdee5a6
Added mash steps pH and SG values.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
1213 | if (product->fermentables_ok && product->hops_ok && product->miscs_ok && product->yeasts_ok /*&& product->waters_ok */) { |
190
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1214 | ui->ok_pmptIcon->setPixmap(QPixmap(QString::fromUtf8(":/icons/silk/tick.png"))); |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1215 | } else { |
191
7446ee2fb427
Added hops inventory check. Include all whirlpool steps in ibu calculations. Calculate the ibus in the fermenter including top up water. Use enum constants for the hops. Update the invenory state when replacing a hop.
Michiel Broek <mbroek@mbse.eu>
parents:
190
diff
changeset
|
1216 | ui->ok_pmptIcon->setPixmap(QPixmap(QString::fromUtf8(":/icons/silk/cancel.png"))); |
190
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1217 | } |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1218 | } |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1219 | |
bb6c06910f0f
Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents:
189
diff
changeset
|
1220 | |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1221 | void EditProduct::refreshAll() |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1222 | { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1223 | refreshFermentables(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1224 | calcFermentables(); /* Must be before Hops */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1225 | refreshHops(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1226 | calcIBUs(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1227 | refreshMiscs(); |
194
ea8cce5e7eb9
Added calcMiscs(). In miscs check supplies. Update inventory check when setting a new brewing salt. Use enum constants to make code more readable.
Michiel Broek <mbroek@mbse.eu>
parents:
191
diff
changeset
|
1228 | calcMiscs(); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1229 | refreshYeasts(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1230 | calcYeast(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1231 | calcMash(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1232 | refreshMashs(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1233 | refreshWaters(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1234 | calcWater(); |
191
7446ee2fb427
Added hops inventory check. Include all whirlpool steps in ibu calculations. Calculate the ibus in the fermenter including top up water. Use enum constants for the hops. Update the invenory state when replacing a hop.
Michiel Broek <mbroek@mbse.eu>
parents:
190
diff
changeset
|
1235 | calcSupplies(); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1236 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1237 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1238 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1239 | /* |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1240 | * Window header, mark any change with '**' |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1241 | */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1242 | void EditProduct::WindowTitle() |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1243 | { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1244 | QString txt; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1245 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1246 | if (this->recno < 0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1247 | txt = QString(tr("BMSapp - Add new product")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1248 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1249 | txt = QString(tr("BMSapp - Edit product %1").arg(this->recno)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1250 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1251 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1252 | if (this->textIsChanged) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1253 | txt.append((QString(" **"))); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1254 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1255 | setWindowTitle(txt); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1256 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1257 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1258 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1259 | void EditProduct::on_saveButton_clicked() |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1260 | { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1261 | QSqlQuery query; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1262 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1263 | /* If there are errors in the form, show a message and do "return;" */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1264 | if (ui->nameEdit->text().length() < 2) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1265 | QMessageBox::warning(this, tr("Edit Product"), tr("Name empty or too short.")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1266 | return; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1267 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1268 | if (ui->st_nameEdit->text().length() < 2) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1269 | QMessageBox::warning(this, tr("Edit Product"), tr("No beerstyle selected.")); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1270 | return; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1271 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1272 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1273 | if (this->textIsChanged) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1274 | if (this->recno == -1) { |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1275 | query.prepare("INSERT INTO products SET " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1276 | "name=:name, code=:code, birth=:birth, stage=:stage, notes=:notes, log_brew=:log_brew, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1277 | "log_fermentation=:log_fermentation, log_ispindel=:log_ispindel, log_co2pressure=:log_co2pressure, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1278 | "inventory_reduced=:inventory_reduced, locked=:locked, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1279 | "eq_name=:eq_name, eq_boil_size=:eq_boil_size, eq_efficiency=:eq_efficiency, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1280 | "eq_batch_size=:eq_batch_size, eq_tun_volume=:eq_tun_volume, eq_tun_weight=:eq_tun_weight, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1281 | "eq_tun_specific_heat=:eq_tun_specific_heat, eq_tun_material=:eq_tun_material, eq_tun_height=:eq_tun_height, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1282 | "eq_top_up_water=:eq_top_up_water, eq_trub_chiller_loss=:eq_chiller_loss, eq_evap_rate=:eq_evap_rate, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1283 | "eq_boil_time=:eq_boil_time, eq_calc_boil_volume=:eq_calcboil, eq_top_up_kettle=:eq_top_up_kettle, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1284 | "eq_hop_utilization=:eq_hopfactor, eq_notes=:eq_notes, eq_lauter_volume=:eq_lauter_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1285 | "eq_lauter_height=:eq_lauter_height, eq_lauter_deadspace=:eq_lauter_deadspace, eq_kettle_volume=:eq_kettle_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1286 | "eq_kettle_height=:eq_kettle_height, eq_mash_volume=:eq_mash_volume, eq_mash_max=:eq_mash_max, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1287 | "brew_date_start=:brew_date_start, brew_mash_ph=:brew_mash_ph, brew_mash_sg=:brew_mash_sg, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1288 | "brew_mash_efficiency=:brew_mash_efficiency, brew_sparge_temperature=:brew_sparge_temperature, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1289 | "brew_sparge_volume=:brew_sparge_volume, brew_sparge_est=:brew_sparge_est, brew_sparge_ph=:brew_sparge_ph, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1290 | "brew_preboil_volume=:brew_preboil_volume, brew_preboil_sg=:brew_preboil_sg, brew_preboil_ph=:brew_preboil_ph, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1291 | "brew_preboil_efficiency=:brew_preboil_efficiency, brew_aboil_volume=:brew_aboil_volume, " |
207
3b164a0aea90
Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.
Michiel Broek <mbroek@mbse.eu>
parents:
205
diff
changeset
|
1292 | "brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph=:brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_efficiency, " |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1293 | "brew_cooling_method=:brew_cooling_method, brew_cooling_time=:brew_cooling_time, brew_cooling_to=:brew_cooling_to, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1294 | "brew_whirlpool9=:brew_whirlpool9, brew_whirlpool7=:brew_whirlpool7, brew_whirlpool6=:brew_whirlpool6, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1295 | "brew_whirlpool2=:brew_whirlpool2, brew_fermenter_volume=:brew_fermenter_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1296 | "brew_fermenter_extrawater=:brew_fermenter_extrawater, brew_fermenter_tcloss=:brew_fermenter_tcloss, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1297 | "brew_aeration_time=:brew_aeration_time, brew_aeration_speed=:brew_aeration_speed, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1298 | "brew_aeration_type=:brew_aeration_type, brew_fermenter_sg=:brew_fermenter_sg, brew_fermenter_ibu=:brew_fermenter_ibu, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1299 | "brew_fermenter_color=:brew_fermenter_color, brew_date_end=:brew_date_end, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1300 | "og=:og, fg=:fg, primary_start_temp=:primary_start_temp, primary_max_temp=:primary_max_temp, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1301 | "primary_end_temp=:primary_end_temp, primary_end_sg=:primary_end_sg, primary_end_date=:primary_end_date, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1302 | "secondary_temp=:secondary_temp, secondary_end_sg=:secondary_end_sg, secondary_end_date=:secondary_end_date, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1303 | "tertiary_temp=:tertiary_temp, package_date=:package_date, package_volume=:package_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1304 | "package_infuse_amount=:package_infuse_amount, package_infuse_abv=:package_infuse_abv, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1305 | "package_infuse_notes=:package_infuse_notes, package_abv=:package_abv, package_ph=:package_ph, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1306 | "bottle_amount=:bottle_amount, bottle_carbonation=:bottle_carbonation, bottle_priming_sugar=:bottle_priming_sugar, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1307 | "bottle_priming_amount=:bottle_priming_amount, bottle_priming_water=:bottle_priming_water, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1308 | "bottle_carbonation_temp=:bottle_carbonation_temp, keg_amount=:keg_amount, keg_carbonation=:keg_carbonation, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1309 | "keg_priming_sugar=:keg_priming_sugar, keg_priming_amount=:keg_priming_amount, keg_priming_water=:keg_priming_water, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1310 | "keg_carbonation_temp=:keg_carbonation_temp, keg_forced_carb=:keg_forced_carb, keg_pressure=:keg_pressure, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1311 | "taste_notes=:taste_notes, taste_rate=:taste_rate, taste_date=:taste_date, taste_color=:taste_color, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1312 | "taste_transparency=:taste_transparency, taste_head=:taste_head, taste_aroma=:taste_aroma, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1313 | "taste_taste=:taste_taste, taste_mouthfeel=:taste_mouthfeel, taste_aftertaste=:taste_aftertaste, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1314 | "st_name=:st_name, st_letter=:st_letter, " |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1315 | "st_guide=:st_guide, st_category=:st_category, st_category_number=:st_catnr, st_type=:st_type, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1316 | "st_og_min=:st_og_min, st_og_max=:st_og_max, st_fg_min=:st_fg_min, st_fg_max=:st_fg_max, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1317 | "st_ibu_min=:st_ibu_min, st_ibu_max=:st_ibu_max, st_color_min=:st_color_min, st_color_max=:st_color_max, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1318 | "st_carb_min=:st_carb_min, st_carb_max=:st_carb_max, st_abv_min=:st_abv_min, st_abv_max=:st_abv_max, " |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1319 | "type=:type, batch_size=:batch_size, boil_size=:boil_size, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1320 | "boil_time=:boil_time, efficiency=:efficiency, est_og=:est_og, est_og3=:est_og3, est_fg=:est_fg, est_abv=:est_abv, " |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1321 | "est_color=:est_color, color_method=:color_method, est_ibu=:est_ibu, ibu_method=:ibu_method, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1322 | "est_carb=:est_carb, sparge_temp=:sparge_temp, sparge_ph=:sparge_ph, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1323 | "sparge_volume=:sparge_volume, sparge_source=:sparge_source, sparge_acid_type=:sparge_acid_type, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1324 | "sparge_acid_perc=:sparge_acid_perc, sparge_acid_amount=:sparge_acid_amount, mash_ph=:mash_ph, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1325 | "mash_name=:mash_name, calc_acid=:calc_acid, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1326 | "w1_name=:w1_name, w1_amount=:w1_amount, w1_calcium=:w1_calcium, w1_sulfate=:w1_sulfate, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1327 | "w1_chloride=:w1_chloride, w1_sodium=:w1_sodium, w1_magnesium=:w1_magnesium, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1328 | "w1_total_alkalinity=:w1_total_alkalinity, w1_ph=:w1_ph, w1_cost=:w1_cost, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1329 | "w2_name=:w2_name, w2_amount=:w2_amount, w2_calcium=:w2_calcium, w2_sulfate=:w2_sulfate, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1330 | "w2_chloride=:w2_chloride, w2_sodium=:w2_sodium, w2_magnesium=:w2_magnesium, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1331 | "w2_total_alkalinity=:w2_total_alkalinity, w2_ph=:w2_ph, w2_cost=:w2_cost, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1332 | "wg_amount=:wg_amount, wg_calcium=:wg_calcium, wg_sulfate=:wg_sulfate, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1333 | "wg_chloride=:wg_chloride, wg_sodium=:wg_sodium, wg_magnesium=:wg_magnesium, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1334 | "wg_total_alkalinity=:wg_total_alkalinity, wg_ph=:wg_ph, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1335 | "wb_calcium=:wb_calcium, wb_sulfate=:wb_sulfate, wb_chloride=:wb_chloride, wb_sodium=:wb_sodium, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1336 | "wb_magnesium=:wb_magnesium, wb_total_alkalinity=:wb_total_alkalinity, wb_ph=:wb_ph, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1337 | "wa_acid_name=:wa_acid_name, wa_acid_perc=:wa_acid_perc, wa_base_name=:wa_base_name, " |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1338 | "starter_enable=:starter_enable, starter_type=:starter_type, starter_sg=:starter_sg, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1339 | "starter_viability=:starter_viability, yeast_prod_date=:yeast_prod_date, yeast_pitchrate=:yeast_pitchrate, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1340 | "prop1_type=:prop1_type, prop1_volume=:prop1_volume, prop2_type=:prop2_type, prop2_volume=:prop2_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1341 | "prop3_type=:prop3_type, prop3_volume=:prop3_volume, prop4_type=:prop4_type, prop4_volume=:prop4_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1342 | "divide_type=:divide_type, divide_size=:divide_size, divide_factor=:divide_factor, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1343 | "divide_parts=:divide_parts, divide_part=:divide_part, " |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1344 | "json_fermentables=:json_fermentables, json_hops=:json_hops, json_miscs=:json_miscs, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1345 | "json_yeasts=:json_yeasts, json_mashs=:json_mashs, uuid=:uuid"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1346 | } else { |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1347 | query.prepare("UPDATE products SET " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1348 | "name=:name, code=:code, birth=:birth, stage=:stage, notes=:notes, log_brew=:log_brew, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1349 | "log_fermentation=:log_fermentation, log_ispindel=:log_ispindel, log_co2pressure=:log_co2pressure, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1350 | "inventory_reduced=:inventory_reduced, locked=:locked, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1351 | "eq_name=:eq_name, eq_boil_size=:eq_boil_size, eq_efficiency=:eq_efficiency, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1352 | "eq_batch_size=:eq_batch_size, eq_tun_volume=:eq_tun_volume, eq_tun_weight=:eq_tun_weight, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1353 | "eq_tun_specific_heat=:eq_tun_specific_heat, eq_tun_material=:eq_tun_material, eq_tun_height=:eq_tun_height, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1354 | "eq_top_up_water=:eq_top_up_water, eq_trub_chiller_loss=:eq_chiller_loss, eq_evap_rate=:eq_evap_rate, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1355 | "eq_boil_time=:eq_boil_time, eq_calc_boil_volume=:eq_calcboil, eq_top_up_kettle=:eq_top_up_kettle, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1356 | "eq_hop_utilization=:eq_hopfactor, eq_notes=:eq_notes, eq_lauter_volume=:eq_lauter_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1357 | "eq_lauter_height=:eq_lauter_height, eq_lauter_deadspace=:eq_lauter_deadspace, eq_kettle_volume=:eq_kettle_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1358 | "eq_kettle_height=:eq_kettle_height, eq_mash_volume=:eq_mash_volume, eq_mash_max=:eq_mash_max, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1359 | "brew_date_start=:brew_date_start, brew_mash_ph=:brew_mash_ph, brew_mash_sg=:brew_mash_sg, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1360 | "brew_mash_efficiency=:brew_mash_efficiency, brew_sparge_temperature=:brew_sparge_temperature, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1361 | "brew_sparge_volume=:brew_sparge_volume, brew_sparge_est=:brew_sparge_est, brew_sparge_ph=:brew_sparge_ph, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1362 | "brew_preboil_volume=:brew_preboil_volume, brew_preboil_sg=:brew_preboil_sg, brew_preboil_ph=:brew_preboil_ph, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1363 | "brew_preboil_efficiency=:brew_preboil_efficiency, brew_aboil_volume=:brew_aboil_volume, " |
207
3b164a0aea90
Implemented brewday mah ph edit, mash sg edit, sparge ph edit, pre and after boil ph edit.
Michiel Broek <mbroek@mbse.eu>
parents:
205
diff
changeset
|
1364 | "brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph=:brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_efficiency, " |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1365 | "brew_cooling_method=:brew_cooling_method, brew_cooling_time=:brew_cooling_time, brew_cooling_to=:brew_cooling_to, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1366 | "brew_whirlpool9=:brew_whirlpool9, brew_whirlpool7=:brew_whirlpool7, brew_whirlpool6=:brew_whirlpool6, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1367 | "brew_whirlpool2=:brew_whirlpool2, brew_fermenter_volume=:brew_fermenter_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1368 | "brew_fermenter_extrawater=:brew_fermenter_extrawater, brew_fermenter_tcloss=:brew_fermenter_tcloss, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1369 | "brew_aeration_time=:brew_aeration_time, brew_aeration_speed=:brew_aeration_speed, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1370 | "brew_aeration_type=:brew_aeration_type, brew_fermenter_sg=:brew_fermenter_sg, brew_fermenter_ibu=:brew_fermenter_ibu, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1371 | "brew_fermenter_color=:brew_fermenter_color, brew_date_end=:brew_date_end, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1372 | "og=:og, fg=:fg, primary_start_temp=:primary_start_temp, primary_max_temp=:primary_max_temp, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1373 | "primary_end_temp=:primary_end_temp, primary_end_sg=:primary_end_sg, primary_end_date=:primary_end_date, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1374 | "secondary_temp=:secondary_temp, secondary_end_sg=:secondary_end_sg, secondary_end_date=:secondary_end_date, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1375 | "tertiary_temp=:tertiary_temp, package_date=:package_date, package_volume=:package_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1376 | "package_infuse_amount=:package_infuse_amount, package_infuse_abv=:package_infuse_abv, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1377 | "package_infuse_notes=:package_infuse_notes, package_abv=:package_abv, package_ph=:package_ph, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1378 | "bottle_amount=:bottle_amount, bottle_carbonation=:bottle_carbonation, bottle_priming_sugar=:bottle_priming_sugar, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1379 | "bottle_priming_amount=:bottle_priming_amount, bottle_priming_water=:bottle_priming_water, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1380 | "bottle_carbonation_temp=:bottle_carbonation_temp, keg_amount=:keg_amount, keg_carbonation=:keg_carbonation, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1381 | "keg_priming_sugar=:keg_priming_sugar, keg_priming_amount=:keg_priming_amount, keg_priming_water=:keg_priming_water, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1382 | "keg_carbonation_temp=:keg_carbonation_temp, keg_forced_carb=:keg_forced_carb, keg_pressure=:keg_pressure, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1383 | "taste_notes=:taste_notes, taste_rate=:taste_rate, taste_date=:taste_date, taste_color=:taste_color, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1384 | "taste_transparency=:taste_transparency, taste_head=:taste_head, taste_aroma=:taste_aroma, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1385 | "taste_taste=:taste_taste, taste_mouthfeel=:taste_mouthfeel, taste_aftertaste=:taste_aftertaste, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1386 | "st_name=:st_name, st_letter=:st_letter, " |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1387 | "st_guide=:st_guide, st_category=:st_category, st_category_number=:st_catnr, st_type=:st_type, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1388 | "st_og_min=:st_og_min, st_og_max=:st_og_max, st_fg_min=:st_fg_min, st_fg_max=:st_fg_max, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1389 | "st_ibu_min=:st_ibu_min, st_ibu_max=:st_ibu_max, st_color_min=:st_color_min, st_color_max=:st_color_max, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1390 | "st_carb_min=:st_carb_min, st_carb_max=:st_carb_max, st_abv_min=:st_abv_min, st_abv_max=:st_abv_max, " |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1391 | "type=:type, batch_size=:batch_size, boil_size=:boil_size, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1392 | "boil_time=:boil_time, efficiency=:efficiency, est_og=:est_og, est_og3=:est_og3, est_fg=:est_fg, est_abv=:est_abv, " |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1393 | "est_color=:est_color, color_method=:color_method, est_ibu=:est_ibu, ibu_method=:ibu_method, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1394 | "est_carb=:est_carb, sparge_temp=:sparge_temp, sparge_ph=:sparge_ph, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1395 | "sparge_volume=:sparge_volume, sparge_source=:sparge_source, sparge_acid_type=:sparge_acid_type, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1396 | "sparge_acid_perc=:sparge_acid_perc, sparge_acid_amount=:sparge_acid_amount, mash_ph=:mash_ph, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1397 | "mash_name=:mash_name, calc_acid=:calc_acid, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1398 | "w1_name=:w1_name, w1_amount=:w1_amount, w1_calcium=:w1_calcium, w1_sulfate=:w1_sulfate, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1399 | "w1_chloride=:w1_chloride, w1_sodium=:w1_sodium, w1_magnesium=:w1_magnesium, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1400 | "w1_total_alkalinity=:w1_total_alkalinity, w1_ph=:w1_ph, w1_cost=:w1_cost, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1401 | "w2_name=:w2_name, w2_amount=:w2_amount, w2_calcium=:w2_calcium, w2_sulfate=:w2_sulfate, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1402 | "w2_chloride=:w2_chloride, w2_sodium=:w2_sodium, w2_magnesium=:w2_magnesium, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1403 | "w2_total_alkalinity=:w2_total_alkalinity, w2_ph=:w2_ph, w2_cost=:w2_cost, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1404 | "wg_amount=:wg_amount, wg_calcium=:wg_calcium, wg_sulfate=:wg_sulfate, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1405 | "wg_chloride=:wg_chloride, wg_sodium=:wg_sodium, wg_magnesium=:wg_magnesium, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1406 | "wg_total_alkalinity=:wg_total_alkalinity, wg_ph=:wg_ph, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1407 | "wb_calcium=:wb_calcium, wb_sulfate=:wb_sulfate, wb_chloride=:wb_chloride, wb_sodium=:wb_sodium, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1408 | "wb_magnesium=:wb_magnesium, wb_total_alkalinity=:wb_total_alkalinity, wb_ph=:wb_ph, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1409 | "wa_acid_name=:wa_acid_name, wa_acid_perc=:wa_acid_perc, wa_base_name=:wa_base_name, " |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1410 | "starter_enable=:starter_enable, starter_type=:starter_type, starter_sg=:starter_sg, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1411 | "starter_viability=:starter_viability, yeast_prod_date=:yeast_prod_date, yeast_pitchrate=:yeast_pitchrate, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1412 | "prop1_type=:prop1_type, prop1_volume=:prop1_volume, prop2_type=:prop2_type, prop2_volume=:prop2_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1413 | "prop3_type=:prop3_type, prop3_volume=:prop3_volume, prop4_type=:prop4_type, prop4_volume=:prop4_volume, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1414 | "divide_type=:divide_type, divide_size=:divide_size, divide_factor=:divide_factor, " |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1415 | "divide_parts=:divide_parts, divide_part=:divide_part, " |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1416 | "json_fermentables=:json_fermentables, json_hops=:json_hops, json_miscs=:json_miscs, " |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1417 | "json_yeasts=:json_yeasts, json_mashs=:json_mashs WHERE record = :recno"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1418 | } |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1419 | |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1420 | query.bindValue(":name", product->name); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1421 | query.bindValue(":code", product->code); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1422 | query.bindValue(":birth", product->birth); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1423 | query.bindValue(":stage", product->stage); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1424 | query.bindValue(":notes", product->notes); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1425 | query.bindValue(":log_brew", product->log_brew ? 1:0); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1426 | query.bindValue(":log_fermentation", product->log_fermentation ? 1:0); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1427 | query.bindValue(":log_ispindel", product->log_ispindel ? 1:0); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1428 | query.bindValue(":log_co2pressure", product->log_co2pressure ? 1:0); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1429 | query.bindValue(":inventory_reduced", product->inventory_reduced); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1430 | query.bindValue(":locked", product->locked ? 1:0); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1431 | query.bindValue(":eq_name", product->eq_name); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1432 | query.bindValue(":eq_boil_size", round(product->eq_boil_size * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1433 | query.bindValue(":eq_batch_size", round(product->eq_batch_size * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1434 | query.bindValue(":eq_tun_volume", round(product->eq_tun_volume * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1435 | query.bindValue(":eq_tun_weight", round(product->eq_tun_weight * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1436 | query.bindValue(":eq_tun_specific_heat", round(product->eq_tun_specific_heat * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1437 | query.bindValue(":eq_tun_material", product->eq_tun_material); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1438 | query.bindValue(":eq_tun_height", round(product->eq_tun_height * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1439 | query.bindValue(":eq_top_up_water", round(product->eq_top_up_water * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1440 | query.bindValue(":eq_chiller_loss", round(product->eq_trub_chiller_loss * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1441 | query.bindValue(":eq_evap_rate", round(product->eq_evap_rate * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1442 | query.bindValue(":eq_boil_time", round(product->eq_boil_time)); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1443 | query.bindValue(":eq_calcboil", product->eq_calc_boil_volume ? 1:0); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1444 | query.bindValue(":eq_top_up_kettle", round(product->eq_top_up_kettle * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1445 | query.bindValue(":eq_hopfactor", round(product->eq_hop_utilization)); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1446 | query.bindValue(":eq_notes", product->eq_notes); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1447 | query.bindValue(":eq_lauter_volume", round(product->eq_lauter_volume * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1448 | query.bindValue(":eq_lauter_height", round(product->eq_lauter_height * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1449 | query.bindValue(":eq_lauter_deadspace", round(product->eq_lauter_deadspace * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1450 | query.bindValue(":eq_kettle_volume", round(product->eq_kettle_volume * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1451 | query.bindValue(":eq_kettle_height", round(product->eq_kettle_height * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1452 | query.bindValue(":eq_mash_volume", round(product->eq_mash_volume * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1453 | query.bindValue(":eq_mash_max", round(product->eq_mash_max * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1454 | query.bindValue(":eq_efficiency", round(product->eq_efficiency * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1455 | query.bindValue(":brew_date_start", product->brew_date_start); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1456 | query.bindValue(":brew_mash_ph", round(product->brew_mash_ph * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1457 | query.bindValue(":brew_mash_sg", round(product->brew_mash_sg * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1458 | query.bindValue(":brew_mash_efficiency", round(product->brew_mash_efficiency * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1459 | query.bindValue(":brew_sparge_temperature", round(product->brew_sparge_temperature * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1460 | query.bindValue(":brew_sparge_volume", round(product->brew_sparge_volume * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1461 | query.bindValue(":brew_sparge_est", round(product->brew_sparge_est * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1462 | query.bindValue(":brew_sparge_ph", round(product->brew_sparge_ph * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1463 | query.bindValue(":brew_preboil_volume", round(product->brew_preboil_volume * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1464 | query.bindValue(":brew_preboil_sg", round(product->brew_preboil_sg * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1465 | query.bindValue(":brew_preboil_ph", round(product->brew_preboil_ph * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1466 | query.bindValue(":brew_preboil_efficiency", round(product->brew_preboil_efficiency * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1467 | query.bindValue(":brew_aboil_volume", round(product->brew_aboil_volume * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1468 | query.bindValue(":brew_aboil_sg", round(product->brew_aboil_sg * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1469 | query.bindValue(":brew_aboil_ph", round(product->brew_aboil_ph * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1470 | query.bindValue(":brew_aboil_efficiency", round(product->brew_aboil_efficiency * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1471 | query.bindValue(":brew_cooling_method", product->brew_cooling_method); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1472 | query.bindValue(":brew_cooling_time", round(product->brew_cooling_time * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1473 | query.bindValue(":brew_cooling_to", round(product->brew_cooling_to * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1474 | query.bindValue(":brew_whirlpool9", round(product->brew_whirlpool9)); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1475 | query.bindValue(":brew_whirlpool7", round(product->brew_whirlpool7)); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1476 | query.bindValue(":brew_whirlpool6", round(product->brew_whirlpool6)); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1477 | query.bindValue(":brew_whirlpool2", round(product->brew_whirlpool2)); |
184
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
1478 | query.bindValue(":brew_fermenter_volume", round(product->brew_fermenter_volume * 10) / 10); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
1479 | query.bindValue(":brew_fermenter_extrawater", round(product->brew_fermenter_extrawater * 10) / 10); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
1480 | query.bindValue(":brew_fermenter_tcloss", round(product->brew_fermenter_tcloss * 10) / 10); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1481 | query.bindValue(":brew_aeration_time", round(product->brew_aeration_time)); |
184
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
1482 | query.bindValue(":brew_aeration_speed", round(product->brew_aeration_speed * 10) / 10); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1483 | query.bindValue(":brew_aeration_type", product->brew_aeration_type); |
184
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
1484 | query.bindValue(":brew_fermenter_sg", round(product->brew_fermenter_sg * 1000) / 1000); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
1485 | query.bindValue(":brew_fermenter_ibu", round(product->brew_fermenter_ibu * 10) / 10); |
da148d6b4c95
Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents:
183
diff
changeset
|
1486 | query.bindValue(":brew_fermenter_color", round(product->brew_fermenter_color * 10) / 10); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1487 | query.bindValue(":brew_date_end", product->brew_date_end); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1488 | query.bindValue(":og", round(product->og * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1489 | query.bindValue(":fg", round(product->fg * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1490 | query.bindValue(":primary_start_temp", round(product->primary_start_temp * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1491 | query.bindValue(":primary_max_temp", round(product->primary_max_temp * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1492 | query.bindValue(":primary_end_temp", round(product->primary_end_temp * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1493 | query.bindValue(":primary_end_sg", round(product->primary_end_sg * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1494 | query.bindValue(":primary_end_date", product->primary_end_date); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1495 | query.bindValue(":secondary_temp", round(product->secondary_temp * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1496 | query.bindValue(":secondary_end_sg", round(product->secondary_end_sg * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1497 | query.bindValue(":secondary_end_date", product->secondary_end_date); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1498 | query.bindValue(":tertiary_temp", round(product->tertiary_temp * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1499 | query.bindValue(":package_date", product->package_date); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1500 | query.bindValue(":package_volume", round(product->package_volume * 10) / 10); |
220
7792a410a277
Added first part of the package tab.
Michiel Broek <mbroek@mbse.eu>
parents:
219
diff
changeset
|
1501 | query.bindValue(":package_infuse_amount", round(product->package_infuse_amount * 1000) / 1000); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1502 | query.bindValue(":package_infuse_abv", round(product->package_infuse_abv * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1503 | query.bindValue(":package_infuse_notes", product->package_infuse_notes); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1504 | query.bindValue(":package_abv", round(product->package_abv * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1505 | query.bindValue(":package_ph", round(product->package_ph * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1506 | query.bindValue(":bottle_amount", round(product->bottle_amount * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1507 | query.bindValue(":bottle_carbonation", round(product->bottle_carbonation * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1508 | query.bindValue(":bottle_priming_sugar", product->bottle_priming_sugar); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1509 | query.bindValue(":bottle_priming_amount", round(product->bottle_priming_amount * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1510 | query.bindValue(":bottle_priming_water", round(product->bottle_priming_water * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1511 | query.bindValue(":bottle_carbonation_temp", round(product->bottle_carbonation_temp * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1512 | query.bindValue(":keg_amount", round(product->keg_amount * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1513 | query.bindValue(":keg_carbonation", round(product->keg_carbonation * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1514 | query.bindValue(":keg_priming_sugar", product->keg_priming_sugar); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1515 | query.bindValue(":keg_priming_amount", round(product->keg_priming_amount * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1516 | query.bindValue(":keg_priming_water", round(product->keg_priming_water * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1517 | query.bindValue(":keg_carbonation_temp", round(product->keg_carbonation_temp * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1518 | query.bindValue(":keg_forced_carb", product->keg_forced_carb ? 1:0); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1519 | query.bindValue(":keg_pressure", round(product->keg_pressure * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1520 | query.bindValue(":taste_notes", product->taste_notes); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1521 | query.bindValue(":taste_rate", round(product->taste_rate * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1522 | query.bindValue(":taste_date", product->taste_date); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1523 | query.bindValue(":taste_color", product->taste_color); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1524 | query.bindValue(":taste_transparency", product->taste_transparency); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1525 | query.bindValue(":taste_head", product->taste_head); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1526 | query.bindValue(":taste_aroma", product->taste_aroma); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1527 | query.bindValue(":taste_taste", product->taste_taste); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1528 | query.bindValue(":taste_mouthfeel", product->taste_mouthfeel); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1529 | query.bindValue(":taste_aftertaste", product->taste_aftertaste); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1530 | query.bindValue(":st_name", product->st_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1531 | query.bindValue(":st_letter", product->st_letter); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1532 | query.bindValue(":st_guide", product->st_guide); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1533 | query.bindValue(":st_category", product->st_category); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1534 | query.bindValue(":st_catnr", product->st_category_number); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1535 | query.bindValue(":st_type", product->st_type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1536 | query.bindValue(":st_og_min", round(product->st_og_min * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1537 | query.bindValue(":st_og_max", round(product->st_og_max * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1538 | query.bindValue(":st_fg_min", round(product->st_fg_min * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1539 | query.bindValue(":st_fg_max", round(product->st_fg_max * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1540 | query.bindValue(":st_ibu_min", round(product->st_ibu_min * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1541 | query.bindValue(":st_ibu_max", round(product->st_ibu_max * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1542 | query.bindValue(":st_color_min", round(product->st_color_min * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1543 | query.bindValue(":st_color_max", round(product->st_color_max * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1544 | query.bindValue(":st_carb_min", round(product->st_carb_min * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1545 | query.bindValue(":st_carb_max", round(product->st_carb_max * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1546 | query.bindValue(":st_abv_min", round(product->st_abv_min * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1547 | query.bindValue(":st_abv_max", round(product->st_abv_max * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1548 | query.bindValue(":type", product->type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1549 | query.bindValue(":batch_size", round(product->batch_size * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1550 | query.bindValue(":boil_size", round(product->boil_size * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1551 | query.bindValue(":boil_time", round(product->boil_time * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1552 | query.bindValue(":efficiency", round(product->efficiency * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1553 | query.bindValue(":est_og", round(product->est_og * 1000) / 1000); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1554 | query.bindValue(":est_og3", round(product->est_og3 * 1000) / 1000); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1555 | query.bindValue(":est_fg", round(product->est_fg * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1556 | query.bindValue(":est_abv", round(product->est_abv * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1557 | query.bindValue(":est_color", round(product->est_color * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1558 | query.bindValue(":color_method", product->color_method); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1559 | query.bindValue(":est_ibu", round(product->est_ibu * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1560 | query.bindValue(":ibu_method", product->ibu_method); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1561 | query.bindValue(":est_carb", round(product->est_carb * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1562 | query.bindValue(":sparge_temp", round(product->sparge_temp * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1563 | query.bindValue(":sparge_ph", round(product->sparge_ph * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1564 | query.bindValue(":sparge_volume", round(product->sparge_volume * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1565 | query.bindValue(":sparge_source", product->sparge_source); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1566 | query.bindValue(":sparge_acid_type", product->sparge_acid_type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1567 | query.bindValue(":sparge_acid_perc", round(product->sparge_acid_perc * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1568 | query.bindValue(":sparge_acid_amount", round(product->sparge_acid_amount * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1569 | query.bindValue(":mash_ph", round(product->mash_ph * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1570 | query.bindValue(":mash_name", product->mash_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1571 | query.bindValue(":calc_acid", product->calc_acid ?1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1572 | query.bindValue(":w1_name", product->w1_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1573 | query.bindValue(":w1_amount", round(product->w1_amount * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1574 | query.bindValue(":w1_calcium", round(product->w1_calcium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1575 | query.bindValue(":w1_sulfate", round(product->w1_sulfate * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1576 | query.bindValue(":w1_chloride", round(product->w1_chloride * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1577 | query.bindValue(":w1_sodium", round(product->w1_sodium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1578 | query.bindValue(":w1_magnesium", round(product->w1_magnesium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1579 | query.bindValue(":w1_total_alkalinity", round(product->w1_total_alkalinity * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1580 | query.bindValue(":w1_ph", round(product->w1_ph * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1581 | query.bindValue(":w1_cost", round(product->w1_cost * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1582 | query.bindValue(":w2_name", product->w2_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1583 | query.bindValue(":w2_amount", round(product->w2_amount * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1584 | query.bindValue(":w2_calcium", round(product->w2_calcium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1585 | query.bindValue(":w2_sulfate", round(product->w2_sulfate * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1586 | query.bindValue(":w2_chloride", round(product->w2_chloride * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1587 | query.bindValue(":w2_sodium", round(product->w2_sodium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1588 | query.bindValue(":w2_magnesium", round(product->w2_magnesium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1589 | query.bindValue(":w2_total_alkalinity", round(product->w2_total_alkalinity * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1590 | query.bindValue(":w2_ph", round(product->w2_ph * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1591 | query.bindValue(":w2_cost", round(product->w2_cost * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1592 | query.bindValue(":wg_amount", round(product->wg_amount * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1593 | query.bindValue(":wg_calcium", round(product->wg_calcium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1594 | query.bindValue(":wg_sulfate", round(product->wg_sulfate * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1595 | query.bindValue(":wg_chloride", round(product->wg_chloride * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1596 | query.bindValue(":wg_sodium", round(product->wg_sodium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1597 | query.bindValue(":wg_magnesium", round(product->wg_magnesium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1598 | query.bindValue(":wg_total_alkalinity", round(product->wg_total_alkalinity * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1599 | query.bindValue(":wg_ph", round(product->wg_ph * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1600 | query.bindValue(":wb_calcium", round(product->wb_calcium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1601 | query.bindValue(":wb_sulfate", round(product->wb_sulfate * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1602 | query.bindValue(":wb_chloride", round(product->wb_chloride * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1603 | query.bindValue(":wb_sodium", round(product->wb_sodium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1604 | query.bindValue(":wb_magnesium", round(product->wb_magnesium * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1605 | query.bindValue(":wb_total_alkalinity", round(product->wb_total_alkalinity * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1606 | query.bindValue(":wb_ph", round(product->wb_ph * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1607 | query.bindValue(":wa_acid_name", product->wa_acid_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1608 | query.bindValue(":wa_acid_perc", round(product->wa_acid_perc * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1609 | query.bindValue(":wa_base_name", product->wa_base_name); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1610 | query.bindValue(":starter_enable", product->starter_enable ? 1:0); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1611 | query.bindValue(":starter_type", product->starter_type); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1612 | query.bindValue(":starter_sg", round(product->starter_sg * 1000) / 1000); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1613 | query.bindValue(":starter_viability", product->starter_viability); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1614 | query.bindValue(":yeast_prod_date", product->yeast_prod_date); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1615 | query.bindValue(":yeast_pitchrate", round(product->yeast_pitchrate * 1000) / 1000); |
196
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
1616 | query.bindValue(":prop1_type", product->prop_type[0]); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
1617 | query.bindValue(":prop1_volume", round(product->prop_volume[0] * 1000) / 1000); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
1618 | query.bindValue(":prop2_type", product->prop_type[1]); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
1619 | query.bindValue(":prop2_volume", round(product->prop_volume[1] * 1000) / 1000); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
1620 | query.bindValue(":prop3_type", product->prop_type[2]); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
1621 | query.bindValue(":prop3_volume", round(product->prop_volume[2] * 1000) / 1000); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
1622 | query.bindValue(":prop4_type", product->prop_type[3]); |
f7954f2d4451
Internal product record stores the starter steps in array format.
Michiel Broek <mbroek@mbse.eu>
parents:
195
diff
changeset
|
1623 | query.bindValue(":prop4_volume", round(product->prop_volume[3] * 1000) / 1000); |
181
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1624 | query.bindValue(":divide_type", product->divide_type); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1625 | query.bindValue(":divide_size", round(product->divide_size * 10) / 10); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1626 | query.bindValue(":divide_factor", round(product->divide_factor * 100) / 100); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1627 | query.bindValue(":divide_parts", product->divide_parts); |
14a1f7bca79b
Added missing est_og3 database field load and save. Added all extra fields in update and insert product. Renamed est_og3Edit on tab 3 to est_og4Edit because est_og3Edit is reserved for the brewday tab.
Michiel Broek <mbroek@mbse.eu>
parents:
179
diff
changeset
|
1628 | query.bindValue(":divide_part", product->divide_part); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1629 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1630 | if (product->fermentables.size() == 0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1631 | query.bindValue(":json_fermentables", "[]"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1632 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1633 | QJsonArray array; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1634 | for (int i = 0; i < product->fermentables.size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1635 | QJsonObject obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1636 | obj.insert("f_name", product->fermentables.at(i).f_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1637 | obj.insert("f_origin", product->fermentables.at(i).f_origin); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1638 | obj.insert("f_supplier", product->fermentables.at(i).f_supplier); |
221
54828816233f
Added bottles priming calculations.
Michiel Broek <mbroek@mbse.eu>
parents:
220
diff
changeset
|
1639 | obj.insert("f_amount", round(product->fermentables.at(i).f_amount * 100000) / 100000); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1640 | obj.insert("f_cost", round(product->fermentables.at(i).f_cost * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1641 | obj.insert("f_type", product->fermentables.at(i).f_type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1642 | obj.insert("f_yield", round(product->fermentables.at(i).f_yield * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1643 | obj.insert("f_color", round(product->fermentables.at(i).f_color * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1644 | obj.insert("f_coarse_fine_diff", round(product->fermentables.at(i).f_coarse_fine_diff * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1645 | obj.insert("f_moisture", round(product->fermentables.at(i).f_moisture * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1646 | obj.insert("f_diastatic_power", round(product->fermentables.at(i).f_diastatic_power * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1647 | obj.insert("f_protein", round(product->fermentables.at(i).f_protein * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1648 | obj.insert("f_dissolved_protein", round(product->fermentables.at(i).f_dissolved_protein * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1649 | obj.insert("f_max_in_batch", product->fermentables.at(i).f_max_in_batch); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1650 | obj.insert("f_graintype", product->fermentables.at(i).f_graintype); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1651 | obj.insert("f_added", product->fermentables.at(i).f_added); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1652 | obj.insert("f_recommend_mash", product->fermentables.at(i).f_recommend_mash ? 1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1653 | obj.insert("f_add_after_boil", product->fermentables.at(i).f_add_after_boil ? 1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1654 | obj.insert("f_adjust_to_total_100", product->fermentables.at(i).f_adjust_to_total_100 ? 1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1655 | obj.insert("f_percentage", round(product->fermentables.at(i).f_percentage * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1656 | obj.insert("f_di_ph", round(product->fermentables.at(i).f_di_ph * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1657 | obj.insert("f_acid_to_ph_57", round(product->fermentables.at(i).f_acid_to_ph_57 * 100000) / 100000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1658 | qDebug() << "fermentables_Json" << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1659 | array.append(obj); /* Append this object */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1660 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1661 | QJsonDocument doc; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1662 | doc.setArray(array); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1663 | // qDebug() << doc.toJson(QJsonDocument::Compact); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1664 | query.bindValue(":json_fermentables", doc.toJson(QJsonDocument::Compact)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1665 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1666 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1667 | if (product->hops.size() == 0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1668 | query.bindValue(":json_hops", "[]"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1669 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1670 | QJsonArray array; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1671 | for (int i = 0; i < product->hops.size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1672 | QJsonObject obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1673 | obj.insert("h_name", product->hops.at(i).h_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1674 | obj.insert("h_origin", product->hops.at(i).h_origin); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1675 | obj.insert("h_amount", round(product->hops.at(i).h_amount * 10000) / 10000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1676 | obj.insert("h_cost", round(product->hops.at(i).h_cost * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1677 | obj.insert("h_type", product->hops.at(i).h_type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1678 | obj.insert("h_form", product->hops.at(i).h_form); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1679 | obj.insert("h_useat", product->hops.at(i).h_useat); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1680 | obj.insert("h_time", round(product->hops.at(i).h_time)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1681 | obj.insert("h_alpha", round(product->hops.at(i).h_alpha * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1682 | obj.insert("h_beta", round(product->hops.at(i).h_beta * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1683 | obj.insert("h_hsi", round(product->hops.at(i).h_hsi * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1684 | obj.insert("h_humulene", round(product->hops.at(i).h_humulene * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1685 | obj.insert("h_caryophyllene", round(product->hops.at(i).h_caryophyllene * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1686 | obj.insert("h_cohumulone", round(product->hops.at(i).h_cohumulone * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1687 | obj.insert("h_myrcene", round(product->hops.at(i).h_myrcene * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1688 | obj.insert("h_total_oil", round(product->hops.at(i).h_total_oil * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1689 | qDebug() << "hops_Json" << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1690 | array.append(obj); /* Append this object */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1691 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1692 | QJsonDocument doc; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1693 | doc.setArray(array); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1694 | query.bindValue(":json_hops", doc.toJson(QJsonDocument::Compact)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1695 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1696 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1697 | if (product->miscs.size() == 0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1698 | query.bindValue(":json_miscs", "[]"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1699 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1700 | QJsonArray array; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1701 | for (int i = 0; i < product->miscs.size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1702 | QJsonObject obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1703 | obj.insert("m_name", product->miscs.at(i).m_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1704 | obj.insert("m_amount", round(product->miscs.at(i).m_amount * 10000) / 10000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1705 | obj.insert("m_type", product->miscs.at(i).m_type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1706 | obj.insert("m_use_use", product->miscs.at(i).m_use_use); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1707 | obj.insert("m_time", round(product->miscs.at(i).m_time)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1708 | obj.insert("m_amount_is_weight", product->miscs.at(i).m_amount_is_weight ? 1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1709 | obj.insert("m_cost", round(product->miscs.at(i).m_cost * 10000) / 10000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1710 | qDebug() << "miscs_Json" << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1711 | array.append(obj); /* Append this object */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1712 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1713 | QJsonDocument doc; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1714 | doc.setArray(array); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1715 | // qDebug() << doc.toJson(QJsonDocument::Compact); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1716 | query.bindValue(":json_miscs", doc.toJson(QJsonDocument::Compact)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1717 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1718 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1719 | if (product->yeasts.size() == 0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1720 | query.bindValue(":json_yeasts", "[]"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1721 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1722 | QJsonArray array; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1723 | for (int i = 0; i < product->yeasts.size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1724 | QJsonObject obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1725 | obj.insert("y_name", product->yeasts.at(i).y_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1726 | obj.insert("y_laboratory", product->yeasts.at(i).y_laboratory); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1727 | obj.insert("y_product_id", product->yeasts.at(i).y_product_id); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1728 | obj.insert("y_amount", round(product->yeasts.at(i).y_amount * 10000) / 10000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1729 | obj.insert("y_type", product->yeasts.at(i).y_type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1730 | obj.insert("y_form", product->yeasts.at(i).y_form); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1731 | obj.insert("y_min_temperature", round(product->yeasts.at(i).y_min_temperature * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1732 | obj.insert("y_max_temperature", round(product->yeasts.at(i).y_max_temperature * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1733 | obj.insert("y_flocculation", product->yeasts.at(i).y_flocculation); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1734 | obj.insert("y_attenuation", round(product->yeasts.at(i).y_attenuation * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1735 | obj.insert("y_cells", product->yeasts.at(i).y_cells); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1736 | obj.insert("y_tolerance", round(product->yeasts.at(i).y_tolerance * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1737 | obj.insert("y_inventory", round(product->yeasts.at(i).y_inventory * 10000) / 10000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1738 | obj.insert("y_use", product->yeasts.at(i).y_use); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1739 | obj.insert("y_sta1", product->yeasts.at(i).y_sta1 ? 1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1740 | obj.insert("y_bacteria", product->yeasts.at(i).y_bacteria ? 1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1741 | obj.insert("y_harvest_top", product->yeasts.at(i).y_harvest_top ? 1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1742 | obj.insert("y_harvest_time", product->yeasts.at(i).y_harvest_time); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1743 | obj.insert("y_pitch_temperature", round(product->yeasts.at(i).y_pitch_temperature * 10) / 10); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1744 | obj.insert("y_pofpos", product->yeasts.at(i).y_pofpos ? 1:0); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1745 | obj.insert("y_zymocide", product->yeasts.at(i).y_zymocide); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1746 | obj.insert("y_gr_hl_lo", product->yeasts.at(i).y_gr_hl_lo); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1747 | obj.insert("y_sg_lo", round(product->yeasts.at(i).y_sg_lo * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1748 | obj.insert("y_gr_hl_hi", product->yeasts.at(i).y_gr_hl_hi); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1749 | obj.insert("y_sg_hi", round(product->yeasts.at(i).y_sg_hi * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1750 | obj.insert("y_cost", round(product->yeasts.at(i).y_cost * 1000) / 1000); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1751 | qDebug() << "yeasts_Json" << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1752 | array.append(obj); /* Append this object */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1753 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1754 | QJsonDocument doc; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1755 | doc.setArray(array); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1756 | // qDebug() << doc.toJson(QJsonDocument::Compact); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1757 | query.bindValue(":json_yeasts", doc.toJson(QJsonDocument::Compact)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1758 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1759 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1760 | if (product->mashs.size() == 0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1761 | query.bindValue(":json_mashs", "[]"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1762 | qDebug() << "Saved empty mashs"; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1763 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1764 | QJsonArray array; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1765 | for (int i = 0; i < product->mashs.size(); i++) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1766 | QJsonObject obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1767 | obj.insert("step_name", product->mashs.at(i).step_name); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1768 | obj.insert("step_type", product->mashs.at(i).step_type); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1769 | obj.insert("step_volume", round(product->mashs.at(i).step_volume * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1770 | obj.insert("step_infuse_amount", round(product->mashs.at(i).step_infuse_amount * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1771 | obj.insert("step_infuse_temp", round(product->mashs.at(i).step_infuse_temp * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1772 | obj.insert("step_temp", round(product->mashs.at(i).step_temp * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1773 | obj.insert("step_time", round(product->mashs.at(i).step_time * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1774 | obj.insert("ramp_time", round(product->mashs.at(i).ramp_time * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1775 | obj.insert("end_temp", round(product->mashs.at(i).end_temp * 100) / 100); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1776 | obj.insert("step_wg_ratio", round(product->mashs.at(i).step_wg_ratio * 100) / 100); |
202
49ec4fdee5a6
Added mash steps pH and SG values.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
1777 | obj.insert("step_ph", round(product->mashs.at(i).step_ph * 100) / 100); |
49ec4fdee5a6
Added mash steps pH and SG values.
Michiel Broek <mbroek@mbse.eu>
parents:
198
diff
changeset
|
1778 | obj.insert("step_sg", round(product->mashs.at(i).step_sg * 10000) / 10000); |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1779 | qDebug() << "mashs_Json" << i << obj; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1780 | array.append(obj); /* Append this object */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1781 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1782 | QJsonDocument doc; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1783 | doc.setArray(array); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1784 | qDebug() << doc.toJson(QJsonDocument::Compact); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1785 | query.bindValue(":json_mashs", doc.toJson(QJsonDocument::Compact)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1786 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1787 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1788 | if (this->recno == -1) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1789 | query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36)); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1790 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1791 | query.bindValue(":recno", this->recno); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1792 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1793 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1794 | qDebug() << query.lastQuery(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1795 | if (query.lastError().isValid()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1796 | qDebug() << "EditProduct" << query.lastError(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1797 | QMessageBox::warning(this, tr("Database error"), |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1798 | tr("MySQL error: %1\n%2\n%3") |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1799 | .arg(query.lastError().nativeErrorCode()) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1800 | .arg(query.lastError().driverText()) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1801 | .arg(query.lastError().databaseText())); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1802 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1803 | /* |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1804 | * If this was a new product, find out what record number we |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1805 | * have got and set it. So when the user saves this record |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1806 | * again, it will be updated instead of inserting a new copy. |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1807 | */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1808 | if (this->recno < 0) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1809 | QVariant id = query.lastInsertId(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1810 | this->recno = product->record = id.toInt(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1811 | qDebug() << "EditProduct Inserted record" << this->recno; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1812 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1813 | qDebug() << "EditProduct Updated record" << this->recno; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1814 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1815 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1816 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1817 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1818 | ui->saveButton->setEnabled(false); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1819 | this->textIsChanged = false; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1820 | WindowTitle(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1821 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1822 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1823 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1824 | #include "EditProductTab1.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1825 | #include "EditProductTab2.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1826 | #include "EditProductTab3.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1827 | #include "EditProductTab4.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1828 | #include "EditProductTab5.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1829 | #include "EditProductTab6.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1830 | #include "EditProductTab7.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1831 | #include "EditProductTab8.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1832 | #include "EditProductTab9.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1833 | #include "EditProductTab10.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1834 | #include "EditProductTab11.cpp" |
225
448e4187cada
Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents:
224
diff
changeset
|
1835 | #include "EditProductTab12.cpp" |
175
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1836 | #include "EditProductExport.cpp" |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1837 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1838 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1839 | void EditProduct::on_deleteButton_clicked() |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1840 | { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1841 | QSqlQuery query; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1842 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1843 | int rc = QMessageBox::warning(this, tr("Delete product"), tr("Delete %1").arg(product->name), |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1844 | QMessageBox::Yes | QMessageBox::No, QMessageBox::No); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1845 | if (rc == QMessageBox::No) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1846 | return; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1847 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1848 | query.prepare("DELETE FROM products WHERE record = :recno"); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1849 | query.bindValue(":recno", this->recno); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1850 | query.exec(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1851 | if (query.lastError().isValid()) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1852 | qDebug() << "EditProduct" << query.lastError(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1853 | QMessageBox::warning(this, tr("Database error"), |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1854 | tr("MySQL error: %1\n%2\n%3") |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1855 | .arg(query.lastError().nativeErrorCode()) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1856 | .arg(query.lastError().driverText()) |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1857 | .arg(query.lastError().databaseText())); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1858 | } else { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1859 | qDebug() << "EditProduct Deleted" << this->recno; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1860 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1861 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1862 | this->close(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1863 | this->setResult(1); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1864 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1865 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1866 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1867 | void EditProduct::is_changed() |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1868 | { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1869 | ui->saveButton->setEnabled(true); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1870 | ui->deleteButton->setEnabled(((this->recno >= 0) ? true:false) && ! product->locked); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1871 | this->textIsChanged = true; |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1872 | WindowTitle(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1873 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1874 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1875 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1876 | void EditProduct::on_quitButton_clicked() |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1877 | { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1878 | if (this->textIsChanged) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1879 | int rc = QMessageBox::warning(this, tr("Product changed"), tr("The product has been modified. Save changes?"), |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1880 | QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1881 | switch (rc) { |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1882 | case QMessageBox::Save: |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1883 | on_saveButton_clicked(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1884 | break; /* Saved and then Quit */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1885 | case QMessageBox::Discard: |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1886 | break; /* Quit without Save */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1887 | case QMessageBox::Cancel: |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1888 | return; /* Return to the editor page */ |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1889 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1890 | } |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1891 | |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1892 | this->close(); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1893 | this->setResult(1); |
f1ed3a2a94e9
Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1894 | } |