diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-02-11 20:24:18 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-03-11 08:01:35 -0800 |
commit | 7f8c3592ce29d5fd4cd177d8e86ede9fdf3ab747 (patch) | |
tree | 2c339a577a304a6f58e5518534e31f8d449af229 /qt-models | |
parent | b8e044dee350076984e998d4d797ec4e7a191f41 (diff) | |
download | subsurface-7f8c3592ce29d5fd4cd177d8e86ede9fdf3ab747.tar.gz |
Minimum gas calculation - Calculations and UI parameters
Add minimum gas calculation to planner output.
Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime.
Connect UI signals and slots for recalculation of diveplan.
Disable minimum gas calculation if there was already a warning before.
If minimum gas result is larger then cylinder start pressure give warning message instead of result.
Add line break before pO2 warnings but only if warnings exist.
Signed-off-by: Joachim Ritter <jritter@bitsenke.de>
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 14 | ||||
-rw-r--r-- | qt-models/diveplannermodel.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 616f1dadc..4a33b15c3 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -401,6 +401,20 @@ void DivePlannerPointsModel::setDecoSac(double sac) emitDataChanged(); } +void DivePlannerPointsModel::setSacFactor(double factor) +{ + auto planner = SettingsObjectWrapper::instance()->planner_settings; + planner->setSacFactor((int) round(factor * 100)); + emitDataChanged(); +} + +void DivePlannerPointsModel::setProblemSolvingTime(int minutes) +{ + auto planner = SettingsObjectWrapper::instance()->planner_settings; + planner->setProblemSolvingTime(minutes); + emitDataChanged(); +} + void DivePlannerPointsModel::setGFHigh(const int gfhigh) { tempGFHigh = gfhigh; diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h index e9227f671..bc3458ffd 100644 --- a/qt-models/diveplannermodel.h +++ b/qt-models/diveplannermodel.h @@ -91,6 +91,8 @@ slots: void setReserveGas(int reserve); void setSwitchAtReqStop(bool value); void setMinSwitchDuration(int duration); + void setSacFactor(double factor); + void setProblemSolvingTime(int minutes); signals: void planCreated(); |