src/EditHop.cpp

Fri, 29 Jul 2022 17:12:02 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 29 Jul 2022 17:12:02 +0200
changeset 377
5c1f81c75bc4
parent 375
c21567bfd703
child 380
8f5c03ed4321
permissions
-rw-r--r--

Added hop clone

24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * EditHop.cpp is part of bmsapp.
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * bmsapp is free software: you can redistribute it and/or modify
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * the Free Software Foundation, either version 3 of the License, or
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 * (at your option) any later version.
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 *
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * bmsapp is distributed in the hope that it will be useful,
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * GNU General Public License for more details.
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 *
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 */
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 #include "EditHop.h"
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 #include "../ui/ui_EditHop.h"
90
2396457a8167 Moved functions from bmsapp.cpp to MainWindow.cpp
Michiel Broek <mbroek@mbse.eu>
parents: 60
diff changeset
19 #include "MainWindow.h"
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
20 #include "global.h"
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 EditHop::EditHop(int id, QWidget *parent) : QDialog(parent), ui(new Ui::EditHop)
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 QSqlQuery query;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 qDebug() << "EditHop record:" << id;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 ui->setupUi(this);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 this->recno = id;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
31 for (int i = 0; i < 3; i++)
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
32 ui->typeEdit->addItem(QCoreApplication::translate("HopTypes", g_hop_types[i]));
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
33 for (int i = 0; i < 7; i++)
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
34 ui->formEdit->addItem(QCoreApplication::translate("HopForm", g_hop_forms[i]));
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 if (id >= 0) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 query.prepare("SELECT * FROM inventory_hops WHERE record = :recno");
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 query.bindValue(":recno", id);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 query.exec();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 query.next();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
42 ui->nameEdit->setText(query.value("name").toString());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
43 ui->alphaEdit->setValue(query.value("alpha").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
44 ui->betaEdit->setValue(query.value("beta").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
45 ui->humuleneEdit->setValue(query.value("humulene").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
46 ui->caryEdit->setValue(query.value("caryophyllene").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
47 ui->cohumuloneEdit->setValue(query.value("cohumulone").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
48 ui->myrceneEdit->setValue(query.value("myrcene").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
49 ui->hsiEdit->setValue(query.value("hsi").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
50 ui->typeEdit->setCurrentIndex(query.value("type").toInt());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
51 ui->formEdit->setCurrentIndex(query.value("form").toInt());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
52 ui->notesEdit->setPlainText(query.value("notes").toString());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
53 ui->originEdit->setText(query.value("origin").toString());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
54 ui->substitutesEdit->setText(query.value("substitutes").toString());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
55 ui->alwaysEdit->setChecked(query.value("always_on_stock").toInt() ? true:false);
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
56 ui->inventoryEdit->setValue(query.value("inventory").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
57 ui->costEdit->setValue(query.value("cost").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
58 ui->valueEdit->setValue(query.value("inventory").toDouble() * query.value("cost").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
59 if (query.value("production_date").toString().length() == 10) {
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
60 ui->prodEdit->setDate(query.value("production_date").toDate());
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 } else {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 ui->prodEdit->clear();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 }
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
64 if (query.value("tht_date").toString().length() == 10) {
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
65 ui->thtEdit->setDate(query.value("tht_date").toDate());
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 } else {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 ui->thtEdit->clear();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 }
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
69 ui->oilEdit->setValue(query.value("total_oil").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
70 ui->utilisationEdit->setValue(query.value("utilisation").toDouble());
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
71 ui->bufactorEdit->setValue(query.value("bu_factor").toDouble());
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 } else {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 /* Set some defaults */
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 ui->typeEdit->setCurrentIndex(0);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 ui->formEdit->setCurrentIndex(0);
375
c21567bfd703 Final set the default utilisation to 20. Selecting another hop in a product now sets the new utilisation and bu_factor too. Removed experimental CO2 extract calculation and let it handle by the Tinseth formula. The Tinseth formula uses the Utilisation value in the final calculation. Moved the ISO extract formula for extract at bottling to the main toIBU function.
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
76 ui->utilisationEdit->setValue(20.0);
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
77 ui->bufactorEdit->setValue(1.0);
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 ui->prodEdit->clear();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 ui->thtEdit->clear();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 connect(ui->alphaEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 connect(ui->betaEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 connect(ui->humuleneEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 connect(ui->caryEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 connect(ui->cohumuloneEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 connect(ui->myrceneEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 connect(ui->hsiEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 connect(ui->typeEdit, &QComboBox::currentTextChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 connect(ui->formEdit, &QComboBox::currentTextChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(is_changed()));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 connect(ui->originEdit, &QLineEdit::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 connect(ui->substitutesEdit, &QLineEdit::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 connect(ui->alwaysEdit, &QCheckBox::stateChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 connect(ui->inventoryEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 connect(ui->costEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 connect(ui->prodEdit, &QDateEdit::dateChanged, this, &EditHop::is_changed);
292
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
98 connect(ui->prodButton1, SIGNAL(clicked()), this, SLOT(prod_date_today()));
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
99 connect(ui->prodButton2, SIGNAL(clicked()), this, SLOT(prod_date_clear()));
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 connect(ui->thtEdit, &QDateEdit::dateChanged, this, &EditHop::is_changed);
292
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
101 connect(ui->thtButton1, SIGNAL(clicked()), this, SLOT(tht_date_today()));
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
102 connect(ui->thtButton2, SIGNAL(clicked()), this, SLOT(tht_date_clear()));
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 connect(ui->oilEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
104 connect(ui->utilisationEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
105 connect(ui->bufactorEdit, &QDoubleSpinBox::textChanged, this, &EditHop::is_changed);
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 ui->saveButton->setEnabled(false);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 ui->deleteButton->setEnabled((ui->inventoryEdit->value() == 0 && id >= 0) ? true:false);
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
109
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
110 WindowTitle();
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 EditHop::~EditHop()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 qDebug() << "EditHop done";
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 delete ui;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 emit entry_changed();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 /*
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 * Window header, mark any change with '**'
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 */
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 void EditHop::WindowTitle()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 QString txt;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 if (this->recno < 0) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 txt = QString(tr("BMSapp - Add new hop"));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 } else {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 txt = QString(tr("BMSapp - Edit hop %1").arg(this->recno));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 if (this->textIsChanged) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 txt.append((QString(" **")));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 setWindowTitle(txt);
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
139
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
140 if (ui->formEdit->currentIndex() < HOP_FORMS_CO2EXTRACT) {
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
141 ui->inventoryEdit->setSuffix(tr(" Kg"));
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
142 } else {
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
143 ui->inventoryEdit->setSuffix(tr(" L"));
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
144 }
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 void EditHop::on_saveButton_clicked()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 QSqlQuery query;
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
151 QString sql = "";
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 /* If there are errors in the form, show a message and do "return;" */
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 if (ui->nameEdit->text().length() < 2) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 QMessageBox::warning(this, tr("Edit Hop"), tr("Name empty or too short."));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 return;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 if (ui->originEdit->text().length() < 2) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 QMessageBox::warning(this, tr("Edit Hop"), tr("Origin empty or too short."));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 return;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 if (this->textIsChanged) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 if (this->recno == -1) {
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
165 sql = "INSERT INTO inventory_hops SET ";
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
166 } else {
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
167 sql = "UPDATE inventory_hops SET ";
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
168 }
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
169 sql.append("name=:name, alpha=:alpha, beta=:beta, "
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 "humulene=:humulene, caryophyllene=:cary, cohumulone=:cohumulone, myrcene=:myrcene, "
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 "hsi=:hsi, type=:type, form=:form, notes=:notes, origin=:origin, substitutes=:substitutes, "
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172 "always_on_stock=:always, inventory=:inventory, cost=:cost, production_date=:prod, "
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
173 "tht_date=:tht, total_oil=:oil, utilisation=:utilisation, bu_factor=:bu_factor");
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
174 if (this->recno == -1) {
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
175 sql.append(", uuid=:uuid");
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
176 } else {
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
177 sql.append(" WHERE record = :recno");
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 }
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
179
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
180 query.prepare(sql);
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
181 query.bindValue(":name", ui->nameEdit->text());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 query.bindValue(":alpha", QString("%1").arg(ui->alphaEdit->value(), 2, 'f', 1, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
183 query.bindValue(":beta", QString("%1").arg(ui->betaEdit->value(), 2, 'f', 1, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
184 query.bindValue(":humulene", QString("%1").arg(ui->humuleneEdit->value(), 2, 'f', 1, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
185 query.bindValue(":cary", QString("%1").arg(ui->caryEdit->value(), 2, 'f', 1, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186 query.bindValue(":cohumulone", QString("%1").arg(ui->cohumuloneEdit->value(), 2, 'f', 1, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
187 query.bindValue(":myrcene", QString("%1").arg(ui->myrceneEdit->value(), 2, 'f', 1, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
188 query.bindValue(":hsi", QString("%1").arg(ui->hsiEdit->value(), 2, 'f', 1, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
189 query.bindValue(":type", ui->typeEdit->currentIndex());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
190 query.bindValue(":form", ui->formEdit->currentIndex());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
191 query.bindValue(":notes", ui->notesEdit->toPlainText());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 query.bindValue(":origin", ui->originEdit->text());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
193 query.bindValue(":substitutes", ui->substitutesEdit->text());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 query.bindValue(":always", ui->alwaysEdit->isChecked() ? 1:0);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
195 query.bindValue(":inventory", QString("%1").arg(ui->inventoryEdit->value(), 5, 'f', 4, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196 query.bindValue(":cost", QString("%1").arg(ui->costEdit->value(), 3, 'f', 2, '0'));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 /* Uses https://www.qtcentre.org/threads/17295-How-to-put-empty-value-in-QDateEdit */
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
198 query.bindValue(":prod", ui->prodEdit->nullDate());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
199 query.bindValue(":tht", ui->thtEdit->nullDate());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 query.bindValue(":oil", QString("%1").arg(ui->oilEdit->value(), 2, 'f', 1, '0'));
373
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
201 query.bindValue(":utilisation", QString("%1").arg(ui->utilisationEdit->value(), 2, 'f', 1, '0'));
b02aca4e926c First load of changes for hops. In EditHop load the dropdown buttons from the global table. Use named query fields. Added database utilisation and bu_factor fields for hop extracts. Added edit fields for these new fields. Added post boil SG, utilisation and bu_factor parameters to the toIBU function. Added hops form parameter to the hopFlavourContribution and hopAromaContribution display bars. In the hops inventory list dispay volumes instead of weight for hop extracts. Modified the TinsethIBU function to use utilisation and bu_factor parameters. Add calculations for co2 and iso hop extracts, this is work in progress. The toIBU function makes use of the preSG and postSG values to use the correct SG to caall the TinsethIBU function. This results in a bit lower IBU values mostly affecting the late additions. Added use hop at bottling for iso hop extracts like Tetra hops using the formula from BarthHaas.
Michiel Broek <mbroek@mbse.eu>
parents: 300
diff changeset
202 query.bindValue(":bu_factor", QString("%1").arg(ui->bufactorEdit->value(), 2, 'f', 1, '0'));
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 if (this->recno == -1) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204 query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 } else {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 query.bindValue(":recno", this->recno);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 query.exec();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209 if (query.lastError().isValid()) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 qDebug() << "EditHop" << query.lastError();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211 QMessageBox::warning(this, tr("Database error"),
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
212 tr("MySQL error: %1\n%2\n%3")
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
213 .arg(query.lastError().nativeErrorCode())
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
214 .arg(query.lastError().driverText())
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215 .arg(query.lastError().databaseText()));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 } else {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 qDebug() << "EditHop Saved";
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 ui->saveButton->setEnabled(false);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
222 this->textIsChanged = false;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
223 WindowTitle();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
224 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
226
377
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
227 void EditHop::on_cloneButton_clicked()
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
228 {
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
229 QSqlQuery query;
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
230
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
231 QString sql = "INSERT INTO inventory_hops SET name=:name, alpha=:alpha, beta=:beta, "
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
232 "humulene=:humulene, caryophyllene=:cary, cohumulone=:cohumulone, myrcene=:myrcene, "
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
233 "hsi=:hsi, type=:type, form=:form, notes=:notes, origin=:origin, substitutes=:substitutes, "
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
234 "always_on_stock=:always, inventory=:inventory, cost=:cost, production_date=:prod, "
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
235 "tht_date=:tht, total_oil=:oil, utilisation=:utilisation, bu_factor=:bu_factor, uuid=:uuid";
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
236
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
237 query.prepare(sql);
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
238 query.bindValue(":name", ui->nameEdit->text() + " [copy]");
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
239 query.bindValue(":alpha", QString("%1").arg(ui->alphaEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
240 query.bindValue(":beta", QString("%1").arg(ui->betaEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
241 query.bindValue(":humulene", QString("%1").arg(ui->humuleneEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
242 query.bindValue(":cary", QString("%1").arg(ui->caryEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
243 query.bindValue(":cohumulone", QString("%1").arg(ui->cohumuloneEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
244 query.bindValue(":myrcene", QString("%1").arg(ui->myrceneEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
245 query.bindValue(":hsi", QString("%1").arg(ui->hsiEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
246 query.bindValue(":type", ui->typeEdit->currentIndex());
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
247 query.bindValue(":form", ui->formEdit->currentIndex());
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
248 query.bindValue(":notes", ui->notesEdit->toPlainText());
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
249 query.bindValue(":origin", ui->originEdit->text());
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
250 query.bindValue(":substitutes", ui->substitutesEdit->text());
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
251 query.bindValue(":always", ui->alwaysEdit->isChecked() ? 1:0);
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
252 query.bindValue(":inventory", QString("%1").arg(0, 5, 'f', 4, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
253 query.bindValue(":cost", QString("%1").arg(ui->costEdit->value(), 3, 'f', 2, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
254 /* Uses https://www.qtcentre.org/threads/17295-How-to-put-empty-value-in-QDateEdit */
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
255 query.bindValue(":prod", QDate());
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
256 query.bindValue(":tht", QDate());
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
257 query.bindValue(":oil", QString("%1").arg(ui->oilEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
258 query.bindValue(":utilisation", QString("%1").arg(ui->utilisationEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
259 query.bindValue(":bu_factor", QString("%1").arg(ui->bufactorEdit->value(), 2, 'f', 1, '0'));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
260 query.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
261 query.exec();
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
262 if (query.lastError().isValid()) {
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
263 qDebug() << "EditHop" << query.lastError();
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
264 QMessageBox::warning(this, tr("Database error"),
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
265 tr("MySQL error: %1\n%2\n%3")
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
266 .arg(query.lastError().nativeErrorCode())
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
267 .arg(query.lastError().driverText())
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
268 .arg(query.lastError().databaseText()));
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
269 } else {
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
270 qDebug() << "EditHop Saved";
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
271 }
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
272
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
273 }
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
274
5c1f81c75bc4 Added hop clone
Michiel Broek <mbroek@mbse.eu>
parents: 375
diff changeset
275
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
276 void EditHop::on_deleteButton_clicked()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
278 QSqlQuery query;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
279
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
280 query.prepare("DELETE FROM inventory_hops WHERE record = :recno");
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
281 query.bindValue(":recno", this->recno);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
282 query.exec();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 if (query.lastError().isValid()) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 qDebug() << "EditHop" << query.lastError();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 QMessageBox::warning(this, tr("Database error"),
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 tr("MySQL error: %1\n%2\n%3")
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 .arg(query.lastError().nativeErrorCode())
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288 .arg(query.lastError().driverText())
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 .arg(query.lastError().databaseText()));
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 } else {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
291 qDebug() << "EditHop Deleted" << this->recno;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
292 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
293
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
294 this->close();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
295 this->setResult(1);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
296 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 void EditHop::is_changed()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 ui->valueEdit->setValue(ui->inventoryEdit->value() * ui->costEdit->value());
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
302 ui->saveButton->setEnabled(true);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 ui->deleteButton->setEnabled((ui->inventoryEdit->value() == 0 && this->recno >= 0) ? true:false);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304 this->textIsChanged = true;
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
305 WindowTitle();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
306 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
308
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 void EditHop::on_quitButton_clicked()
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 if (this->textIsChanged) {
60
0d65238ebedc Updated translations and some messages.
Michiel Broek <mbroek@mbse.eu>
parents: 24
diff changeset
312 int rc = QMessageBox::warning(this, tr("Hop changed"), tr("This hop has been modified. Save changes?"),
24
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
313 QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
314 switch (rc) {
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315 case QMessageBox::Save:
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
316 on_saveButton_clicked();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
317 break; /* Saved and then Quit */
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
318 case QMessageBox::Discard:
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
319 break; /* Quit without Save */
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320 case QMessageBox::Cancel:
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 return; /* Return to the editor page */
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 }
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 this->close();
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 this->setResult(1);
684c6e74cc1b Added hops editor.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 }
292
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
328
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
329
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
330 void EditHop::prod_date_clear()
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
331 {
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
332 ui->prodEdit->setDate(QDate());
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
333 is_changed();
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
334 }
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
335
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
336
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
337 void EditHop::prod_date_today()
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
338 {
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
339 ui->prodEdit->setDate(QDate::currentDate());
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
340 is_changed();
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
341 }
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
342
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
343
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
344 void EditHop::tht_date_clear()
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
345 {
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
346 ui->thtEdit->setDate(QDate());
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
347 is_changed();
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
348 }
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
349
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
350
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
351 void EditHop::tht_date_today()
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
352 {
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
353 ui->thtEdit->setDate(QDate::currentDate());
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
354 is_changed();
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
355 }
b6ec2e275736 Fixed missing settings from the Miscs and Hops editors.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
356

mercurial