# HG changeset patch # User Michiel Broek # Date 1652649015 -7200 # Node ID b45bd6da52207e147ec7c52b56050ecdbe4f1889 # Parent 19c50b1f58d3efbd9ffd717de63439797a3676ec Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional. diff -r 19c50b1f58d3 -r b45bd6da5220 src/EditProduct.cpp --- a/src/EditProduct.cpp Sun May 15 20:57:03 2022 +0200 +++ b/src/EditProduct.cpp Sun May 15 23:10:15 2022 +0200 @@ -1094,6 +1094,18 @@ connect(ui->brew_aboilphEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilph_changed); connect(ui->brew_aboilsgEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilsg_changed); connect(ui->brew_aboilvolEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aboilvol_changed); + connect(ui->brew_coolwithEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditProduct::brew_cooling_method_changed); + connect(ui->brew_cooltoEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_cooling_to_changed); + connect(ui->brew_cooltimeEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_cooling_time_changed); + connect(ui->brew_whirlpool9Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool9_changed); + connect(ui->brew_whirlpool7Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool7_changed); + connect(ui->brew_whirlpool6Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool6_changed); + connect(ui->brew_whirlpool2Edit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_whirlpool2_changed); + connect(ui->brew_aerwithEdit, QOverload::of(&QComboBox::currentIndexChanged), this, &EditProduct::brew_aerwith_changed); + connect(ui->brew_aerspeedEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aerspeed_changed); + connect(ui->brew_aertimeEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_aertime_changed); + connect(ui->brew_trublossEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_trubloss_changed); + connect(ui->brew_topupwaterEdit, QOverload::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::brew_topupwater_changed); setStage(); diff -r 19c50b1f58d3 -r b45bd6da5220 src/EditProduct.h --- a/src/EditProduct.h Sun May 15 20:57:03 2022 +0200 +++ b/src/EditProduct.h Sun May 15 23:10:15 2022 +0200 @@ -154,6 +154,18 @@ void brew_aboilph_changed(double val); void brew_aboilsg_changed(double val); void brew_aboilvol_changed(double val); + void brew_cooling_method_changed(int val); + void brew_cooling_to_changed(double val); + void brew_cooling_time_changed(double val); + void brew_whirlpool9_changed(double val); + void brew_whirlpool7_changed(double val); + void brew_whirlpool6_changed(double val); + void brew_whirlpool2_changed(double val); + void brew_aerwith_changed(int val); + void brew_aerspeed_changed(double val); + void brew_aertime_changed(double val); + void brew_trubloss_changed(double val); + void brew_topupwater_changed(double val); /* Modified progress bars */ void ferment_perc_mash_valueChanged(int value); diff -r 19c50b1f58d3 -r b45bd6da5220 src/EditProductTab1.cpp --- a/src/EditProductTab1.cpp Sun May 15 20:57:03 2022 +0200 +++ b/src/EditProductTab1.cpp Sun May 15 23:10:15 2022 +0200 @@ -315,16 +315,35 @@ ui->brew_startButton2->show(); ui->brew_startDate->setReadOnly(false); ui->brew_startLabel2->show(); - ui->brew_endLabel->show(); - ui->brew_endLabel2->show(); - ui->brew_endButton1->show(); - ui->brew_startTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows); - ui->brew_startTime->show(); - ui->brew_endDate->setButtonSymbols(QAbstractSpinBox::UpDownArrows); - ui->brew_endDate->show(); - ui->brew_endDate->setReadOnly(false); - ui->brew_endTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows); - ui->brew_endTime->show(); + + /* + * Enable brew_end settings if it is the right date or later. + * If some essential values are filled in. + */ + int brewTime = product->brew_date_start.date().daysTo(QDate::currentDate()); + + if ((brewTime >= 0) && (product->brew_cooling_method > 0) && (product->brew_cooling_time > 0) && + (product->brew_aboil_sg > 1.002) && (product->brew_aboil_volume > 0)) { + ui->brew_endLabel->show(); + ui->brew_startLabel2->show(); + ui->brew_endLabel2->show(); + ui->brew_endButton1->show(); + ui->brew_startTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows); + ui->brew_startTime->show(); + ui->brew_endDate->setButtonSymbols(QAbstractSpinBox::UpDownArrows); + ui->brew_endDate->show(); + ui->brew_endDate->setReadOnly(false); + ui->brew_endTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows); + ui->brew_endTime->show(); + } else { + ui->brew_endButton1->hide(); + ui->brew_startLabel2->hide(); + ui->brew_endLabel->hide(); + ui->brew_endLabel2->hide(); + ui->brew_startTime->hide(); + ui->brew_endDate->hide(); + ui->brew_endTime->hide(); + } } else { ui->brew_startButton1->hide(); ui->brew_startButton2->hide(); diff -r 19c50b1f58d3 -r b45bd6da5220 src/EditProductTab9.cpp --- a/src/EditProductTab9.cpp Sun May 15 20:57:03 2022 +0200 +++ b/src/EditProductTab9.cpp Sun May 15 23:10:15 2022 +0200 @@ -252,3 +252,90 @@ } +void EditProduct::brew_cooling_method_changed(int val) +{ + product->brew_cooling_method = val; + is_changed(); +} + + +void EditProduct::brew_cooling_to_changed(double val) +{ + product->brew_cooling_to = val; + is_changed(); +} + + +void EditProduct::brew_cooling_time_changed(double val) +{ + product->brew_cooling_time = val; + is_changed(); +} + + +void EditProduct::brew_whirlpool9_changed(double val) +{ + product->brew_whirlpool9 = val; + is_changed(); +} + + +void EditProduct::brew_whirlpool7_changed(double val) +{ + product->brew_whirlpool7 = val; + is_changed(); +} + + +void EditProduct::brew_whirlpool6_changed(double val) +{ + product->brew_whirlpool6 = val; + is_changed(); +} + + +void EditProduct::brew_whirlpool2_changed(double val) +{ + product->brew_whirlpool2 = val; + is_changed(); +} + + +void EditProduct::brew_aerwith_changed(int val) +{ + product->brew_aeration_type = val; + is_changed(); +} + + +void EditProduct::brew_aerspeed_changed(double val) +{ + product->brew_aeration_speed = val; + is_changed(); +} + + +void EditProduct::brew_aertime_changed(double val) +{ + product->brew_aeration_time = val; + is_changed(); +} + + +void EditProduct::brew_trubloss_changed(double val) +{ + product->brew_fermenter_tcloss = val; + is_changed(); + calcFermentables(); // This will also recalculate all volumes. + calcIBUs(); +} + + +void EditProduct::brew_topupwater_changed(double val) +{ + product->brew_fermenter_extrawater = val; + is_changed(); + calcFermentables(); // This will also recalculate all volumes. + calcIBUs(); +} + diff -r 19c50b1f58d3 -r b45bd6da5220 ui/EditProduct.ui --- a/ui/EditProduct.ui Sun May 15 20:57:03 2022 +0200 +++ b/ui/EditProduct.ui Sun May 15 23:10:15 2022 +0200 @@ -7077,7 +7077,7 @@ 100000.000000000000000 - 1.000000000000000 + 0.100000000000000 @@ -7105,7 +7105,7 @@ 100000.000000000000000 - 1.000000000000000 + 0.100000000000000