diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-23 12:24:43 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-26 08:39:17 -0800 |
commit | 6f3d1d3747d2cd07bac48a9107efa93c1a7b3427 (patch) | |
tree | 6ccf491f4a9731bc88ed56c3ca71f1448d13e36d /backend-shared | |
parent | df6f01a6f6767ee714fbf355b1e2260dfaa9f68f (diff) | |
download | subsurface-6f3d1d3747d2cd07bac48a9107efa93c1a7b3427.tar.gz |
plannerShared: add variables from plannerModel
the variables are set through set functions in DivePlannerPointsModel,
but read via getters from qPrefDivePlanner.
Variables:
drop_stone_mode
last_stop
switch_at_req_stop
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'backend-shared')
-rw-r--r-- | backend-shared/plannershared.cpp | 27 | ||||
-rw-r--r-- | backend-shared/plannershared.h | 12 |
2 files changed, 39 insertions, 0 deletions
diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp index 9bb8ad315..bdfc7b399 100644 --- a/backend-shared/plannershared.cpp +++ b/backend-shared/plannershared.cpp @@ -123,3 +123,30 @@ void plannerShared::set_dobailout(bool value) qPrefDivePlanner::set_dobailout(value); DivePlannerPointsModel::instance()->emitDataChanged(); } + +bool plannerShared::drop_stone_mode() +{ + return qPrefDivePlanner::drop_stone_mode(); +} +void plannerShared::set_drop_stone_mode(bool value) +{ + DivePlannerPointsModel::instance()->setDropStoneMode(value); +} + +bool plannerShared::last_stop() +{ + return qPrefDivePlanner::last_stop(); +} +void plannerShared::set_last_stop(bool value) +{ + DivePlannerPointsModel::instance()->setLastStop6m(value); +} + +bool plannerShared::switch_at_req_stop() +{ + return qPrefDivePlanner::switch_at_req_stop(); +} +void plannerShared::set_switch_at_req_stop(bool value) +{ + DivePlannerPointsModel::instance()->setSwitchAtReqStop(value); +} diff --git a/backend-shared/plannershared.h b/backend-shared/plannershared.h index 0c2d5500a..7e2f57184 100644 --- a/backend-shared/plannershared.h +++ b/backend-shared/plannershared.h @@ -32,6 +32,9 @@ class plannerShared: public QObject { Q_PROPERTY(int gfhigh READ gfhigh WRITE set_gfhigh NOTIFY gfhighChanged); Q_PROPERTY(int vpmb_conservatism READ vpmb_conservatism WRITE set_vpmb_conservatism NOTIFY vpmb_conservatismChanged); Q_PROPERTY(bool dobailout READ dobailout WRITE set_dobailout NOTIFY dobailoutChanged); + Q_PROPERTY(bool drop_stone_mode READ drop_stone_mode WRITE set_drop_stone_mode NOTIFY drop_stone_modeChanged); + Q_PROPERTY(bool last_stop READ last_stop WRITE set_last_stop NOTIFY last_stopChanged); + Q_PROPERTY(bool switch_at_req_stop READ switch_at_req_stop WRITE set_switch_at_req_stop NOTIFY switch_at_req_stopChanged); public: static plannerShared *instance(); @@ -51,6 +54,9 @@ public: static int gfhigh(); static int vpmb_conservatism(); static bool dobailout(); + static bool drop_stone_mode(); + static bool last_stop(); + static bool switch_at_req_stop(); public slots: // Ascend/Descend data, converted to meter/feet depending on user selection @@ -68,6 +74,9 @@ public slots: static void set_gfhigh(int value); static void set_vpmb_conservatism(int value); static void set_dobailout(bool value); + static void set_drop_stone_mode(bool value); + static void set_last_stop(bool value); + static void set_switch_at_req_stop(bool value); signals: // Ascend/Descend data, converted to meter/feet depending on user selection @@ -85,6 +94,9 @@ signals: void gfhighChanged(int value); void vpmb_conservatismChanged(int value); void dobailoutChanged(bool value); + void drop_stone_modeChanged(bool value); + void last_stopChanged(bool value); + void switch_at_req_stopChanged(bool value); private: plannerShared() {} |