diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-04-18 16:08:33 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-04-18 10:01:46 -0700 |
commit | cb4daa85c37bd5fb88c660d19ed57148dcadece0 (patch) | |
tree | 28319e3a875c720df5b3121a4429b2b6ee53b7f4 /qt-ui/diveplanner.cpp | |
parent | e871169e4ce9ff1681a17c0ca0960c69daa8ec09 (diff) | |
download | subsurface-cb4daa85c37bd5fb88c660d19ed57148dcadece0.tar.gz |
Comments added to planner
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 93826675c..4ca9a4938 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1044,6 +1044,9 @@ bool DivePlannerPointsModel::isPlanner() return mode == PLAN; } +/* When the planner adds deco stops to the model, adding those should not trigger a new deco calculation. + * We thus start the planner only when recalc is true. */ + bool DivePlannerPointsModel::setRecalc(bool rec) { bool old = recalc; @@ -1245,6 +1248,8 @@ bool DivePlannerPointsModel::addGas(int o2, int he) fill_default_cylinder(cyl); cyl->gasmix.o2.permille = o2; cyl->gasmix.he.permille = he; + /* The depth to change to that gas is given by the depth where its pO2 is 1.6 bar. + * The user should be able to change this depth manually. */ if (!o2) cyl->depth.mm = 1600 * 1000 / O2_IN_AIR * 10 - 10000; else @@ -1326,6 +1331,8 @@ int DivePlannerPointsModel::addStop(int milimeters, int seconds, int o2, int he, } } } + + // Get rid of deco stops before adding waypoints bool oldRecalc = setRecalc(false); if (oldRecalc) { QVector<int> computedPoints; @@ -1582,7 +1589,8 @@ void DivePlannerPointsModel::createPlan() int consumption = ((depth_to_mbar(mean[i], tempDive) * duration[i] / 60) * sac) / (cyl->type.size.mliter / 1000); cyl->end.mbar = cyl->start.mbar - consumption; } else { - /* Cylider without a proper size are easily emptied */ + // Cylinders without a proper size are easily emptied. + // Don't attempt to to calculate the infinite pressure drop. cyl->end.mbar = 0; } } |