planner: remove dc_number access from models

Instead of accessing the global dc_number from the
DivePlannerPointsModel and the CylinderModel, pass them
in the respective initialization functions.

The dc_number global might not make sense on mobile.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-05-21 22:08:46 +02:00 committed by bstoeger
parent d057af43b4
commit 832398180c
7 changed files with 20 additions and 14 deletions

View file

@ -60,7 +60,7 @@ public:
struct diveplan &getDiveplan();
struct deco_state final_deco_state;
void loadFromDive(dive *d);
void loadFromDive(dive *d, int dcNr);
void addStop(int millimeters, int seconds);
public
slots:
@ -132,6 +132,7 @@ private:
void computeVariationsFreeDeco(struct diveplan *diveplan, struct deco_state *ds);
int analyzeVariations(struct decostop *min, struct decostop *mid, struct decostop *max, const char *unit);
struct dive *d;
int dcNr;
CylindersModel cylinders;
Mode mode;
QVector<divedatapoint> divepoints;