src/EditProduct.cpp

Sat, 30 Apr 2022 20:36:30 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 30 Apr 2022 20:36:30 +0200
changeset 181
14a1f7bca79b
parent 179
512f492358e3
child 182
545d31130844
permissions
-rw-r--r--

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.

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
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 if (id >= 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 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
94 query.bindValue(":recno", id);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 query.exec();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 if (! query.first()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 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
98 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
99 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
100 return;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 QSqlRecord rec = query.record();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 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
105 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
106
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 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
108 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
109 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
110 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
111 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
112 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
113 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
114 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
115 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
116 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
117 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
118 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
119 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
120
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 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
122 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
123 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
124 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
125 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
126 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
127 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
128 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
129 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
130 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
131 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
132 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
133 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
134 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
135 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
136 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
137 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
138 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
139 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
140 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
141 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
142 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
143 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
144 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
145
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 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
147 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
148 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
149 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
150 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
151 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
152 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
153 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
154 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
155 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
156 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
157 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
158 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
159 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
160 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
161 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
162 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
163 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
164 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
165 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
166 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
167 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
168 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
169 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
170 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
171 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
172 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
173 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
174 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
175 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
176 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
177 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
178 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
179
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 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
181 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
182 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
183 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
184 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
185 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
186 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
187 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
188 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
189 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
190 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
191
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 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
193 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
194 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
195 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
196 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
197 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
198 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
199
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 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
201 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
202 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
203 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
204 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
205 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
206
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207 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
208 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
209 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
210 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
211 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
212 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
213 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
214 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
215
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 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
217 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
218 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
219 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
220 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
221 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
222 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
223 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
224 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
225 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
226
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
227 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
228 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
229 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
230 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
231 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
232 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
233 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
234 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
235 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
236 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
237 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
238 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
239 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
240 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
241 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
242 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
243 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
244 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
245
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
246 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
247 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
248 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
249 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
250 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
251 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
252 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
253 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
254 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
255 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
256 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
257 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
258 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
259 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
260
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 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
262 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
263 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
264 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
265 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
266 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
267 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
268 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
269 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
270 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
271
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272 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
273 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
274 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
275 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
276 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
277 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
278 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
279 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
280 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
281 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
282 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
283 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
284 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
285 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
286 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
287 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
288 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
289 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
290 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
291 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
292 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
293 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
294 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
295 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
296 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
297 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
298 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
299 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
300 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
301 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
302 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
303 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
304 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
305 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
306 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
307 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
308 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
309 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
310
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 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
312 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
313 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
314 product->starter_viability = query.value("starter_viability").toInt();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315 product->yeast_prod_date = query.value("yeast_prod_date").toDate();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
316 product->yeast_pitchrate = query.value("yeast_pitchrate").toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
317 product->prop1_type = query.value("prop1_type").toInt();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
318 product->prop1_volume = query.value("prop1_volume").toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
319 product->prop2_type = query.value("prop2_type").toInt();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320 product->prop2_volume = query.value("prop2_volume").toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 product->prop3_type = query.value("prop3_type").toInt();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 product->prop3_volume = query.value("prop3_volume").toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 product->prop4_type = query.value("prop4_type").toInt();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 product->prop4_volume = query.value("prop4_volume").toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 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
327 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
328 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
329 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
330 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
331
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332 QJsonParseError parseError;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
333 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
334 if (!f_json.trimmed().isEmpty()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335 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
336 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
337 if (parseError.error != QJsonParseError::NoError) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
338 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
339 } else if (fermentables.isArray()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
340 double percentcheck = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
341 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
342 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
343 //qDebug() << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
344 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
345 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
346 f.f_avail = false;
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
347 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
348 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
349 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
350 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
351 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
352 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
353 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
354 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
355 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
356 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
357 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
358 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
359 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
360 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
361 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
362 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
363 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
364 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
365 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
366 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
367 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
368 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
369 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
370 product->fermentables_use100 = true;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
371 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
372 /* 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
373 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
374 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
375 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
376 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
377 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
378 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
379 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
380 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
381 }
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
382 product->fermentables.append(f);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384 qDebug() << "fermentables" << product->fermentables.size() << percentcheck;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385 if (percentcheck == 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
386 /* Missing percentages, fix it. */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387 double total = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388 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
389 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
390 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
391 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
392 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
393 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
394 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
395 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
396 qDebug() << " fixed missing percentages";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
398 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
399 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
400 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
401 qDebug() << "empty fermentables";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
402 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
403
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
404 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
405 if (!h_json.trimmed().isEmpty()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
406 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
407 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
408 if (parseError.error != QJsonParseError::NoError) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
409 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
410 } else if (hops.isArray()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
411 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
412 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
413 //qDebug() << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
414 Hops h;
178
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
415 h.h_avail = false;
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
416 h.h_inventory = 0;
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417 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
418 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
419 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
420 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
421 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
422 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
423 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
424 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
425 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
426 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
427 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
428 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
429 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
430 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
431 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
432 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
433 /* Check and update inventory */
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
434 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
435 yquery.bindValue(":name", h.h_name);
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
436 yquery.bindValue(":origin", h.h_origin);
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
437 yquery.exec();
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
438 if (yquery.first()) {
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
439 h.h_avail = true;
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
440 h.h_inventory = yquery.value(0).toDouble();
1091fd9feffe Add hops inventory update during product load.
Michiel Broek <mbroek@mbse.eu>
parents: 177
diff changeset
441 }
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442 product->hops.append(h);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
444 qDebug() << "hops" << product->hops.size();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
445 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
446 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
447 qDebug() << "empty hops";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
448 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
449
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
450 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
451 if (!m_json.trimmed().isEmpty()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
452 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
453 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
454 if (parseError.error != QJsonParseError::NoError) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
455 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
456 } else if (miscs.isArray()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
457 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
458 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
459 //qDebug() << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
460 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
461 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
462 m.m_inventory = 0;
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
463 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
464 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
465 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
466 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
467 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
468 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
469 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
470 /* 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
471 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
472 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
473 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
474 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
475 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
476 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
477 }
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
478 product->miscs.append(m);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
479 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
480 qDebug() << "miscs" << product->miscs.size();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
481 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
482 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
483 qDebug() << "empty miscs";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
484 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
485
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
486 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
487 if (!y_json.trimmed().isEmpty()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
488 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
489 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
490 if (parseError.error != QJsonParseError::NoError) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
491 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
492 } else if (yeasts.isArray()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
493 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
494 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
495 //qDebug() << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
496 Yeasts y;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
497 /* 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
498 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
499 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
500 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
501 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
502 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
503 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
504 /* 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
505 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
506 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
507 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
508 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
509 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
510 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
511 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
512 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
513 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
514 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
515 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
516 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
517 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
518 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
519 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
520 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
521 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
522 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
523 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
524 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
525 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
526 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
527 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
528 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
529 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
530 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
531 /*
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
532 * 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
533 */
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
534 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
535 "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
536 "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
537 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
538 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
539 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
540 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
541 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
542 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
543 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
544 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
545 }
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
546 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
547 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
548 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
549 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
550 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
551 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
552 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
553 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
554 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
555 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
556 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
557 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
558 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
559 } 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
560 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
561 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
562 product->yeasts.append(y);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
563 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
564 qDebug() << "yeasts" << product->yeasts.size();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
565 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
566 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
567 qDebug() << "empty yeasts";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
568 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
569
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
570 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
571 if (!ma_json.trimmed().isEmpty()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
572 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
573 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
574 if (parseError.error != QJsonParseError::NoError) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
575 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
576 } else if (mashs.isArray()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
577 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
578 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
579 qDebug() << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
580 Mashs m;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
581 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
582 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
583 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
584 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
585 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
586 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
587 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
588 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
589 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
590 m.step_wg_ratio = obj["step_wg_ratio"].toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
591 product->mashs.append(m);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
592 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
593 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
594 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
595 qDebug() << "empty mashs";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
596 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
597 qDebug() << "mashs" << product->mashs.size();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
598
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
599 } else {
176
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
600 /* New product, set some defaults */
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
601 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
602 product->st_name = "";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
603 product->st_letter = "";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
604 product->st_guide = "";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
605 product->st_category = "";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
606 product->st_category_number = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
607 product->st_type = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
608 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
609 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
610 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
611 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
612 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
613 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
614 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
615 product->eq_tun_specific_heat = 0.11;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
616 product->eq_tun_material = 0;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
617 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
618 product->eq_tun_weight = 2;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
619 product->eq_top_up_water = 0;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
620 product->eq_trub_chiller_loss = 0.5;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
621 product->eq_evap_rate = 1.8;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
622 product->eq_calc_boil_volume = true;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
623 product->eq_top_up_kettle = 0;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
624 product->eq_hop_utilization = 100;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
625 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
626 product->eq_lauter_deadspace = 0.5;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
627 product->eq_mash_max = 6;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
628 product->eq_efficiency = 75;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
629 product->birth = QDate::currentDate();
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
630 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
631 product->notes = "";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
632 product->efficiency = 75;
176
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
633 product->eq_batch_size = product->batch_size = 20;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
634 product->eq_boil_time = product->boil_time = 60;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
635 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
636 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
637 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
638 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
639 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
640 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
641 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
642 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
643 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
644 product->brew_cooling_to = 20;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
645 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
646 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
647 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
648 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
649 product->og = product->fg = 0;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
650 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
651 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
652 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
653 product->package_date = QDate();
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
654 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
655 product->package_infuse_notes = "";
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
656 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
657 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
658 product->keg_carbonation_temp = product->keg_pressure = 0;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
659 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
660 product->taste_rate = 0;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
661 product->taste_date = QDate();
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
662 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
663 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
664 product->sparge_temp = 80;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
665 product->sparge_ph = 5.4;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
666 product->sparge_volume = 8;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
667 product->sparge_source = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
668 product->sparge_acid_type = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
669 product->sparge_acid_perc = 80;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
670 product->sparge_acid_amount = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
671 product->mash_ph = 5.4;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
672 product->mash_name = "";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
673 product->calc_acid = true;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
674 product->w1_name = "";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
675 product->w1_amount = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
676 product->w1_calcium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
677 product->w1_sulfate = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
678 product->w1_chloride = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
679 product->w1_sodium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
680 product->w1_magnesium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
681 product->w1_total_alkalinity = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
682 product->w1_ph = 7;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
683 product->w1_cost = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
684 product->w2_name = "";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
685 product->w2_amount = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
686 product->w2_calcium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
687 product->w2_sulfate = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
688 product->w2_chloride = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
689 product->w2_sodium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
690 product->w2_magnesium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
691 product->w2_total_alkalinity = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
692 product->w2_ph = 7;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
693 product->w2_cost = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
694 product->wg_amount = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
695 product->wg_calcium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
696 product->wg_sulfate = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
697 product->wg_chloride = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
698 product->wg_sodium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
699 product->wg_magnesium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
700 product->wg_total_alkalinity = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
701 product->wg_ph = 7;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
702 product->wb_calcium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
703 product->wb_sulfate = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
704 product->wb_chloride = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
705 product->wb_sodium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
706 product->wb_magnesium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
707 product->wb_total_alkalinity = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
708 product->wb_ph = 7;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
709 product->wa_acid_name = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
710 product->wa_acid_perc = 80;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
711 product->wa_base_name = 0;
176
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
712 product->starter_enable = false;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
713 product->starter_type = product->prop1_type = product->prop2_type = product->prop3_type = product->prop4_type = 0;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
714 product->starter_viability = 100;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
715 product->starter_sg = 1.037;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
716 product->yeast_prod_date = QDate();
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
717 product->yeast_pitchrate = product->prop1_volume = product->prop2_volume = product->prop3_volume = product->prop4_volume = 0;
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
718 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
719 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
720 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
721
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
722 // Tab generic.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
723 ui->lockedEdit->setChecked(product->locked);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
724 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
725 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
726 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
727 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
728 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
729 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
730 ui->nameEdit->setText(product->name);
176
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
731 ui->codeEdit->setText(product->code);
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
732 ui->birthEdit->setText(product->birth.toString("dd MMM yyyy"));
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
733 ui->stageEdit->setText(prod_stages[product->stage]);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
734 ui->notesEdit->setPlainText(product->notes);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
735 ui->typeEdit->setCurrentIndex(product->type);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
736 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
737 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
738 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
739 ui->efficiencyEdit->setValue(product->efficiency);
176
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
740 if (product->divide_type > 0)
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
741 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
742 .arg(product->divide_part + 1)
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
743 .arg(product->divide_parts + 1)));
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
744 else
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
745 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
746 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
747 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
748 ui->est_ogShow->setPrecision(3);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
749 ui->est_ogShow->setMarkerTextIsValue(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
750 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
751 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
752 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
753 ui->est_fgShow->setPrecision(3);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
754 ui->est_fgShow->setMarkerTextIsValue(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
755 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
756 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
757 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
758 ui->est_abvShow->setPrecision(1);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
759 ui->est_abvShow->setMarkerTextIsValue(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
760 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
761 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
762 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
763 ui->est_colorShow->setPrecision(0);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
764 ui->est_colorShow->setMarkerTextIsValue(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
765 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
766 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
767 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
768 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
769 ui->est_ibuShow->setPrecision(0);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
770 ui->est_ibuShow->setMarkerTextIsValue(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
771 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
772 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
773 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
774 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
775 ui->est_carbShow->setPrecision(1);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
776 ui->est_carbShow->setMarkerTextIsValue(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
777 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
778 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
779
176
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
780 // Tab equipment.
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
781 showEquipment();
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
782
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
783 // Tab fermentables.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
784 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
785 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
786 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
787
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
788 // Tab hops.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
789 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
790
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
791 // Tab yeasts.
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
792 ui->est_og4Edit->setValue(product->est_og);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
793 ui->est_fg3Edit->setValue(product->est_fg);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
794 ui->est_abv2Edit->setValue(product->est_abv);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
795
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
796 // Tab mashs.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
797 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
798
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
799 // Tab waters.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
800 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
801 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
802 /*
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
803 * 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
804 */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
805 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
806 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
807 bool found = false;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
808 if (product->w1_name != "") {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
809 /*
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
810 * 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
811 */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
812 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
813 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
814 query.exec();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
815 found = query.first();
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 if (!found) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
818 /*
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
819 * Try to load default water
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
820 */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
821 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
822 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
823 query.exec();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
824 found = query.first();
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 if (found) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
827 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
828 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
829 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
830 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
831 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
832 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
833 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
834 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
835 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
836 product->w1_calcium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
837 product->w1_magnesium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
838 product->w1_total_alkalinity = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
839 product->w1_sodium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
840 product->w1_chloride = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
841 product->w1_sulfate = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
842 product->w1_ph = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
843 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
844 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
845 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
846 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
847 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
848 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
849 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
850 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
851 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
852 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
853 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
854
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
855 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
856 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
857 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
858 } else if (product->w2_name != "") {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
859 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
860 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
861 query.exec();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
862 if (query.first()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
863 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
864 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
865 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
866 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
867 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
868 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
869 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
870 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
871 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
872 product->w2_calcium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
873 product->w2_magnesium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
874 product->w2_total_alkalinity = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
875 product->w2_sodium = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
876 product->w2_chloride = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
877 product->w2_sulfate = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
878 product->w2_ph = 0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
879 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
880 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
881 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
882 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
883 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
884 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
885 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
886 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
887 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
888 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
889 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
890 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
891 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
892 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
893 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
894 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
895
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
896 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
897 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
898 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
899 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
900 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
901 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
902 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
903
176
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
904 // Tab brewday.
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
905
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
906 // Tab fermentation.
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
907
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
908 // Tab packaging.
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
909
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
910 // Tab taste.
69a033e099a2 Tab 2 equipent, all editfields placed.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
911
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
912 // All signals from tab "Generic"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
913 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
914 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
915 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
916 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
917 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
918 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
919 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
920 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
921 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
922 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
923 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
924 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
925
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
926 // All signals from tab "Fermentables"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
927 ui->fermentablesTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
928 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
929 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
930 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
931 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
932 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
933 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
934
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
935 // All signals from tab "Hops"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
936 ui->hopsTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
937 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
938 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
939 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
940
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
941 // All signals from tab "Miscs"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
942 ui->miscsTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
943 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
944
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
945 // All signals from tab "Yeasts"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
946 ui->yeastsTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
947 connect(ui->addYeast, SIGNAL(clicked()), this, SLOT(addYeastRow_clicked()));
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
948
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
949 // All signals from tab "Mash"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
950 ui->mashsTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
951 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
952 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
953 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
954
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
955 // All signals from tab "Water"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
956 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
957 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
958 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
959 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
960 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
961 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
962 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
963 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
964 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
965 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
966 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
967 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
968 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
969 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
970 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
971 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
972 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
973 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
974
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
975 setLocked(product->locked);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
976
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
977 ui->saveButton->setEnabled(false);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
978 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
979
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
980 emit refreshAll();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
981 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
982
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
983
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
984 EditProduct::~EditProduct()
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
985 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
986 qDebug() << "EditProduct done start";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
987 delete ui;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
988 emit entry_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
989 qDebug() << "EditProduct done final";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
990 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
991
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
992
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
993 void EditProduct::refreshAll()
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
994 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
995 refreshFermentables();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
996 calcFermentables(); /* Must be before Hops */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
997 refreshHops();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
998 calcIBUs();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
999 refreshMiscs();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1000 refreshYeasts();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1001 calcYeast();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1002 calcMash();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1003 refreshMashs();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1004 refreshWaters();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1005 calcWater();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1006 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1007
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1008
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1009 /*
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1010 * 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
1011 */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1012 void EditProduct::WindowTitle()
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1013 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1014 QString txt;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1015
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1016 if (this->recno < 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1017 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
1018 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1019 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
1020 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1021
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1022 if (this->textIsChanged) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1023 txt.append((QString(" **")));
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1024 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1025 setWindowTitle(txt);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1026 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1027
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1028
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1029 void EditProduct::on_saveButton_clicked()
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1030 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1031 QSqlQuery query;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1032
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1033 /* 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
1034 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
1035 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
1036 return;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1037 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1038 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
1039 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
1040 return;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1041 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1042
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1043 if (this->textIsChanged) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1044 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
1045 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
1046 "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
1047 "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
1048 "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
1049 "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
1050 "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
1051 "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
1052 "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
1053 "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
1054 "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
1055 "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
1056 "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
1057 "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
1058 "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
1059 "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
1060 "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
1061 "brew_preboil_efficiency=:brew_preboil_efficiency, brew_aboil_volume=:brew_aboil_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
1062 "brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph:=brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_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
1063 "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
1064 "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
1065 "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
1066 "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
1067 "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
1068 "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
1069 "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
1070 "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
1071 "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
1072 "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
1073 "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
1074 "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
1075 "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
1076 "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
1077 "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
1078 "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
1079 "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
1080 "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
1081 "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
1082 "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
1083 "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
1084 "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
1085 "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
1086 "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
1087 "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
1088 "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
1089 "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
1090 "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
1091 "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
1092 "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
1093 "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
1094 "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
1095 "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
1096 "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
1097 "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
1098 "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
1099 "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
1100 "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
1101 "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
1102 "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
1103 "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
1104 "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
1105 "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
1106 "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
1107 "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
1108 "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
1109 "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
1110 "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
1111 "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
1112 "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
1113 "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
1114 "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
1115 "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
1116 } 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
1117 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
1118 "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
1119 "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
1120 "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
1121 "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
1122 "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
1123 "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
1124 "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
1125 "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
1126 "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
1127 "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
1128 "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
1129 "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
1130 "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
1131 "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
1132 "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
1133 "brew_preboil_efficiency=:brew_preboil_efficiency, brew_aboil_volume=:brew_aboil_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
1134 "brew_aboil_sg=:brew_aboil_sg, brew_aboil_ph:=brew_aboil_ph, brew_aboil_efficiency=:brew_aboil_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
1135 "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
1136 "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
1137 "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
1138 "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
1139 "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
1140 "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
1141 "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
1142 "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
1143 "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
1144 "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
1145 "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
1146 "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
1147 "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
1148 "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
1149 "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
1150 "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
1151 "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
1152 "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
1153 "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
1154 "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
1155 "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
1156 "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
1157 "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
1158 "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
1159 "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
1160 "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
1161 "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
1162 "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
1163 "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
1164 "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
1165 "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
1166 "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
1167 "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
1168 "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
1169 "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
1170 "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
1171 "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
1172 "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
1173 "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
1174 "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
1175 "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
1176 "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
1177 "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
1178 "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
1179 "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
1180 "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
1181 "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
1182 "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
1183 "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
1184 "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
1185 "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
1186 "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
1187 "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
1188 }
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
1189
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
1190 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
1191 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
1192 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
1193 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
1194 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
1195 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
1196 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
1197 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
1198 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
1199 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
1200 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
1201 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
1202 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
1203 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
1204 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
1205 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
1206 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
1207 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
1208 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
1209 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
1210 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
1211 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
1212 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
1213 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
1214 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
1215 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
1216 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
1217 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
1218 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
1219 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
1220 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
1221 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
1222 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
1223 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
1224 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
1225 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
1226 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
1227 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
1228 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
1229 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
1230 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
1231 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
1232 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
1233 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
1234 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
1235 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
1236 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
1237 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
1238 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
1239 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
1240 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
1241 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
1242 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
1243 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
1244 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
1245 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
1246 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
1247 query.bindValue(":brew_whirlpool2", round(product->brew_whirlpool2));
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
1248 query.bindValue(":brew_fermenter_volume", 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
1249 query.bindValue(":brew_fermenter_extrawater", 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
1250 query.bindValue(":brew_fermenter_tcloss", 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
1251 query.bindValue(":brew_aeration_time", round(product->brew_aeration_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
1252 query.bindValue(":brew_aeration_speed", 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
1253 query.bindValue(":brew_aeration_type", product->brew_aeration_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
1254 query.bindValue(":brew_fermenter_sg", round(product->brew_aboil_efficiency * 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
1255 query.bindValue(":brew_fermenter_ibu", 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
1256 query.bindValue(":brew_fermenter_color", 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
1257 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
1258 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
1259 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
1260 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
1261 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
1262 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
1263 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
1264 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
1265 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
1266 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
1267 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
1268 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
1269 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
1270 query.bindValue(":package_volume", round(product->package_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
1271 query.bindValue(":package_infuse_amount", round(product->package_infuse_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
1272 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
1273 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
1274 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
1275 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
1276 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
1277 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
1278 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
1279 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
1280 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
1281 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
1282 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
1283 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
1284 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
1285 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
1286 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
1287 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
1288 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
1289 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
1290 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
1291 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
1292 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
1293 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
1294 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
1295 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
1296 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
1297 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
1298 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
1299 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
1300 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
1301 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
1302 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
1303 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
1304 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
1305 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
1306 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
1307 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
1308 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
1309 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
1310 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
1311 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
1312 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
1313 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
1314 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
1315 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
1316 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
1317 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
1318 query.bindValue(":type", product->type);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1319 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
1320 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
1321 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
1322 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
1323 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
1324 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
1325 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
1326 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
1327 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
1328 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
1329 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
1330 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
1331 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
1332 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
1333 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
1334 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
1335 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
1336 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
1337 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
1338 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
1339 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
1340 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
1341 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
1342 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
1343 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
1344 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
1345 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
1346 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
1347 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
1348 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
1349 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
1350 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
1351 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
1352 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
1353 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
1354 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
1355 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
1356 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
1357 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
1358 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
1359 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
1360 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
1361 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
1362 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
1363 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
1364 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
1365 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
1366 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
1367 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
1368 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
1369 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
1370 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
1371 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
1372 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
1373 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
1374 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
1375 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
1376 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
1377 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
1378 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
1379 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
1380 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
1381 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
1382 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
1383 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
1384 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
1385 query.bindValue(":yeast_pitchrate", round(product->yeast_pitchrate * 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
1386 query.bindValue(":prop1_type", product->prop1_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
1387 query.bindValue(":prop1_volume", round(product->prop1_volume * 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
1388 query.bindValue(":prop2_type", product->prop2_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
1389 query.bindValue(":prop2_volume", round(product->prop2_volume * 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
1390 query.bindValue(":prop3_type", product->prop3_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
1391 query.bindValue(":prop3_volume", round(product->prop3_volume * 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
1392 query.bindValue(":prop4_type", product->prop4_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
1393 query.bindValue(":prop4_volume", round(product->prop4_volume * 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
1394 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
1395 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
1396 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
1397 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
1398 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
1399
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1400 if (product->fermentables.size() == 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1401 query.bindValue(":json_fermentables", "[]");
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1402 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1403 QJsonArray array;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1404 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
1405 QJsonObject obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1406 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
1407 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
1408 obj.insert("f_supplier", product->fermentables.at(i).f_supplier);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1409 obj.insert("f_amount", round(product->fermentables.at(i).f_amount * 10000) / 10000);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1410 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
1411 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
1412 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
1413 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
1414 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
1415 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
1416 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
1417 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
1418 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
1419 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
1420 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
1421 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
1422 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
1423 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
1424 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
1425 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
1426 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
1427 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
1428 qDebug() << "fermentables_Json" << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1429 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
1430 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1431 QJsonDocument doc;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1432 doc.setArray(array);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1433 // qDebug() << doc.toJson(QJsonDocument::Compact);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1434 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
1435 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1436
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1437 if (product->hops.size() == 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1438 query.bindValue(":json_hops", "[]");
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1439 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1440 QJsonArray array;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1441 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
1442 QJsonObject obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1443 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
1444 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
1445 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
1446 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
1447 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
1448 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
1449 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
1450 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
1451 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
1452 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
1453 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
1454 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
1455 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
1456 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
1457 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
1458 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
1459 qDebug() << "hops_Json" << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1460 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
1461 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1462 QJsonDocument doc;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1463 doc.setArray(array);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1464 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
1465 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1466
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1467 if (product->miscs.size() == 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1468 query.bindValue(":json_miscs", "[]");
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1469 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1470 QJsonArray array;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1471 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
1472 QJsonObject obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1473 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
1474 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
1475 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
1476 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
1477 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
1478 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
1479 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
1480 qDebug() << "miscs_Json" << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1481 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
1482 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1483 QJsonDocument doc;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1484 doc.setArray(array);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1485 // qDebug() << doc.toJson(QJsonDocument::Compact);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1486 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
1487 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1488
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1489 if (product->yeasts.size() == 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1490 query.bindValue(":json_yeasts", "[]");
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1491 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1492 QJsonArray array;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1493 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
1494 QJsonObject obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1495 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
1496 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
1497 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
1498 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
1499 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
1500 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
1501 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
1502 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
1503 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
1504 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
1505 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
1506 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
1507 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
1508 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
1509 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
1510 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
1511 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
1512 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
1513 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
1514 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
1515 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
1516 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
1517 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
1518 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
1519 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
1520 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
1521 qDebug() << "yeasts_Json" << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1522 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
1523 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1524 QJsonDocument doc;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1525 doc.setArray(array);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1526 // qDebug() << doc.toJson(QJsonDocument::Compact);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1527 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
1528 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1529
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1530 if (product->mashs.size() == 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1531 query.bindValue(":json_mashs", "[]");
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1532 qDebug() << "Saved empty mashs";
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1533 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1534 QJsonArray array;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1535 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
1536 QJsonObject obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1537 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
1538 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
1539 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
1540 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
1541 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
1542 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
1543 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
1544 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
1545 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
1546 obj.insert("step_wg_ratio", round(product->mashs.at(i).step_wg_ratio * 100) / 100);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1547 qDebug() << "mashs_Json" << i << obj;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1548 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
1549 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1550 QJsonDocument doc;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1551 doc.setArray(array);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1552 qDebug() << doc.toJson(QJsonDocument::Compact);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1553 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
1554 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1555
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1556 if (this->recno == -1) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1557 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
1558 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1559 query.bindValue(":recno", this->recno);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1560 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1561 query.exec();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1562 qDebug() << query.lastQuery();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1563 if (query.lastError().isValid()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1564 qDebug() << "EditProduct" << query.lastError();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1565 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
1566 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
1567 .arg(query.lastError().nativeErrorCode())
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1568 .arg(query.lastError().driverText())
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1569 .arg(query.lastError().databaseText()));
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1570 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1571 /*
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1572 * 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
1573 * 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
1574 * 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
1575 */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1576 if (this->recno < 0) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1577 QVariant id = query.lastInsertId();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1578 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
1579 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
1580 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1581 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
1582 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1583 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1584 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1585
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1586 ui->saveButton->setEnabled(false);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1587 this->textIsChanged = false;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1588 WindowTitle();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1589 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1590
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1591
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1592 #include "EditProductTab1.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1593 #include "EditProductTab2.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1594 #include "EditProductTab3.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1595 #include "EditProductTab4.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1596 #include "EditProductTab5.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1597 #include "EditProductTab6.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1598 #include "EditProductTab7.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1599 #include "EditProductTab8.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1600 #include "EditProductTab9.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1601 #include "EditProductTab10.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1602 #include "EditProductTab11.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1603 #include "EditProductExport.cpp"
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1604
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1605
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1606 void EditProduct::on_deleteButton_clicked()
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1607 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1608 QSqlQuery query;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1609
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1610 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
1611 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
1612 if (rc == QMessageBox::No)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1613 return;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1614
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1615 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
1616 query.bindValue(":recno", this->recno);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1617 query.exec();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1618 if (query.lastError().isValid()) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1619 qDebug() << "EditProduct" << query.lastError();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1620 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
1621 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
1622 .arg(query.lastError().nativeErrorCode())
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1623 .arg(query.lastError().driverText())
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1624 .arg(query.lastError().databaseText()));
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1625 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1626 qDebug() << "EditProduct Deleted" << this->recno;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1627 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1628
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1629 this->close();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1630 this->setResult(1);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1631 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1632
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1633
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1634 void EditProduct::is_changed()
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1635 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1636 ui->saveButton->setEnabled(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1637 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
1638 this->textIsChanged = true;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1639 WindowTitle();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1640 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1641
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1642
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1643 void EditProduct::on_quitButton_clicked()
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1644 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1645 if (this->textIsChanged) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1646 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
1647 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
1648 switch (rc) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1649 case QMessageBox::Save:
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1650 on_saveButton_clicked();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1651 break; /* Saved and then Quit */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1652 case QMessageBox::Discard:
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1653 break; /* Quit without Save */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1654 case QMessageBox::Cancel:
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1655 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
1656 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1657 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1658
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1659 this->close();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1660 this->setResult(1);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1661 }

mercurial