--- a/src/Setup.cpp Sun Oct 30 16:43:22 2022 +0100 +++ b/src/Setup.cpp Fri Nov 04 14:17:56 2022 +0100 @@ -65,40 +65,69 @@ pelletLabel = new QLabel(topWidget); pelletLabel->setObjectName(QString::fromUtf8("pelletLabel")); - pelletLabel->setGeometry(QRect(10, 210, 181, 20)); + pelletLabel->setGeometry(QRect(10, 240, 181, 20)); pelletLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); pelletLabel->setText(tr("Hop Pellets utilisation:")); hopplugLabel = new QLabel(topWidget); hopplugLabel->setObjectName(QString::fromUtf8("plugsLabel")); - hopplugLabel->setGeometry(QRect(10, 240, 181, 20)); + hopplugLabel->setGeometry(QRect(10, 270, 181, 20)); hopplugLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); hopplugLabel->setText(tr("Hop Plugs utilisation:")); leafLabel = new QLabel(topWidget); leafLabel->setObjectName(QString::fromUtf8("leafLabel")); - leafLabel->setGeometry(QRect(10, 270, 181, 20)); + leafLabel->setGeometry(QRect(10, 300, 181, 20)); leafLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); leafLabel->setText(tr("Hop Leafs utilisation:")); wethopLabel = new QLabel(topWidget); wethopLabel->setObjectName(QString::fromUtf8("wethopLabel")); - wethopLabel->setGeometry(QRect(10, 300, 181, 20)); + wethopLabel->setGeometry(QRect(10, 330, 181, 20)); wethopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); wethopLabel->setText(tr("Wet Hop utilisation:")); cryohopLabel = new QLabel(topWidget); cryohopLabel->setObjectName(QString::fromUtf8("cryohopLabel")); - cryohopLabel->setGeometry(QRect(10, 330, 181, 20)); + cryohopLabel->setGeometry(QRect(10, 360, 181, 20)); cryohopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); cryohopLabel->setText(tr("Cryo Hop\302\256 utilisation:")); extractLabel = new QLabel(topWidget); extractLabel->setObjectName(QString::fromUtf8("extractLabel")); - extractLabel->setGeometry(QRect(10, 360, 181, 20)); + extractLabel->setGeometry(QRect(10, 390, 181, 20)); extractLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); extractLabel->setText(tr("CO2 Hop Extract utilisation:")); + hapelletLabel = new QLabel(topWidget); + hapelletLabel->setObjectName(QString::fromUtf8("hapelletLabel")); + hapelletLabel->setGeometry(QRect(380, 240, 181, 20)); + hapelletLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + hapelletLabel->setText(tr("Hop Pellets water absorption:")); + + hahopplugLabel = new QLabel(topWidget); + hahopplugLabel->setObjectName(QString::fromUtf8("haplugsLabel")); + hahopplugLabel->setGeometry(QRect(380, 270, 181, 20)); + hahopplugLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + hahopplugLabel->setText(tr("Hop Plugs water absorption:")); + + haleafLabel = new QLabel(topWidget); + haleafLabel->setObjectName(QString::fromUtf8("haleafLabel")); + haleafLabel->setGeometry(QRect(380, 300, 181, 20)); + haleafLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + haleafLabel->setText(tr("Hop Leafs water absorption:")); + + hawethopLabel = new QLabel(topWidget); + hawethopLabel->setObjectName(QString::fromUtf8("hawethopLabel")); + hawethopLabel->setGeometry(QRect(380, 330, 181, 20)); + hawethopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + hawethopLabel->setText(tr("Wet Hop water absorption:")); + + hacryohopLabel = new QLabel(topWidget); + hacryohopLabel->setObjectName(QString::fromUtf8("hacryohopLabel")); + hacryohopLabel->setGeometry(QRect(380, 360, 181, 20)); + hacryohopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + hacryohopLabel->setText(tr("Cryo Hop\302\256 water absorption:")); fwhEdit = new QSpinBox(topWidget); fwhEdit->setObjectName(QString::fromUtf8("fwhEdit")); @@ -122,7 +151,7 @@ pelletEdit = new QDoubleSpinBox(topWidget); pelletEdit->setObjectName(QString::fromUtf8("pelletEdit")); - pelletEdit->setGeometry(QRect(210, 210, 81, 24)); + pelletEdit->setGeometry(QRect(210, 240, 81, 24)); pelletEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); pelletEdit->setAccelerated(true); pelletEdit->setMaximum(100); @@ -132,7 +161,7 @@ hopplugEdit = new QDoubleSpinBox(topWidget); hopplugEdit->setObjectName(QString::fromUtf8("hopplugEdit")); - hopplugEdit->setGeometry(QRect(210, 240, 81, 24)); + hopplugEdit->setGeometry(QRect(210, 270, 81, 24)); hopplugEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); hopplugEdit->setAccelerated(true); hopplugEdit->setMaximum(100); @@ -142,7 +171,7 @@ leafEdit = new QDoubleSpinBox(topWidget); leafEdit->setObjectName(QString::fromUtf8("leafEdit")); - leafEdit->setGeometry(QRect(210, 270, 81, 24)); + leafEdit->setGeometry(QRect(210, 300, 81, 24)); leafEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); leafEdit->setAccelerated(true); leafEdit->setMaximum(100); @@ -152,17 +181,17 @@ wethopEdit = new QDoubleSpinBox(topWidget); wethopEdit->setObjectName(QString::fromUtf8("wethopEdit")); - wethopEdit->setGeometry(QRect(210, 300, 81, 24)); + wethopEdit->setGeometry(QRect(210, 330, 81, 24)); wethopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); wethopEdit->setAccelerated(true); wethopEdit->setMaximum(100); wethopEdit->setDecimals(1); - wethopEdit->setToolTip(tr("The uyilisation for fresh hops, default 3.6")); + wethopEdit->setToolTip(tr("The utilisation for fresh hops, default 3.6")); wethopEdit->setSuffix(tr("%")); cryohopEdit = new QDoubleSpinBox(topWidget); cryohopEdit->setObjectName(QString::fromUtf8("cryohopEdit")); - cryohopEdit->setGeometry(QRect(210, 330, 81, 24)); + cryohopEdit->setGeometry(QRect(210, 360, 81, 24)); cryohopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); cryohopEdit->setAccelerated(true); cryohopEdit->setMaximum(100); @@ -172,7 +201,7 @@ extractEdit = new QDoubleSpinBox(topWidget); extractEdit->setObjectName(QString::fromUtf8("extractEdit")); - extractEdit->setGeometry(QRect(210, 360, 81, 24)); + extractEdit->setGeometry(QRect(210, 390, 81, 24)); extractEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); extractEdit->setAccelerated(true); extractEdit->setMaximum(100); @@ -270,6 +299,61 @@ heightEdit->setValue(0); heightEdit->setToolTip(tr("Height in meters above/below sealevel to calculate the exact boiling point and hop isomerizon.")); + hapelletEdit = new QDoubleSpinBox(topWidget); + hapelletEdit->setObjectName(QString::fromUtf8("hapelletEdit")); + hapelletEdit->setGeometry(QRect(580, 240, 101, 24)); + hapelletEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + hapelletEdit->setAccelerated(true); + hapelletEdit->setSingleStep(0.010000000000000); + hapelletEdit->setMaximum(20); + hapelletEdit->setDecimals(2); + hapelletEdit->setToolTip(tr("The water absorption by hop pellets, default 2.67")); + hapelletEdit->setSuffix(tr(" ml/gr")); + + hahopplugEdit = new QDoubleSpinBox(topWidget); + hahopplugEdit->setObjectName(QString::fromUtf8("hahopplugEdit")); + hahopplugEdit->setGeometry(QRect(580, 270, 101, 24)); + hahopplugEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + hahopplugEdit->setAccelerated(true); + hahopplugEdit->setSingleStep(0.010000000000000); + hahopplugEdit->setMaximum(20); + hahopplugEdit->setDecimals(2); + hahopplugEdit->setToolTip(tr("The water absorption by hop plugs, default 2.67")); + hahopplugEdit->setSuffix(tr(" ml/gr")); + + haleafEdit = new QDoubleSpinBox(topWidget); + haleafEdit->setObjectName(QString::fromUtf8("haleafEdit")); + haleafEdit->setGeometry(QRect(580, 300, 101, 24)); + haleafEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + haleafEdit->setAccelerated(true); + haleafEdit->setSingleStep(0.010000000000000); + haleafEdit->setMaximum(20); + haleafEdit->setDecimals(2); + haleafEdit->setToolTip(tr("The water absorption by hop leafs, default 6.01")); + haleafEdit->setSuffix(tr(" ml/gr")); + + hawethopEdit = new QDoubleSpinBox(topWidget); + hawethopEdit->setObjectName(QString::fromUtf8("hawethopEdit")); + hawethopEdit->setGeometry(QRect(580, 330, 101, 24)); + hawethopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + hawethopEdit->setAccelerated(true); + hawethopEdit->setSingleStep(0.010000000000000); + hawethopEdit->setMaximum(20); + hawethopEdit->setDecimals(2); + hawethopEdit->setToolTip(tr("The water absorption by fresh hops, default 1.21")); + hawethopEdit->setSuffix(tr(" ml/gr")); + + hacryohopEdit = new QDoubleSpinBox(topWidget); + hacryohopEdit->setObjectName(QString::fromUtf8("hacryohopEdit")); + hacryohopEdit->setGeometry(QRect(580, 360, 101, 24)); + hacryohopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); + hacryohopEdit->setAccelerated(true); + hacryohopEdit->setSingleStep(0.010000000000000); + hacryohopEdit->setMaximum(20); + hacryohopEdit->setDecimals(2); + hacryohopEdit->setToolTip(tr("The water absorption by Cryo Hop\302\256, default 2.67")); + hacryohopEdit->setSuffix(tr(" ml/gr")); + colorEdit = new QComboBox(topWidget); colorEdit->setObjectName(QString::fromUtf8("colorEdit")); colorEdit->setGeometry(QRect(940, 120, 161, 23)); @@ -370,9 +454,19 @@ grainEdit->setValue(query.value("grain_absorption").toDouble()); brixEdit->setValue(query.value("brix_correction").toDouble()); heightEdit->setValue(query.value("brewery_height").toInt()); + hapelletEdit->setValue(query.value("ha_pellet").toDouble()); + hahopplugEdit->setValue(query.value("ha_plug").toDouble()); + haleafEdit->setValue(query.value("ha_leaf").toDouble()); + hawethopEdit->setValue(query.value("ha_wethop").toDouble()); + hacryohopEdit->setValue(query.value("ha_t45").toDouble()); connect(grainEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed); connect(brixEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed); connect(heightEdit, &QSpinBox::textChanged, this, &Setup::is_changed); + connect(hapelletEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed); + connect(hahopplugEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed); + connect(haleafEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed); + connect(hawethopEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed); + connect(hacryohopEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed); colorEdit->addItem("Morey"); colorEdit->addItem("Mosher"); @@ -512,7 +606,9 @@ "ut_pellet=:pellet, ut_plug=:plug, ut_leaf=:leaf, ut_wethop=:wet, ut_t45=:cryo, ut_co2extract=:extract, " "color_method=:color, ibu_method=:ibu, " "brix_correction=:brix, grain_absorption=:grain, default_water=:water, my_yeastlab=:yeast, " - "brewery_height=:height WHERE record='1'"); + "brewery_height=:height, " + "ha_pellet=:hapellet, ha_plug=:haplug, ha_leaf=:haleaf, ha_wethop=:hawet, ha_t45=:hacryo " + "WHERE record='1'"); query.bindValue(":brewery", this->breweryEdit->text()); query.bindValue(":logo", logoByteArray); query.bindValue(":mashhop", this->mashhopEdit->value()); @@ -530,6 +626,11 @@ query.bindValue(":water", record); query.bindValue(":yeast", this->yeastEdit->currentText()); query.bindValue(":height", this->heightEdit->value()); + query.bindValue(":hapellet", this->hapelletEdit->value()); + query.bindValue(":haplug", this->hahopplugEdit->value()); + query.bindValue(":haleaf", this->haleafEdit->value()); + query.bindValue(":hawet", this->hawethopEdit->value()); + query.bindValue(":hacryo", this->hacryohopEdit->value()); query.exec(); if (query.lastError().isValid()) { qDebug() << "Setup Save error:" << query.lastError();