src/EditEquipment.cpp

Mon, 24 Oct 2022 19:59:08 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 24 Oct 2022 19:59:08 +0200
changeset 423
8cb46020796a
parent 419
d49f38cc76a0
child 458
ac216a75ca9b
permissions
-rw-r--r--

Adjusted chiller_loss default value to 0.4. Disabled product fields eq_calc_boil_volume, eq_hop_utilization, eq_lauter_volume and eq_lauter_height. Added eq_chiller_type, eq_chiller_to79, eq_chiller_volume, eq_chiller_lpm, eq_chiller_loss with default values for immersion chilling. Load these values from new selected equipment. Changed edit product tab 2 to show new the new fields and removed the obsolete fields.

30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * EditEquipment.cpp is part of bmsapp.
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * bmsapp is free software: you can redistribute it and/or modify
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * the Free Software Foundation, either version 3 of the License, or
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 * (at your option) any later version.
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 *
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * bmsapp is distributed in the hope that it will be useful,
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * GNU General Public License for more details.
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 *
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 */
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
17 #include "MainWindow.h"
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 #include "EditEquipment.h"
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 #include "../ui/ui_EditEquipment.h"
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
20 #include "global.h"
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 EditEquipment::EditEquipment(int id, QWidget *parent) : QDialog(parent), ui(new Ui::EditEquipment)
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 QSqlQuery query, query2;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 qDebug() << "EditEquipment record:" << id;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 ui->setupUi(this);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 this->recno = id;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 WindowTitle();
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
32
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
33 for (int i = 0; i < 4; i++)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
34 ui->tun_materialEdit->addItem(QCoreApplication::translate("TunMaterial", g_tun_materials[i]));
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
35
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
36 for (int i = 0; i < 5; i++)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
37 ui->chiller_typeEdit->addItem(QCoreApplication::translate("ChillerType", g_chiller_types[i]));
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 if (id >= 0) {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 query.prepare("SELECT * FROM inventory_equipments WHERE record = :recno");
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 query.bindValue(":recno", id);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 query.exec();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 query.next();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
45 ui->nameEdit->setText(query.value("name").toString());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
46 ui->boil_sizeEdit->setValue(query.value("boil_size").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
47 ui->batch_sizeEdit->setValue(query.value("batch_size").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
48 ui->tun_volumeEdit->setValue(query.value("tun_volume").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
49 ui->tun_weightEdit->setValue(query.value("tun_weight").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
50 ui->tun_specific_heatEdit->setValue(query.value("tun_specific_heat").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
51 ui->tun_materialEdit->setCurrentIndex(query.value("tun_material").toInt());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
52 ui->tun_heightEdit->setValue(query.value("tun_height").toDouble() * 100.0);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
53 ui->top_up_waterEdit->setValue(query.value("top_up_water").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
54 ui->trub_lossEdit->setValue(query.value("trub_chiller_loss").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
55 ui->evap_rateEdit->setValue(query.value("evap_rate").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
56 ui->boil_timeEdit->setValue(query.value("boil_time").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
57 ui->calcboilEdit->setChecked(query.value("calc_boil_volume").toInt() ? true:false);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
58 ui->top_up_kettleEdit->setValue(query.value("top_up_kettle").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
59 ui->notesEdit->setPlainText(query.value("notes").toString());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
60 ui->lauter_deadspaceEdit->setValue(query.value("lauter_deadspace").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
61 ui->kettle_volumeEdit->setValue(query.value("kettle_volume").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
62 ui->kettle_heightEdit->setValue(query.value("kettle_height").toDouble() * 100.0);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
63 ui->mash_volumeEdit->setValue(query.value("mash_volume").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
64 ui->mash_maxEdit->setValue(query.value("mash_max").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
65 ui->efficiencyEdit->setValue(query.value("efficiency").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
66 ui->chiller_typeEdit->setCurrentIndex(query.value("chiller_type").toInt());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
67 ui->chiller_to79Edit->setValue(query.value("chiller_to79").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
68 ui->chiller_lossEdit->setValue(query.value("chiller_loss").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
69 ui->chiller_volumeEdit->setValue(query.value("chiller_volume").toDouble());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
70 ui->chiller_lpmEdit->setValue(query.value("chiller_lpm").toDouble());
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 /*
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 * Now we have loaded this record, check if this equipment is
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 * being used by a product. If so, make the name field read-only.
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 */
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 query2.prepare("SELECT eq_name FROM products WHERE eq_name=:name");
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
76 query2.bindValue(":name", query.value("name").toString());
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 query2.exec();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 inuse = query2.size();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 ui->nameEdit->setReadOnly(inuse > 0);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 } else {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 /* Set some defaults */
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 ui->boil_sizeEdit->setValue(18);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 ui->batch_sizeEdit->setValue(15.3);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 ui->tun_volumeEdit->setValue(20);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 ui->tun_weightEdit->setValue(2);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 ui->tun_specific_heatEdit->setValue(0.11);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 ui->tun_materialEdit->setCurrentIndex(0);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 ui->tun_heightEdit->setValue(20);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 ui->top_up_waterEdit->setValue(0);
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
90 ui->trub_lossEdit->setValue(0.5);
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 ui->evap_rateEdit->setValue(1.8);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 ui->boil_timeEdit->setValue(90);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 ui->calcboilEdit->setChecked(true);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 ui->top_up_kettleEdit->setValue(0);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 ui->lauter_deadspaceEdit->setValue(0.5);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 ui->kettle_volumeEdit->setValue(20);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 ui->kettle_heightEdit->setValue(20);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 ui->mash_volumeEdit->setValue(18);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 ui->mash_maxEdit->setValue(6);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 ui->efficiencyEdit->setValue(75);
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
101 ui->chiller_typeEdit->setCurrentIndex(1);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
102 ui->chiller_to79Edit->setValue(10);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
103 ui->chiller_lossEdit->setValue(0);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
104 ui->chiller_volumeEdit->setValue(0.5);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
105 ui->chiller_lpmEdit->setValue(0);
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 inuse = 0;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 }
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
108 /* Block select no chiller used */
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
109 qobject_cast<QStandardItemModel*>(ui->chiller_typeEdit->model())->item(CHILLER_TYPE_NONE)->setEnabled(false);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
110 chiller_setup(ui->chiller_typeEdit->currentIndex());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
111
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 connect(ui->boil_sizeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 connect(ui->batch_sizeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 connect(ui->tun_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 connect(ui->tun_weightEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 connect(ui->tun_materialEdit, &QComboBox::currentTextChanged, this, &EditEquipment::material_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 connect(ui->tun_heightEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 connect(ui->top_up_waterEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
120 connect(ui->trub_lossEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 connect(ui->evap_rateEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 connect(ui->boil_timeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 connect(ui->calcboilEdit, &QCheckBox::stateChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 connect(ui->top_up_kettleEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(is_changed()));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 connect(ui->lauter_deadspaceEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 connect(ui->kettle_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 connect(ui->kettle_heightEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 connect(ui->mash_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 connect(ui->mash_maxEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 connect(ui->efficiencyEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
132 connect(ui->chiller_typeEdit, &QComboBox::currentTextChanged, this, &EditEquipment::chiller_changed);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
133 connect(ui->chiller_to79Edit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
134 connect(ui->chiller_volumeEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
135 connect(ui->chiller_lpmEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
136 connect(ui->chiller_lossEdit, &QDoubleSpinBox::textChanged, this, &EditEquipment::is_changed);
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 calcBatchVolume();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 ui->saveButton->setEnabled(false);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 ui->deleteButton->setEnabled((inuse == 0 && id >= 0) ? true:false);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 EditEquipment::~EditEquipment()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 delete ui;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 emit entry_changed();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 /*
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 * Window header, mark any change with '**'
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 */
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 void EditEquipment::WindowTitle()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 QString txt;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 if (this->recno < 0) {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 txt = QString(tr("BMSapp - Add new equipment"));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 } else {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161 txt = QString(tr("BMSapp - Edit equipment %1").arg(this->recno));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 if (this->textIsChanged) {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 txt.append((QString(" **")));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 setWindowTitle(txt);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
169
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 void EditEquipment::on_saveButton_clicked()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 QSqlQuery query;
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
174 QString sql = "";
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
175
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176 /* If there are errors in the form, show a message and do "return;" */
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
177 if (ui->nameEdit->text().length() < 2) {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 QMessageBox::warning(this, tr("Edit Equipment"), tr("Name empty or too short."));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
179 return;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
181
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 if (this->textIsChanged) {
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
183 if (this->recno == -1) {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
184 sql = "INSERT INTO";
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
185 } else {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
186 sql = "UPDATE";
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
187 }
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
188 sql.append(" inventory_equipments SET name=:name, boil_size=:boil_size, "
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
189 "batch_size=:batch_size, tun_volume=:tun_volume, tun_weight=:tun_weight, "
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
190 "tun_specific_heat=:tun_specific_heat, tun_material=:tun_material, tun_height=:tun_height, "
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
191 "top_up_water=:top_up_water, trub_chiller_loss=:trub_loss, evap_rate=:evap_rate, "
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 "boil_time=:boil_time, calc_boil_volume=:calcboil, top_up_kettle=:top_up_kettle, "
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
193 "notes=:notes, lauter_deadspace=:lauter_deadspace, kettle_volume=:kettle_volume, "
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 "kettle_height=:kettle_height, mash_volume=:mash_volume, mash_max=:mash_max, "
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
195 "efficiency=:efficiency, chiller_type=:chiller_type, chiller_to79=:chiller_to79, "
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
196 "chiller_volume=:chiller_volume, chiller_lpm=:chiller_lpm, chiller_loss=:chiller_loss");
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
197 if (this->recno == -1) {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
198 sql.append(", uuid=:uuid");
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
199 } else {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
200 sql.append(" WHERE record = :recno");
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
201 }
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
202 query.prepare(sql);
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 query.bindValue(":name", ui->nameEdit->text());
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204 query.bindValue(":boil_size", QString("%1").arg(ui->boil_sizeEdit->value(), 2, 'f', 1, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 query.bindValue(":batch_size", QString("%1").arg(ui->batch_sizeEdit->value(), 3, 'f', 2, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 query.bindValue(":tun_volume", QString("%1").arg(ui->tun_volumeEdit->value(), 2, 'f', 1, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207 query.bindValue(":tun_weight", QString("%1").arg(ui->tun_weightEdit->value(), 2, 'f', 1, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 query.bindValue(":tun_specific_heat", QString("%1").arg(ui->tun_specific_heatEdit->value(), 4, 'f', 3, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209 query.bindValue(":tun_material", ui->tun_materialEdit->currentIndex());
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 query.bindValue(":tun_height", QString("%1").arg(ui->tun_heightEdit->value() / 100, 4, 'f', 3, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211 query.bindValue(":top_up_water", QString("%1").arg(ui->top_up_waterEdit->value(), 2, 'f', 1, '0'));
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
212 query.bindValue(":trub_loss", QString("%1").arg(ui->trub_lossEdit->value(), 2, 'f', 1, '0'));
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
213 query.bindValue(":evap_rate", QString("%1").arg(ui->evap_rateEdit->value(), 3, 'f', 2, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
214 query.bindValue(":boil_time", QString("%1").arg(ui->boil_timeEdit->value(), 1, 'f', 0, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215 query.bindValue(":calcboil", ui->calcboilEdit->isChecked() ? 1:0);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 query.bindValue(":top_up_kettle", QString("%1").arg(ui->top_up_kettleEdit->value(), 2, 'f', 1, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 query.bindValue(":notes", ui->notesEdit->toPlainText());
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 query.bindValue(":lauter_deadspace", QString("%1").arg(ui->lauter_deadspaceEdit->value(), 2, 'f', 1, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 query.bindValue(":kettle_volume", QString("%1").arg(ui->kettle_volumeEdit->value(), 2, 'f', 1, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220 query.bindValue(":kettle_height", QString("%1").arg(ui->kettle_heightEdit->value() / 100, 4, 'f', 3, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 query.bindValue(":mash_volume", QString("%1").arg(ui->mash_volumeEdit->value(), 2, 'f', 1, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
222 query.bindValue(":mash_max", QString("%1").arg(ui->mash_maxEdit->value(), 2, 'f', 1, '0'));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
223 query.bindValue(":efficiency", QString("%1").arg(ui->efficiencyEdit->value(), 2, 'f', 1, '0'));
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
224 query.bindValue(":chiller_type", ui->chiller_typeEdit->currentIndex());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
225 query.bindValue(":chiller_to79", QString("%1").arg(ui->chiller_to79Edit->value(), 1, 'f', 0, '0'));
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
226 query.bindValue(":chiller_volume", QString("%1").arg(ui->chiller_volumeEdit->value(), 3, 'f', 2, '0'));
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
227 query.bindValue(":chiller_lpm", QString("%1").arg(ui->chiller_lpmEdit->value(), 3, 'f', 2, '0'));
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
228 query.bindValue(":chiller_loss", QString("%1").arg(ui->chiller_lossEdit->value(), 3, 'f', 2, '0'));
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
229
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
230 if (this->recno == -1) {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
231 query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
232 } else {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
233 query.bindValue(":recno", this->recno);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235 query.exec();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 if (query.lastError().isValid()) {
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
237 qWarning() << "EditEquipment" << query.lastError();
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238 QMessageBox::warning(this, tr("Database error"),
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
239 tr("MySQL error: %1\n%2\n%3")
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 .arg(query.lastError().nativeErrorCode())
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241 .arg(query.lastError().driverText())
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
242 .arg(query.lastError().databaseText()));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243 } else {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
244 qDebug() << "EditEquipment Saved";
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
246 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
247
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248 ui->saveButton->setEnabled(false);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 this->textIsChanged = false;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250 WindowTitle();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
252
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
254 void EditEquipment::on_cloneButton_clicked()
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
255 {
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
256 QSqlQuery query;
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
257
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
258 query.prepare("INSERT INTO inventory_equipments SET name=:name, boil_size=:boil_size, "
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
259 "batch_size=:batch_size, tun_volume=:tun_volume, tun_weight=:tun_weight, "
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
260 "tun_specific_heat=:tun_specific_heat, tun_material=:tun_material, tun_height=:tun_height, "
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
261 "top_up_water=:top_up_water, trub_chiller_loss=:trub_loss, evap_rate=:evap_rate, "
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
262 "boil_time=:boil_time, calc_boil_volume=:calcboil, top_up_kettle=:top_up_kettle, "
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
263 "notes=:notes, lauter_deadspace=:lauter_deadspace, kettle_volume=:kettle_volume, "
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
264 "kettle_height=:kettle_height, mash_volume=:mash_volume, mash_max=:mash_max, "
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
265 "efficiency=:efficiency, chiller_type=:chiller_type, chiller_to79=:chiller_to79, "
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
266 "chiller_volume=:chiller_volume, chiller_lpm=:chiller_lpm, chiller_loss=:chiller_loss, uuid=:uuid");
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
267
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
268 query.bindValue(":name", ui->nameEdit->text() + " [copy]");
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
269 query.bindValue(":boil_size", QString("%1").arg(ui->boil_sizeEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
270 query.bindValue(":batch_size", QString("%1").arg(ui->batch_sizeEdit->value(), 3, 'f', 2, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
271 query.bindValue(":tun_volume", QString("%1").arg(ui->tun_volumeEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
272 query.bindValue(":tun_weight", QString("%1").arg(ui->tun_weightEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
273 query.bindValue(":tun_specific_heat", QString("%1").arg(ui->tun_specific_heatEdit->value(), 4, 'f', 3, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
274 query.bindValue(":tun_material", ui->tun_materialEdit->currentIndex());
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
275 query.bindValue(":tun_height", QString("%1").arg(ui->tun_heightEdit->value() / 100, 4, 'f', 3, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
276 query.bindValue(":top_up_water", QString("%1").arg(ui->top_up_waterEdit->value(), 2, 'f', 1, '0'));
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
277 query.bindValue(":trub_loss", QString("%1").arg(ui->trub_lossEdit->value(), 2, 'f', 1, '0'));
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
278 query.bindValue(":evap_rate", QString("%1").arg(ui->evap_rateEdit->value(), 3, 'f', 2, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
279 query.bindValue(":boil_time", QString("%1").arg(ui->boil_timeEdit->value(), 1, 'f', 0, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
280 query.bindValue(":calcboil", ui->calcboilEdit->isChecked() ? 1:0);
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
281 query.bindValue(":top_up_kettle", QString("%1").arg(ui->top_up_kettleEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
282 query.bindValue(":notes", ui->notesEdit->toPlainText());
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
283 query.bindValue(":lauter_deadspace", QString("%1").arg(ui->lauter_deadspaceEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
284 query.bindValue(":kettle_volume", QString("%1").arg(ui->kettle_volumeEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
285 query.bindValue(":kettle_height", QString("%1").arg(ui->kettle_heightEdit->value() / 100, 4, 'f', 3, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
286 query.bindValue(":mash_volume", QString("%1").arg(ui->mash_volumeEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
287 query.bindValue(":mash_max", QString("%1").arg(ui->mash_maxEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
288 query.bindValue(":efficiency", QString("%1").arg(ui->efficiencyEdit->value(), 2, 'f', 1, '0'));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
289 query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36));
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
290 query.bindValue(":chiller_type", ui->chiller_typeEdit->currentIndex());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
291 query.bindValue(":chiller_to79", QString("%1").arg(ui->chiller_to79Edit->value(), 1, 'f', 0, '0'));
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
292 query.bindValue(":chiller_volume", QString("%1").arg(ui->chiller_volumeEdit->value(), 3, 'f', 2, '0'));
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
293 query.bindValue(":chiller_lpm", QString("%1").arg(ui->chiller_lpmEdit->value(), 3, 'f', 2, '0'));
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
294 query.bindValue(":chiller_loss", QString("%1").arg(ui->chiller_lossEdit->value(), 3, 'f', 2, '0'));
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
295 query.exec();
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
296 if (query.lastError().isValid()) {
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
297 qWarning() << "EditEquipment" << query.lastError();
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
298 QMessageBox::warning(this, tr("Database error"),
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
299 tr("MySQL error: %1\n%2\n%3")
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
300 .arg(query.lastError().nativeErrorCode())
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
301 .arg(query.lastError().driverText())
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
302 .arg(query.lastError().databaseText()));
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
303 } else {
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
304 qDebug() << "EditEquipment Saved";
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
305 }
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
306 }
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
307
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
308
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 void EditEquipment::on_deleteButton_clicked()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 QSqlQuery query;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
313 int rc = QMessageBox::warning(this, tr("Delete equipment"), tr("Delete %1").arg(ui->nameEdit->text()),
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
314 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
315 if (rc == QMessageBox::No)
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
316 return;
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
317
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
318 query.prepare("DELETE FROM inventory_equipments WHERE record = :recno");
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
319 query.bindValue(":recno", this->recno);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320 query.exec();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 if (query.lastError().isValid()) {
385
09af9f46518f All profile and inventory editors now log warnings if something went wrong. Also added a Clone button. Delete now asks for confirmation.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
322 qWarning() << "EditEquipment" << query.lastError();
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 QMessageBox::warning(this, tr("Database error"),
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 tr("MySQL error: %1\n%2\n%3")
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 .arg(query.lastError().nativeErrorCode())
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 .arg(query.lastError().driverText())
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 .arg(query.lastError().databaseText()));
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 } else {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 qDebug() << "EditEquipment Deleted" << this->recno;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332 this->close();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
333 this->setResult(1);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
334 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
336
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
337 void EditEquipment::calcBatchVolume()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
338 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
339 double batch = ui->boil_sizeEdit->value() - (ui->evap_rateEdit->value() * ui->boil_timeEdit->value() / 60) + ui->top_up_kettleEdit->value();
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
340 double fermenter = round(((batch / 1.04) + ui->top_up_waterEdit->value() - ui->trub_lossEdit->value() - ui->chiller_lossEdit->value()) * 100) / 100.0;
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
341 batch = round(batch * 100) / 100.0;
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
342 if (ui->batch_sizeEdit->value() != batch)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
343 qDebug() << "Batch volue updated to" << batch;
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
344 ui->batch_sizeEdit->setValue(batch);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
345 ui->vol_fermenterEdit->setValue(fermenter);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
346 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
347
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
348
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349 void EditEquipment::is_changed()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351 calcBatchVolume();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352 ui->saveButton->setEnabled(true);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
353 ui->deleteButton->setEnabled((inuse == 0 && this->recno >= 0) ? true:false);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 this->textIsChanged = true;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 WindowTitle();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
358
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
359 void EditEquipment::material_changed()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
360 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
361 switch (ui->tun_materialEdit->currentIndex()) {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362 case 0: ui->tun_specific_heatEdit->setValue(0.11); break;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
363 case 1: ui->tun_specific_heatEdit->setValue(0.22); break;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
364 case 2: ui->tun_specific_heatEdit->setValue(0.46); break;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
365 case 3: ui->tun_specific_heatEdit->setValue(0.092); break;
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
366 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
367 is_changed();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
368 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
369
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
370
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
371 void EditEquipment::chiller_setup(int val)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
372 {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
373 if (val == CHILLER_TYPE_IMMERSION) {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
374 ui->chiller_volumeEdit->setReadOnly(false);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
375 ui->chiller_volumeEdit->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
376 ui->chiller_volumeEdit->setFixedSize(101, 24);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
377 if (ui->chiller_volumeEdit->value() == 0)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
378 ui->chiller_volumeEdit->setValue(0.5);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
379 } else {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
380 ui->chiller_volumeEdit->setReadOnly(true);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
381 ui->chiller_volumeEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
382 ui->chiller_volumeEdit->setFixedSize(86, 24);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
383 ui->chiller_volumeEdit->setValue(0);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
384 }
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
385
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
386 if (val == CHILLER_TYPE_COUNTERFLOW) {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
387 ui->chiller_to79Edit->setReadOnly(true);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
388 ui->chiller_to79Edit->setButtonSymbols(QAbstractSpinBox::NoButtons);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
389 ui->chiller_to79Edit->setFixedSize(86, 24);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
390 ui->chiller_to79Edit->setValue(0);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
391
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
392 ui->chiller_lpmEdit->setReadOnly(false);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
393 ui->chiller_lpmEdit->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
394 ui->chiller_lpmEdit->setFixedSize(101, 24);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
395 if (ui->chiller_lpmEdit->value() == 0)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
396 ui->chiller_lpmEdit->setValue(2.5);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
397
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
398 ui->chiller_lossEdit->setReadOnly(false);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
399 ui->chiller_lossEdit->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
400 ui->chiller_lossEdit->setFixedSize(101, 24);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
401 if (ui->chiller_lossEdit->value() == 0)
423
8cb46020796a Adjusted chiller_loss default value to 0.4. Disabled product fields eq_calc_boil_volume, eq_hop_utilization, eq_lauter_volume and eq_lauter_height. Added eq_chiller_type, eq_chiller_to79, eq_chiller_volume, eq_chiller_lpm, eq_chiller_loss with default values for immersion chilling. Load these values from new selected equipment. Changed edit product tab 2 to show new the new fields and removed the obsolete fields.
Michiel Broek <mbroek@mbse.eu>
parents: 419
diff changeset
402 ui->chiller_lossEdit->setValue(0.4);
419
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
403
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
404 } else {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
405 ui->chiller_to79Edit->setReadOnly(false);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
406 ui->chiller_to79Edit->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
407 ui->chiller_to79Edit->setFixedSize(101, 24);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
408 int time = 5;
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
409 if (val == CHILLER_TYPE_AUBAINMARIE)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
410 time = 20;
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
411 if (val == CHILLER_TYPE_NOCHILL)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
412 time = 240;
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
413 if (ui->chiller_to79Edit->value() == 0)
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
414 ui->chiller_to79Edit->setValue(time);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
415
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
416 ui->chiller_lpmEdit->setReadOnly(true);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
417 ui->chiller_lpmEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
418 ui->chiller_lpmEdit->setFixedSize(86, 24);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
419 ui->chiller_lpmEdit->setValue(0);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
420
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
421 ui->chiller_lossEdit->setReadOnly(true);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
422 ui->chiller_lossEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
423 ui->chiller_lossEdit->setFixedSize(86, 24);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
424 ui->chiller_lossEdit->setValue(0);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
425 }
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
426 }
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
427
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
428
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
429 void EditEquipment::chiller_changed()
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
430 {
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
431 const QSignalBlocker blocker1(ui->chiller_to79Edit);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
432 const QSignalBlocker blocker2(ui->chiller_volumeEdit);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
433 const QSignalBlocker blocker3(ui->chiller_lpmEdit);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
434 const QSignalBlocker blocker4(ui->chiller_lossEdit);
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
435
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
436 chiller_setup(ui->chiller_typeEdit->currentIndex());
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
437 is_changed();
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
438 }
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
439
d49f38cc76a0 The equipment editor uses named fields for database io. Edit field 'trub chiller loss' is now called 'trub loss', but will be renamed again. Removed editing hop_utilization, lauter_volume and lauter_height. These fields were never used in the application. Not yet removed from the database. Added chiller_type, chiller_to79, chiller_volume, chiller_lpm and chiller_loss fields so that we can tie a chiller to the equipment setup. Renamed some chiller names.
Michiel Broek <mbroek@mbse.eu>
parents: 385
diff changeset
440
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
441 void EditEquipment::on_quitButton_clicked()
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442 {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443 if (this->textIsChanged) {
60
0d65238ebedc Updated translations and some messages.
Michiel Broek <mbroek@mbse.eu>
parents: 30
diff changeset
444 int rc = QMessageBox::warning(this, tr("Equipment changed"), tr("This equipment has been modified. Save changes?"),
30
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
445 QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
446 switch (rc) {
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
447 case QMessageBox::Save:
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
448 on_saveButton_clicked();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
449 break; /* Saved and then Quit */
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
450 case QMessageBox::Discard:
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
451 break; /* Quit without Save */
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
452 case QMessageBox::Cancel:
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
453 return; /* Return to the editor page */
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
454 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
455 }
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
456
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
457 this->close();
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
458 this->setResult(1);
0fec6a1abd13 Added inventory equipment table and editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
459 }

mercurial