src/Setup.cpp

changeset 380
8f5c03ed4321
parent 344
9ffac162000c
child 411
c78f8cf11849
--- a/src/Setup.cpp	Fri Jul 29 20:59:21 2022 +0200
+++ b/src/Setup.cpp	Sat Jul 30 16:30:02 2022 +0200
@@ -53,39 +53,52 @@
 
     fwhLabel = new QLabel(topWidget);
     fwhLabel->setObjectName(QString::fromUtf8("fwhLabel"));
-    fwhLabel->setGeometry(QRect(60, 120, 131, 20));
+    fwhLabel->setGeometry(QRect(10, 120, 181, 20));
     fwhLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     fwhLabel->setText(tr("First Wort Hop factor:"));
 
     mashhopLabel = new QLabel(topWidget);
     mashhopLabel->setObjectName(QString::fromUtf8("mashhopLabel"));
-    mashhopLabel->setGeometry(QRect(60, 150, 131, 20));
+    mashhopLabel->setGeometry(QRect(10, 150, 181, 20));
     mashhopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     mashhopLabel->setText(tr("Mash Hop factor:"));
 
     pelletLabel = new QLabel(topWidget);
     pelletLabel->setObjectName(QString::fromUtf8("pelletLabel"));
-    pelletLabel->setGeometry(QRect(60, 180, 131, 20));
+    pelletLabel->setGeometry(QRect(10, 210, 181, 20));
     pelletLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
-    pelletLabel->setText(tr("Pellet Hop factor:"));
+    pelletLabel->setText(tr("Hop Pellets utilisation:"));
 
     hopplugLabel = new QLabel(topWidget);
-    hopplugLabel->setObjectName(QString::fromUtf8("hopplugLabel"));
-    hopplugLabel->setGeometry(QRect(60, 210, 131, 20));
+    hopplugLabel->setObjectName(QString::fromUtf8("plugsLabel"));
+    hopplugLabel->setGeometry(QRect(10, 240, 181, 20));
     hopplugLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
