diff options
author | Lakshman Anumolu <acrlakshman@gmail.com> | 2014-03-31 23:24:33 -0500 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-31 22:01:16 -0700 |
commit | 18ec989ef51b5357d76db85d467626141d5e2429 (patch) | |
tree | d2c2429919250a16654cde5ab4b4f6afd2b23787 /qt-ui/diveplanner.h | |
parent | 30bdfc8160100a296af7115a1f1dff5e4eeb710c (diff) | |
download | subsurface-18ec989ef51b5357d76db85d467626141d5e2429.tar.gz |
Diveplan with entered and computed waypoints to UI
Recently Robert Helling provided a patch "Distinguish between entered and
calculated waypoints" in an attempt to distinguish between entered and
calculated stops.
This patch is an independent (content wise) extension of the above
patch and is built relative to it which adds new table to display
computed waypoints in plan mode.
Currently table includes only two columns "Comp. Depth" and "Comp.
Duration", which can extended to show further information.
This is only a start to the UI interaction in PLAN mode.
In addition to this there are many TODO things that diveplan feature
demands
TODO:
1. Show more details through "Computed Waypoints" table.
2. Remove tooltip from "Computed Waypoints" table widget.
3. Make contents in "Computed Waypoints" table widget non-editable.
4. Fix error when trying to save dive plan without using cylinder data.
5. Make dive plan editable after saving it.
6. Improvise dive planner graphics window.
Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.h')
-rw-r--r-- | qt-ui/diveplanner.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 1393d9f78..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: |