diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-03-31 22:18:00 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-31 22:18:00 -0700 |
commit | 0de21c24fa0bfdad5a828a39821c7761ecc2f946 (patch) | |
tree | 30d6a5bb9bc3bd8a1ddeae731ce72d749b002030 /qt-ui/diveplanner.h | |
parent | 45767961e88c85eb3bf3f8cbff1c9c675eca4904 (diff) | |
parent | 18ec989ef51b5357d76db85d467626141d5e2429 (diff) | |
download | subsurface-0de21c24fa0bfdad5a828a39821c7761ecc2f946.tar.gz |
Merge branch 'planner-mods'
Nothing exciting here, just a few independent changes close to each other.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.h')
-rw-r--r-- | qt-ui/diveplanner.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 4679d0660..84ac4a817 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -12,6 +12,43 @@ class QListView; class QModelIndex; +struct computedPoint { + int computedTime; + unsigned int computedDepth; + computedPoint(int computedTime_, unsigned int computedDepth_) { + computedTime = computedTime_; + computedDepth = computedDepth_; + }; + computedPoint() {}; +}; + +class DivePlannerDisplay : public QAbstractTableModel { + Q_OBJECT +private: + explicit DivePlannerDisplay(QObject *parent = 0); + QVector<computedPoint> computedPoints; + +public: + static DivePlannerDisplay *instance(); + enum Sections { + COMPUTED_DEPTH, + COMPUTED_DURATION, + COLUMNS + }; + virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; + 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 clear(); + computedPoint at(int row); + int size(); + void removeStops(); + void addStops(); + void insertPoint(const struct computedPoint &p); +}; + class DivePlannerPointsModel : public QAbstractTableModel { Q_OBJECT public: @@ -57,7 +94,7 @@ public: public slots: - int addStop(int millimeters = 0, int seconds = 0, int o2 = 0, int he = 0, int ccpoint = 0); + int addStop(int millimeters = 0, int seconds = 0, int o2 = 0, int he = 0, int ccpoint = 0, bool entered = true); void addCylinder_clicked(); void setGFHigh(const int gfhigh); void setGFLow(const int ghflow); |