summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2019-12-23 13:15:07 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-26 08:39:58 -0800
commit5b9014aeb7d02d9db9677f81d20109ec67afa0c0 (patch)
treef9fab2aca44b4e0ee253edcf209835cec2992a08
parent316e56f4f7da21e22db867b69bd58504c1976699 (diff)
downloadsubsurface-5b9014aeb7d02d9db9677f81d20109ec67afa0c0.tar.gz
plannerShared: add variables from plannerModel with conversion
the variables are set through set functions in DivePlannerPointsModel, but read via getters from qPrefDivePlanner and converted Variables: min_switch_duration Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--backend-shared/plannershared.cpp10
-rw-r--r--backend-shared/plannershared.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp
index d5b5156ab..24ba7aae9 100644
--- a/backend-shared/plannershared.cpp
+++ b/backend-shared/plannershared.cpp
@@ -160,3 +160,13 @@ void plannerShared::set_doo2breaks(bool value)
qPrefDivePlanner::set_doo2breaks(value);
DivePlannerPointsModel::instance()->emitDataChanged();
}
+
+int plannerShared::min_switch_duration()
+{
+ return qPrefDivePlanner::min_switch_duration() / 60;
+}
+void plannerShared::set_min_switch_duration(int value)
+{
+ // NO conversion, this is done in the planner model.
+ DivePlannerPointsModel::instance()->setMinSwitchDuration(value);
+}
diff --git a/backend-shared/plannershared.h b/backend-shared/plannershared.h
index 65cb28d95..ba1abf0ba 100644
--- a/backend-shared/plannershared.h
+++ b/backend-shared/plannershared.h
@@ -36,6 +36,7 @@ class plannerShared: public QObject {
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);
Q_PROPERTY(bool doo2breaks READ doo2breaks WRITE set_doo2breaks NOTIFY doo2breaksChanged);
+ Q_PROPERTY(int min_switch_duration READ min_switch_duration WRITE set_min_switch_duration NOTIFY min_switch_durationChanged);
public:
static plannerShared *instance();
@@ -59,6 +60,7 @@ public:
static bool last_stop();
static bool switch_at_req_stop();
static bool doo2breaks();
+ static int min_switch_duration();
public slots:
// Ascend/Descend data, converted to meter/feet depending on user selection
@@ -80,6 +82,7 @@ public slots:
static void set_last_stop(bool value);
static void set_switch_at_req_stop(bool value);
static void set_doo2breaks(bool value);
+ static void set_min_switch_duration(int value);
signals:
// Ascend/Descend data, converted to meter/feet depending on user selection
@@ -101,6 +104,7 @@ signals:
void last_stopChanged(bool value);
void switch_at_req_stopChanged(bool value);
void doo2breaksChanged(bool value);
+ void min_switch_durationChanged(int value);
private:
plannerShared() {}