planner: move decotimestap to diveplannermodel.cpp

The deco timestep is a parameter to the plan() function. There
seems no need to define this as a global macro. Probably some
code reshuffeling artifact.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-08 11:18:17 +01:00 committed by bstoeger
parent 4db19d6284
commit 9a052cd089
3 changed files with 5 additions and 5 deletions

View file

@ -27,6 +27,8 @@
#define UNIT_FACTOR ((prefs.units.length == units::METERS) ? 1000.0 / 60.0 : feet_to_mm(1.0) / 60.0)
static constexpr int decotimestep = 60; // seconds
CylindersModel *DivePlannerPointsModel::cylindersModel()
{
return &cylinders;
@ -1078,7 +1080,7 @@ void DivePlannerPointsModel::updateDiveProfile()
struct deco_state plan_deco_state;
memset(&plan_deco_state, 0, sizeof(struct deco_state));
plan(&plan_deco_state, &diveplan, d, DECOTIMESTEP, stoptable, cache, isPlanner(), false);
plan(&plan_deco_state, &diveplan, d, decotimestep, stoptable, cache, isPlanner(), false);
updateMaxDepth();
if (isPlanner() && shouldComputeVariations()) {
@ -1290,7 +1292,7 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
createTemporaryPlan();
struct decostop stoptable[60];
plan(&ds_after_previous_dives, &diveplan, d, DECOTIMESTEP, stoptable, cache, isPlanner(), true);
plan(&ds_after_previous_dives, &diveplan, d, decotimestep, stoptable, cache, isPlanner(), true);
if (shouldComputeVariations()) {
struct diveplan *plan_copy;