Skip to content

Commit

Permalink
Merge pull request #776 from MedicMomcilo/develop
Browse files Browse the repository at this point in the history
Improve keyboard usage and reduce boilsize by deadspace.
  • Loading branch information
matty0ung authored Oct 25, 2023
2 parents e2e76b7 + babc011 commit 574f5e3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions src/MashDesigner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,23 @@ 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);
//
// 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::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.
Expand Down
2 changes: 1 addition & 1 deletion src/model/Recipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 574f5e3

Please sign in to comment.