From b1ed04a7f462d88b28b1abab881a0e1a8acc212a Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Wed, 6 Jul 2016 22:40:28 +1000 Subject: Have divedatapoint store cylinder id instead of gasmix Determining the correct cylinder index from a known gas mix can be complicated, but it is trivial to look up the gasmix from the cylinder_t structure. It makes sense to remember which cylinder is being used. This simplifies handling changing a cylinder's gas mix, either directly by the user, or indirectly in the planner. It also permits tracking of multiple cylinders of the same mix, e.g. independent twins / sidemount. Signed-off-by: Rick Walsh Signed-off-by: Dirk Hohndel --- qt-models/diveplannermodel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qt-models/diveplannermodel.h') diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h index 0770aa077..da84119ce 100644 --- a/qt-models/diveplannermodel.h +++ b/qt-models/diveplannermodel.h @@ -30,7 +30,7 @@ public: virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); virtual Qt::ItemFlags flags(const QModelIndex &index) const; - void gaschange(const QModelIndex &index, QString newgas); + void gaschange(const QModelIndex &index, int newcylinderid); void removeSelectedPoints(const QVector &rows); void setPlanMode(Mode mode); bool isPlanner(); @@ -42,7 +42,7 @@ public: bool recalcQ(); void tanksUpdated(); void rememberTanks(); - bool tankInUse(struct gasmix gasmix); + bool tankInUse(int cylinderid); void setupCylinders(); /** * @return the row number. @@ -59,7 +59,7 @@ public: public slots: - int addStop(int millimeters = 0, int seconds = 0, struct gasmix *gas = 0, int ccpoint = 0, bool entered = true); + int addStop(int millimeters = 0, int seconds = 0, int cylinderid_in = 0, int ccpoint = 0, bool entered = true); void addCylinder_clicked(); void setGFHigh(const int gfhigh); void triggerGFHigh(); -- cgit v1.2.3-70-g09d2