-    hopplugLabel->setText(tr("Hop Plugs factor:"));
+    hopplugLabel->setText(tr("Hop Plugs utilisation:"));
+
+    leafLabel = new QLabel(topWidget);
+    leafLabel->setObjectName(QString::fromUtf8("leafLabel"));
+    leafLabel->setGeometry(QRect(10, 270, 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(60, 240, 131, 20));
+    wethopLabel->setGeometry(QRect(10, 300, 181, 20));
     wethopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
-    wethopLabel->setText(tr("Wet Hop factor:"));
+    wethopLabel->setText(tr("Wet Hop utilisation:"));
 
     cryohopLabel = new QLabel(topWidget);
     cryohopLabel->setObjectName(QString::fromUtf8("cryohopLabel"));
-    cryohopLabel->setGeometry(QRect(60, 270, 131, 20));
+    cryohopLabel->setGeometry(QRect(10, 330, 181, 20));
     cryohopLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
-    cryohopLabel->setText(tr("Cryo Hop\302\256 factor:"));
+    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->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+    extractLabel->setText(tr("CO2 Hop Extract utilisation:"));
+
 
     fwhEdit = new QSpinBox(topWidget);
     fwhEdit->setObjectName(QString::fromUtf8("fwhEdit"));
@@ -107,45 +120,66 @@
     mashhopEdit->setToolTip(tr("The efficiency for Mash hopping."));
     mashhopEdit->setSuffix(tr("%"));
 
-    pelletEdit = new QSpinBox(topWidget);
+    pelletEdit = new QDoubleSpinBox(topWidget);
     pelletEdit->setObjectName(QString::fromUtf8("pelletEdit"));
-    pelletEdit->setGeometry(QRect(210, 180, 81, 24));
+    pelletEdit->setGeometry(QRect(210, 210, 81, 24));
     pelletEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     pelletEdit->setAccelerated(true);
-    pelletEdit->setMinimum(0);
-    pelletEdit->setMaximum(20);
-    pelletEdit->setToolTip(tr("The efficiency for hop pellets."));
+    pelletEdit->setMaximum(100);
+    pelletEdit->setDecimals(1);
+    pelletEdit->setToolTip(tr("The utilisation for hop pellets, default 22"));
     pelletEdit->setSuffix(tr("%"));
 
-    hopplugEdit = new QSpinBox(topWidget);
+    hopplugEdit = new QDoubleSpinBox(topWidget);
     hopplugEdit->setObjectName(QString::fromUtf8("hopplugEdit"));
-    hopplugEdit->setGeometry(QRect(210, 210, 81, 24));
+    hopplugEdit->setGeometry(QRect(210, 240, 81, 24));
     hopplugEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     hopplugEdit->setAccelerated(true);
-    hopplugEdit->setMaximum(20);
-    hopplugEdit->setToolTip(tr("The efficiency for hop plugs."));
+    hopplugEdit->setMaximum(100);
+    hopplugEdit->setDecimals(1);
+    hopplugEdit->setToolTip(tr("The utilisation for hop plugs, default 20.4"));
     hopplugEdit->setSuffix(tr("%"));
 
-    wethopEdit = new QSpinBox(topWidget);
+    leafEdit = new QDoubleSpinBox(topWidget);
+    leafEdit->setObjectName(QString::fromUtf8("leafEdit"));
+    leafEdit->setGeometry(QRect(210, 270, 81, 24));
+    leafEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+    leafEdit->setAccelerated(true);
+    leafEdit->setMaximum(100);
+    leafEdit->setDecimals(1);
+    leafEdit->setToolTip(tr("The utilisation for hop leafs, default 20"));
+    leafEdit->setSuffix(tr("%"));
+
+    wethopEdit = new QDoubleSpinBox(topWidget);
     wethopEdit->setObjectName(QString::fromUtf8("wethopEdit"));
-    wethopEdit->setGeometry(QRect(210, 240, 81, 24));
+    wethopEdit->setGeometry(QRect(210, 300, 81, 24));
     wethopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     wethopEdit->setAccelerated(true);
-    wethopEdit->setMinimum(-98);
-    wethopEdit->setMaximum(-20);
-    wethopEdit->setToolTip(tr("The efficiency for fresh hops."));
+    wethopEdit->setMaximum(100);
+    wethopEdit->setDecimals(1);
+    wethopEdit->setToolTip(tr("The uyilisation for fresh hops, default 3.6"));
     wethopEdit->setSuffix(tr("%"));
 
-    cryohopEdit = new QSpinBox(topWidget);
+    cryohopEdit = new QDoubleSpinBox(topWidget);
     cryohopEdit->setObjectName(QString::fromUtf8("cryohopEdit"));
-    cryohopEdit->setGeometry(QRect(210, 270, 81, 24));
+    cryohopEdit->setGeometry(QRect(210, 330, 81, 24));
     cryohopEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     cryohopEdit->setAccelerated(true);
-    cryohopEdit->setMinimum(-20);
-    cryohopEdit->setMaximum(150);
-    cryohopEdit->setToolTip(tr("The efficiency for using Cryo Hop\302\256."));
+    cryohopEdit->setMaximum(100);
+    cryohopEdit->setDecimals(1);
+    cryohopEdit->setToolTip(tr("The utilisation for using Cryo Hop\302\256, default 50"));
     cryohopEdit->setSuffix(tr("%"));
 
+    extractEdit = new QDoubleSpinBox(topWidget);
+    extractEdit->setObjectName(QString::fromUtf8("extractEdit"));
+    extractEdit->setGeometry(QRect(210, 360, 81, 24));
+    extractEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+    extractEdit->setAccelerated(true);
+    extractEdit->setMaximum(100);
+    extractEdit->setDecimals(1);
+    extractEdit->setToolTip(tr("The utilisation for using CO2 hop extract, default 35"));
+    extractEdit->setSuffix(tr("%"));
+
     grainLabel = new QLabel(topWidget);
     grainLabel->setObjectName(QString::fromUtf8("grainLabel"));
     grainLabel->setGeometry(QRect(400, 120, 161, 20));
@@ -318,16 +352,20 @@
 
     fwhEdit->setValue(query.value("factor_fwh").toInt());
     mashhopEdit->setValue(query.value("factor_mashhop").toInt());
-    pelletEdit->setValue(query.value("factor_pellet").toInt());
-    hopplugEdit->setValue(query.value("factor_plug").toInt());
-    wethopEdit->setValue(query.value("factor_wethop").toInt());
-    cryohopEdit->setValue(query.value("factor_cryohop").toInt());
+    pelletEdit->setValue(query.value("ut_pellet").toDouble());
+    hopplugEdit->setValue(query.value("ut_plug").toDouble());
+    leafEdit->setValue(query.value("ut_leaf").toDouble());
+    wethopEdit->setValue(query.value("ut_wethop").toDouble());
+    cryohopEdit->setValue(query.value("ut_t45").toDouble());
+    extractEdit->setValue(query.value("ut_co2extract").toDouble());
     connect(fwhEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
     connect(mashhopEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
-    connect(pelletEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
-    connect(hopplugEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
-    connect(wethopEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
-    connect(cryohopEdit, &QSpinBox::textChanged, this, &Setup::is_changed);
+    connect(pelletEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
+    connect(hopplugEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
+    connect(leafEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
+    connect(wethopEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
+    connect(cryohopEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
+    connect(extractEdit, &QDoubleSpinBox::textChanged, this, &Setup::is_changed);
 
     grainEdit->setValue(query.value("grain_absorbtion").toDouble());
     brixEdit->setValue(query.value("brix_correction").toDouble());
@@ -471,7 +509,8 @@
      * Update all other data
      */
     query.prepare("UPDATE profile_setup SET brewery_name=:brewery, brewery_logo=:logo, factor_mashhop=:mashhop, factor_fwh=:fwh, "
-		  "factor_pellet=:pellet, factor_plug=:plug, factor_wethop=:wet, factor_cryohop=:cryo, color_method=:color, ibu_method=:ibu, "
+		  "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_absorbtion=:grain, default_water=:water, my_yeastlab=:yeast, "
 		  "brewery_height=:height  WHERE record='1'");
     query.bindValue(":brewery", this->breweryEdit->text());
@@ -480,8 +519,10 @@
     query.bindValue(":fwh", this->fwhEdit->value());
     query.bindValue(":pellet", this->pelletEdit->value());
     query.bindValue(":plug", this->hopplugEdit->value());
+    query.bindValue(":leaf", this->leafEdit->value());
     query.bindValue(":wet", this->wethopEdit->value());
     query.bindValue(":cryo", this->cryohopEdit->value());
+    query.bindValue(":extract", this->extractEdit->value());
     query.bindValue(":color", this->colorEdit->currentIndex());
     query.bindValue(":ibu", this->ibuEdit->currentIndex());
     query.bindValue(":brix", this->brixEdit->value());

mercurial