mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
plannerShared: add o2narcotic
Add include of cylinderModel Add o2narcotic the set function is special because it first informs the plannerModel that there is a new value and then ask cylindermodel to calculate a new bestmix Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
413501bc61
commit
c4d9b737cd
2 changed files with 16 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include "core/settings/qPrefDivePlanner.h"
|
#include "core/settings/qPrefDivePlanner.h"
|
||||||
#include "core/settings/qPrefTechnicalDetails.h"
|
#include "core/settings/qPrefTechnicalDetails.h"
|
||||||
#include "qt-models/diveplannermodel.h"
|
#include "qt-models/diveplannermodel.h"
|
||||||
|
#include "qt-models/cylindermodel.h"
|
||||||
|
|
||||||
plannerShared *plannerShared::instance()
|
plannerShared *plannerShared::instance()
|
||||||
{
|
{
|
||||||
|
@ -210,3 +211,14 @@ void plannerShared::set_sacfactor(double value)
|
||||||
// NO conversion, this is done in the planner model.
|
// NO conversion, this is done in the planner model.
|
||||||
DivePlannerPointsModel::instance()->setSacFactor(value);
|
DivePlannerPointsModel::instance()->setSacFactor(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool plannerShared::o2narcotic()
|
||||||
|
{
|
||||||
|
return qPrefDivePlanner::o2narcotic();
|
||||||
|
}
|
||||||
|
void plannerShared::set_o2narcotic(bool value)
|
||||||
|
{
|
||||||
|
qPrefDivePlanner::set_o2narcotic(value);
|
||||||
|
DivePlannerPointsModel::instance()->emitDataChanged();
|
||||||
|
CylindersModel::instance()->updateBestMixes();
|
||||||
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ class plannerShared: public QObject {
|
||||||
Q_PROPERTY(double decosac READ decosac WRITE set_decosac NOTIFY decosacChanged);
|
Q_PROPERTY(double decosac READ decosac WRITE set_decosac NOTIFY decosacChanged);
|
||||||
Q_PROPERTY(int problemsolvingtime READ problemsolvingtime WRITE set_problemsolvingtime NOTIFY problemsolvingtimeChanged);
|
Q_PROPERTY(int problemsolvingtime READ problemsolvingtime WRITE set_problemsolvingtime NOTIFY problemsolvingtimeChanged);
|
||||||
Q_PROPERTY(double sacfactor READ sacfactor WRITE set_sacfactor NOTIFY sacfactorChanged);
|
Q_PROPERTY(double sacfactor READ sacfactor WRITE set_sacfactor NOTIFY sacfactorChanged);
|
||||||
|
Q_PROPERTY(bool o2narcotic READ o2narcotic WRITE set_o2narcotic NOTIFY o2narcoticChanged);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static plannerShared *instance();
|
static plannerShared *instance();
|
||||||
|
@ -73,6 +74,7 @@ public:
|
||||||
static double decosac();
|
static double decosac();
|
||||||
static int problemsolvingtime();
|
static int problemsolvingtime();
|
||||||
static double sacfactor();
|
static double sacfactor();
|
||||||
|
static bool o2narcotic();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Ascend/Descend data, converted to meter/feet depending on user selection
|
// Ascend/Descend data, converted to meter/feet depending on user selection
|
||||||
|
@ -101,6 +103,7 @@ public slots:
|
||||||
static void set_decosac(double value);
|
static void set_decosac(double value);
|
||||||
static void set_problemsolvingtime(int value);
|
static void set_problemsolvingtime(int value);
|
||||||
static void set_sacfactor(double value);
|
static void set_sacfactor(double value);
|
||||||
|
static void set_o2narcotic(bool value);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// Ascend/Descend data, converted to meter/feet depending on user selection
|
// Ascend/Descend data, converted to meter/feet depending on user selection
|
||||||
|
@ -129,6 +132,7 @@ signals:
|
||||||
void decosacChanged(double value);
|
void decosacChanged(double value);
|
||||||
void problemsolvingtimeChanged(int value);
|
void problemsolvingtimeChanged(int value);
|
||||||
void sacfactorChanged(double value);
|
void sacfactorChanged(double value);
|
||||||
|
void o2narcoticChanged(bool value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
plannerShared() {}
|
plannerShared() {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue