From e7aeee0cbe4676cf2ad8e4d41fdceeb95b626a70 Mon Sep 17 00:00:00 2001 From: MedicMomcilo Date: Thu, 19 Oct 2023 12:34:06 +0200 Subject: [PATCH 1/4] Changed used event for slider to support updates when using keyboard. --- src/MashDesigner.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/MashDesigner.cpp b/src/MashDesigner.cpp index b33981692..81c59a8ba 100644 --- a/src/MashDesigner.cpp +++ b/src/MashDesigner.cpp @@ -48,20 +48,20 @@ MashDesigner::MashDesigner(QWidget * parent) : QDialog {parent}, this->label_zeroWort->setText(Measurement::displayAmount(Measurement::Amount{0, Measurement::Units::liters})); // Update temp slider when we move amount slider. - connect(horizontalSlider_amount, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateTempSlider); + connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateTempSlider); // Update amount slider when we move temp slider. - connect(horizontalSlider_temp, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateAmtSlider); + connect(horizontalSlider_temp, &QAbstractSlider::valueChanged, this, &MashDesigner::updateAmtSlider); // Update tun fullness bar when either slider moves. - connect(horizontalSlider_amount, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateFullness); - connect(horizontalSlider_temp, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateFullness); + connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateFullness); + connect(horizontalSlider_temp, &QAbstractSlider::valueChanged, this, &MashDesigner::updateFullness); // Update amount/temp text when sliders move. - connect(horizontalSlider_amount, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateAmt); - connect(horizontalSlider_amount, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateTemp); - connect(horizontalSlider_temp, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateAmt); - connect(horizontalSlider_temp, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateTemp); + connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateAmt); + connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateTemp); + connect(horizontalSlider_temp, &QAbstractSlider::valueChanged, this, &MashDesigner::updateAmt); + connect(horizontalSlider_temp, &QAbstractSlider::valueChanged, this, &MashDesigner::updateTemp); // Update collected wort when sliders move. - connect(horizontalSlider_amount, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateCollectedWort); - connect(horizontalSlider_temp, &QAbstractSlider::sliderMoved, this, &MashDesigner::updateCollectedWort); + connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateCollectedWort); + connect(horizontalSlider_temp, &QAbstractSlider::valueChanged, this, &MashDesigner::updateCollectedWort); // Save the target temp whenever it's changed. connect(lineEdit_temp, &SmartLineEdit::textModified, this, &MashDesigner::saveTargetTemp); // Move to next step. From 9a5a74cfa1e7bbeae1a6995e45bbbc25255d5b90 Mon Sep 17 00:00:00 2001 From: MedicMomcilo Date: Thu, 19 Oct 2023 12:34:59 +0200 Subject: [PATCH 2/4] Reduce boilsize by lauter deadspace. --- src/model/Recipe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/Recipe.cpp b/src/model/Recipe.cpp index beaefd20f..c9602eed0 100644 --- a/src/model/Recipe.cpp +++ b/src/model/Recipe.cpp @@ -2785,7 +2785,7 @@ double Recipe::targetCollectedWortVol_l() { } if (equipment()) { - return boilSize_l() - equipment()->topUpKettle_l() - postMashAdditionVolume_l; + return boilSize_l() - equipment()->lauterDeadspace_l() - equipment()->topUpKettle_l() - postMashAdditionVolume_l; } else { return boilSize_l() - postMashAdditionVolume_l; } From e203fb079ce4764de922898a42e57edadcb258ac Mon Sep 17 00:00:00 2001 From: Matt Young Date: Wed, 25 Oct 2023 04:04:13 +0200 Subject: [PATCH 3/4] Update MashDesigner.cpp Add explanatory comment --- src/MashDesigner.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MashDesigner.cpp b/src/MashDesigner.cpp index 81c59a8ba..d7643f231 100644 --- a/src/MashDesigner.cpp +++ b/src/MashDesigner.cpp @@ -48,8 +48,10 @@ MashDesigner::MashDesigner(QWidget * parent) : QDialog {parent}, this->label_zeroWort->setText(Measurement::displayAmount(Measurement::Amount{0, Measurement::Units::liters})); // Update temp slider when we move amount slider. - connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateTempSlider); - // Update amount slider when we move temp slider. + // + // Here and below, we connect to valueChanged rather than sliderMoved as, otherwise, we don't receive any signal if + // the keyboard is used to move the slider. + connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateTempSlider); // Update amount slider when we move temp slider. connect(horizontalSlider_temp, &QAbstractSlider::valueChanged, this, &MashDesigner::updateAmtSlider); // Update tun fullness bar when either slider moves. connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateFullness); From babc0112416033b99ed163d928e07d6c2e6575e9 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Wed, 25 Oct 2023 04:05:31 +0200 Subject: [PATCH 4/4] Update MashDesigner.cpp --- src/MashDesigner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MashDesigner.cpp b/src/MashDesigner.cpp index d7643f231..501c03b12 100644 --- a/src/MashDesigner.cpp +++ b/src/MashDesigner.cpp @@ -51,7 +51,8 @@ MashDesigner::MashDesigner(QWidget * parent) : QDialog {parent}, // // Here and below, we connect to valueChanged rather than sliderMoved as, otherwise, we don't receive any signal if // the keyboard is used to move the slider. - connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateTempSlider); // Update amount slider when we move temp slider. + connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateTempSlider); + // Update amount slider when we move temp slider. connect(horizontalSlider_temp, &QAbstractSlider::valueChanged, this, &MashDesigner::updateAmtSlider); // Update tun fullness bar when either slider moves. connect(horizontalSlider_amount, &QAbstractSlider::valueChanged, this, &MashDesigner::updateFullness);