diff options
author | jan Iversen <jan@casacondor.com> | 2019-12-14 20:29:16 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-26 08:38:27 -0800 |
commit | b877dd973cd787464875f0329c6472bf7f508e01 (patch) | |
tree | e4bb753e19f02330c5e253e2864f9e7f1a35a44f /backend-shared/plannershared.h | |
parent | d90a2ca0089e782372085a870135340948f08899 (diff) | |
download | subsurface-b877dd973cd787464875f0329c6472bf7f508e01.tar.gz |
plannerShared: add variables from plannerModel
the variables are set through set functions in DivePlannerPointsModel,
but read via getters from qPrefDivePlanner.
Variables:
planner_deco_mode
reserveGas
safetyStop
gflow
gfhigh
vpmb_conservatism
Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'backend-shared/plannershared.h')
-rw-r--r-- | backend-shared/plannershared.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/backend-shared/plannershared.h b/backend-shared/plannershared.h index 136eb9cdf..b38b31f1d 100644 --- a/backend-shared/plannershared.h +++ b/backend-shared/plannershared.h @@ -2,6 +2,7 @@ #ifndef PLANNERSHARED_H #define PLANNERSHARED_H #include <QObject> +#include "core/pref.h" // This is a shared class (mobile/desktop), and contains the core of the diveplanner // without UI entanglement. @@ -22,6 +23,15 @@ class plannerShared: public QObject { Q_PROPERTY(int ascrate50 READ ascrate50 WRITE set_ascrate50 NOTIFY ascrate50Changed); Q_PROPERTY(int ascrate75 READ ascrate75 WRITE set_ascrate75 NOTIFY ascrate75Changed); Q_PROPERTY(int descrate READ descrate WRITE set_descrate NOTIFY descrateChanged); + + // Planning data + Q_PROPERTY(deco_mode planner_deco_mode READ planner_deco_mode WRITE set_planner_deco_mode NOTIFY planner_deco_modeChanged); + Q_PROPERTY(int reserve_gas READ reserve_gas WRITE set_reserve_gas NOTIFY reserve_gasChanged); + Q_PROPERTY(bool safetystop READ safetystop WRITE set_safetystop NOTIFY safetystopChanged); + Q_PROPERTY(int gflow READ gflow WRITE set_gflow NOTIFY gflowChanged); + 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); + public: static plannerShared *instance(); @@ -32,6 +42,14 @@ public: static int ascrate75(); static int descrate(); + // Planning data + static deco_mode planner_deco_mode(); + static int reserve_gas(); + static bool safetystop(); + static int gflow(); + static int gfhigh(); + static int vpmb_conservatism(); + public slots: // Ascend/Descend data, converted to meter/feet depending on user selection static void set_ascratelast6m(int value); @@ -40,6 +58,14 @@ public slots: static void set_ascrate75(int value); static void set_descrate(int value); + // Planning data + static void set_planner_deco_mode(deco_mode value); + static void set_reserve_gas(int value); + static void set_safetystop(bool value); + static void set_gflow(int value); + static void set_gfhigh(int value); + static void set_vpmb_conservatism(int value); + signals: // Ascend/Descend data, converted to meter/feet depending on user selection void ascratelast6mChanged(int value); @@ -48,6 +74,14 @@ signals: void ascrate75Changed(int value); void descrateChanged(int value); + // Planning data + void planner_deco_modeChanged(deco_mode value); + void reserve_gasChanged(int value); + void safetystopChanged(bool value); + void gflowChanged(int value); + void gfhighChanged(int value); + void vpmb_conservatismChanged(int value); + private: plannerShared() {} }; |