summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--backend-shared/plannershared.cpp52
-rw-r--r--backend-shared/plannershared.h2
-rw-r--r--desktop-widgets/diveplanner.cpp54
-rw-r--r--mobile-widgets/qmlinterface.h52
-rw-r--r--tests/testplannershared.cpp88
5 files changed, 124 insertions, 124 deletions
diff --git a/backend-shared/plannershared.cpp b/backend-shared/plannershared.cpp
index a83a3bd56..51f7a3a74 100644
--- a/backend-shared/plannershared.cpp
+++ b/backend-shared/plannershared.cpp
@@ -7,65 +7,65 @@
#include "qt-models/cylindermodel.h"
// Planning values
-deco_mode plannerShared::planner_deco_mode()
+deco_mode PlannerShared::planner_deco_mode()
{
return qPrefDivePlanner::planner_deco_mode();
}
-void plannerShared::set_planner_deco_mode(deco_mode value)
+void PlannerShared::set_planner_deco_mode(deco_mode value)
{
DivePlannerPointsModel::instance()->setDecoMode(value);
}
-int plannerShared::reserve_gas()
+int PlannerShared::reserve_gas()
{
return qPrefDivePlanner::reserve_gas();
}
-void plannerShared::set_reserve_gas(int value)
+void PlannerShared::set_reserve_gas(int value)
{
DivePlannerPointsModel::instance()->setReserveGas(value);
}
-bool plannerShared::dobailout()
+bool PlannerShared::dobailout()
{
return qPrefDivePlanner::dobailout();
}
-void plannerShared::set_dobailout(bool value)
+void PlannerShared::set_dobailout(bool value)
{
qPrefDivePlanner::set_dobailout(value);
DivePlannerPointsModel::instance()->emitDataChanged();
}
-bool plannerShared::doo2breaks()
+bool PlannerShared::doo2breaks()
{
return qPrefDivePlanner::doo2breaks();
}
-void plannerShared::set_doo2breaks(bool value)
+void PlannerShared::set_doo2breaks(bool value)
{
qPrefDivePlanner::set_doo2breaks(value);
DivePlannerPointsModel::instance()->emitDataChanged();
}
-int plannerShared::min_switch_duration()
+int PlannerShared::min_switch_duration()
{
return qPrefDivePlanner::min_switch_duration() / 60;
}
-void plannerShared::set_min_switch_duration(int value)
+void PlannerShared::set_min_switch_duration(int value)
{
// NO conversion, this is done in the planner model.
DivePlannerPointsModel::instance()->setMinSwitchDuration(value);
}
-int plannerShared::surface_segment()
+int PlannerShared::surface_segment()
{
return qPrefDivePlanner::surface_segment() / 60;
}
-void plannerShared::set_surface_segment(int value)
+void PlannerShared::set_surface_segment(int value)
{
// NO conversion, this is done in the planner model.
DivePlannerPointsModel::instance()->setSurfaceSegment(value);
}
-double plannerShared::bottomsac()
+double PlannerShared::bottomsac()
{
return (qPrefUnits::volume() == units::LITER) ?
qPrefDivePlanner::bottomsac() / 1000.0 :
@@ -75,13 +75,13 @@ double plannerShared::bottomsac()
#endif
);
}
-void plannerShared::set_bottomsac(double value)
+void PlannerShared::set_bottomsac(double value)
{
// NO conversion, this is done in the planner model.
DivePlannerPointsModel::instance()->setBottomSac(value);
}
-double plannerShared::decosac()
+double PlannerShared::decosac()
{
// Mobile and desktop use the same values when using units::LITER,
// however when using units::CUFT desktop want 0.00 - 3.00 while
@@ -94,13 +94,13 @@ double plannerShared::decosac()
#endif
);
}
-void plannerShared::set_decosac(double value)
+void PlannerShared::set_decosac(double value)
{
// NO conversion, this is done in the planner model.
DivePlannerPointsModel::instance()->setDecoSac(value);
}
-double plannerShared::sacfactor()
+double PlannerShared::sacfactor()
{
// mobile want 0 - 100 which are shown with 1 decimal as 0.0 - 10.0
// whereas desktop wants 0.0 - 10.0
@@ -112,38 +112,38 @@ double plannerShared::sacfactor()
100.0;
#endif
}
-void plannerShared::set_sacfactor(double value)
+void PlannerShared::set_sacfactor(double value)
{
// NO conversion, this is done in the planner model.
DivePlannerPointsModel::instance()->setSacFactor(value);
}
-bool plannerShared::o2narcotic()
+bool PlannerShared::o2narcotic()
{
return qPrefDivePlanner::o2narcotic();
}
-void plannerShared::set_o2narcotic(bool value)
+void PlannerShared::set_o2narcotic(bool value)
{
qPrefDivePlanner::set_o2narcotic(value);
DivePlannerPointsModel::instance()->emitDataChanged();
CylindersModel::instance()->updateBestMixes();
}
-double plannerShared::bottompo2()
+double PlannerShared::bottompo2()
{
return (qPrefDivePlanner::bottompo2() / 1000.0);
}
-void plannerShared::set_bottompo2(double value)
+void PlannerShared::set_bottompo2(double value)
{
qPrefDivePlanner::set_bottompo2((int) (value * 1000.0));
CylindersModel::instance()->updateBestMixes();
}
-double plannerShared::decopo2()
+double PlannerShared::decopo2()
{
return qPrefDivePlanner::decopo2() / 1000.0;
}
-void plannerShared::set_decopo2(double value)
+void PlannerShared::set_decopo2(double value)
{
pressure_t olddecopo2;
olddecopo2.mbar = prefs.decopo2;
@@ -152,11 +152,11 @@ void plannerShared::set_decopo2(double value)
CylindersModel::instance()->updateBestMixes();
}
-int plannerShared::bestmixend()
+int PlannerShared::bestmixend()
{
return lrint(get_depth_units(prefs.bestmixend.mm, NULL, NULL));
}
-void plannerShared::set_bestmixend(int value)
+void PlannerShared::set_bestmixend(int value)
{
qPrefDivePlanner::set_bestmixend(units_to_depth(value).mm);
CylindersModel::instance()->updateBestMixes();
diff --git a/backend-shared/plannershared.h b/backend-shared/plannershared.h
index d3e9f9fe4..1368a6782 100644
--- a/backend-shared/plannershared.h
+++ b/backend-shared/plannershared.h
@@ -12,7 +12,7 @@
// The mobile diveplanner shows all diveplans, but the editing functionality is
// limited to keep the UI simpler.
-class plannerShared: public QObject {
+class PlannerShared: public QObject {
Q_OBJECT
public:
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index eeb59e880..7b67b8527 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -353,7 +353,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
ui.label_min_switch_duration->setDisabled(false);
ui.sacfactor->setDisabled(false);
ui.problemsolvingtime->setDisabled(false);
- ui.sacfactor->setValue(plannerShared::sacfactor());
+ ui.sacfactor->setValue(PlannerShared::sacfactor());
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
ui.display_variations->setDisabled(false);
}
@@ -388,7 +388,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
ui.label_min_switch_duration->setDisabled(false);
ui.sacfactor->setDisabled(false);
ui.problemsolvingtime->setDisabled(false);
- ui.sacfactor->setValue(plannerShared::sacfactor());
+ ui.sacfactor->setValue(PlannerShared::sacfactor());
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
ui.display_variations->setDisabled(false);
}
@@ -432,18 +432,18 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
ui.display_transitions->setChecked(prefs.display_transitions);
ui.display_variations->setChecked(prefs.display_variations);
ui.safetystop->setChecked(prefs.safetystop);
- ui.sacfactor->setValue(plannerShared::sacfactor());
+ ui.sacfactor->setValue(PlannerShared::sacfactor());
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
- ui.bottompo2->setValue(plannerShared::bottompo2());
- ui.decopo2->setValue(plannerShared::decopo2());
+ ui.bottompo2->setValue(PlannerShared::bottompo2());
+ ui.decopo2->setValue(PlannerShared::decopo2());
ui.backgasBreaks->setChecked(prefs.doo2breaks);
- plannerShared::set_dobailout(false);
+ PlannerShared::set_dobailout(false);
setBailoutVisibility(false);
ui.o2narcotic->setChecked(prefs.o2narcotic);
ui.drop_stone_mode->setChecked(prefs.drop_stone_mode);
ui.switch_at_req_stop->setChecked(prefs.switch_at_req_stop);
- ui.min_switch_duration->setValue(plannerShared::min_switch_duration());
- ui.surface_segment->setValue(plannerShared::surface_segment());
+ ui.min_switch_duration->setValue(PlannerShared::min_switch_duration());
+ ui.surface_segment->setValue(PlannerShared::surface_segment());
ui.recreational_deco->setChecked(prefs.planner_deco_mode == RECREATIONAL);
ui.buehlmann_deco->setChecked(prefs.planner_deco_mode == BUEHLMANN);
ui.vpmb_deco->setChecked(prefs.planner_deco_mode == VPMB);
@@ -455,9 +455,9 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
rebreather_modes.append(gettextFromC::tr(divemode_text_ui[i]));
ui.rebreathermode->insertItems(0, rebreather_modes);
- connect(ui.recreational_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(RECREATIONAL); });
- connect(ui.buehlmann_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(BUEHLMANN); });
- connect(ui.vpmb_deco, &QAbstractButton::clicked, [=] { plannerShared::set_planner_deco_mode(VPMB); });
+ connect(ui.recreational_deco, &QAbstractButton::clicked, [=] { PlannerShared::set_planner_deco_mode(RECREATIONAL); });
+ connect(ui.buehlmann_deco, &QAbstractButton::clicked, [=] { PlannerShared::set_planner_deco_mode(BUEHLMANN); });
+ connect(ui.vpmb_deco, &QAbstractButton::clicked, [=] { PlannerShared::set_planner_deco_mode(VPMB); });
connect(ui.lastStop, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setLastStop6m);
connect(ui.lastStop, &QAbstractButton::toggled, this, &PlannerSettingsWidget::disableBackgasBreaks);
@@ -466,7 +466,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.display_runtime, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setDisplayRuntime);
connect(ui.display_transitions, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setDisplayTransitions);
connect(ui.safetystop, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setSafetyStop);
- connect(ui.reserve_gas, QOverload<int>::of(&QSpinBox::valueChanged), &plannerShared::set_reserve_gas);
+ connect(ui.reserve_gas, QOverload<int>::of(&QSpinBox::valueChanged), &PlannerShared::set_reserve_gas);
connect(ui.ascRate75, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate75Display);
connect(ui.ascRate50, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscrate50Display);
connect(ui.ascRateStops, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setAscratestopsDisplay);
@@ -477,11 +477,11 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.gflow, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setGFLow);
connect(ui.vpmb_conservatism, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setVpmbConservatism);
connect(ui.backgasBreaks, &QAbstractButton::toggled, this, &PlannerSettingsWidget::setBackgasBreaks);
- connect(ui.bailout, &QAbstractButton::toggled, &plannerShared::set_dobailout);
- connect(ui.o2narcotic, &QAbstractButton::toggled, &plannerShared::set_o2narcotic);
+ connect(ui.bailout, &QAbstractButton::toggled, &PlannerShared::set_dobailout);
+ connect(ui.o2narcotic, &QAbstractButton::toggled, &PlannerShared::set_o2narcotic);
connect(ui.switch_at_req_stop, &QAbstractButton::toggled, plannerModel, &DivePlannerPointsModel::setSwitchAtReqStop);
- connect(ui.min_switch_duration, QOverload<int>::of(&QSpinBox::valueChanged), &plannerShared::set_min_switch_duration);
- connect(ui.surface_segment, QOverload<int>::of(&QSpinBox::valueChanged), &plannerShared::set_surface_segment);
+ connect(ui.min_switch_duration, QOverload<int>::of(&QSpinBox::valueChanged), &PlannerShared::set_min_switch_duration);
+ connect(ui.surface_segment, QOverload<int>::of(&QSpinBox::valueChanged), &PlannerShared::set_surface_segment);
connect(ui.rebreathermode, QOverload<int>::of(&QComboBox::currentIndexChanged), plannerModel, &DivePlannerPointsModel::setRebreatherMode);
connect(ui.rebreathermode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &PlannerSettingsWidget::setBailoutVisibility);
@@ -489,13 +489,13 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
connect(ui.buehlmann_deco, &QAbstractButton::clicked, [=] { disableDecoElements(BUEHLMANN); });
connect(ui.vpmb_deco, &QAbstractButton::clicked, [=] { disableDecoElements(VPMB); });
- connect(ui.sacfactor, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_sacfactor);
+ connect(ui.sacfactor, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &PlannerShared::set_sacfactor);
connect(ui.problemsolvingtime, QOverload<int>::of(&QSpinBox::valueChanged), plannerModel, &DivePlannerPointsModel::setProblemSolvingTime);
- connect(ui.bottompo2, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_bottompo2);
- connect(ui.decopo2, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_decopo2);
- connect(ui.bestmixEND, QOverload<int>::of(&QSpinBox::valueChanged), &plannerShared::set_bestmixend);
- connect(ui.bottomSAC, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_bottomsac);
- connect(ui.decoStopSAC, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &plannerShared::set_decosac);
+ connect(ui.bottompo2, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &PlannerShared::set_bottompo2);
+ connect(ui.decopo2, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &PlannerShared::set_decopo2);
+ connect(ui.bestmixEND, QOverload<int>::of(&QSpinBox::valueChanged), &PlannerShared::set_bestmixend);
+ connect(ui.bottomSAC, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &PlannerShared::set_bottomsac);
+ connect(ui.decoStopSAC, QOverload<double>::of(&QDoubleSpinBox::valueChanged), &PlannerShared::set_decosac);
settingsChanged();
ui.gflow->setValue(prefs.gflow);
@@ -554,8 +554,8 @@ void PlannerSettingsWidget::settingsChanged()
ui.bottomSAC->setSingleStep(0.1);
ui.decoStopSAC->setDecimals(2);
ui.decoStopSAC->setSingleStep(0.1);
- ui.bottomSAC->setValue(plannerShared::bottomsac());
- ui.decoStopSAC->setValue(plannerShared::decosac());
+ ui.bottomSAC->setValue(PlannerShared::bottomsac());
+ ui.decoStopSAC->setValue(PlannerShared::decosac());
} else {
ui.bottomSAC->setSuffix(tr("ℓ/min"));
ui.decoStopSAC->setSuffix(tr("ℓ/min"));
@@ -563,8 +563,8 @@ void PlannerSettingsWidget::settingsChanged()
ui.bottomSAC->setSingleStep(1);
ui.decoStopSAC->setDecimals(0);
ui.decoStopSAC->setSingleStep(1);
- ui.bottomSAC->setValue(plannerShared::bottomsac());
- ui.decoStopSAC->setValue(plannerShared::decosac());
+ ui.bottomSAC->setValue(PlannerShared::bottomsac());
+ ui.decoStopSAC->setValue(PlannerShared::decosac());
}
if(get_units()->pressure == units::BAR) {
ui.reserve_gas->setSuffix(tr("bar"));
@@ -594,7 +594,7 @@ void PlannerSettingsWidget::printDecoPlan()
void PlannerSettingsWidget::setBackgasBreaks(bool dobreaks)
{
- plannerShared::set_doo2breaks(dobreaks);
+ PlannerShared::set_doo2breaks(dobreaks);
}
void PlannerSettingsWidget::setBailoutVisibility(int mode)
diff --git a/mobile-widgets/qmlinterface.h b/mobile-widgets/qmlinterface.h
index 1aced7a9d..9b05b927d 100644
--- a/mobile-widgets/qmlinterface.h
+++ b/mobile-widgets/qmlinterface.h
@@ -188,28 +188,28 @@ public:
int descrate() { return DivePlannerPointsModel::instance()->descrateDisplay(); }
DIVE_MODE dive_mode() { return OC; }
- DECO_MODE planner_deco_mode() { return (DECO_MODE)plannerShared::planner_deco_mode(); }
- int reserve_gas() { return plannerShared::reserve_gas(); }
+ DECO_MODE planner_deco_mode() { return (DECO_MODE)PlannerShared::planner_deco_mode(); }
+ int reserve_gas() { return PlannerShared::reserve_gas(); }
bool safetystop() { return prefs.safetystop; }
int gflow() { return prefs.gflow; }
int gfhigh() { return prefs.gfhigh; }
int vpmb_conservatism() { return prefs.vpmb_conservatism; }
- bool dobailout() { return plannerShared::dobailout(); }
+ bool dobailout() { return PlannerShared::dobailout(); }
bool drop_stone_mode() { return prefs.drop_stone_mode; }
bool last_stop6m() { return prefs.last_stop; }
bool switch_at_req_stop() { return prefs.switch_at_req_stop; }
- bool doo2breaks() { return plannerShared::doo2breaks(); }
- int min_switch_duration() { return plannerShared::min_switch_duration(); }
- int surface_segment() { return plannerShared::surface_segment(); }
+ bool doo2breaks() { return PlannerShared::doo2breaks(); }
+ int min_switch_duration() { return PlannerShared::min_switch_duration(); }
+ int surface_segment() { return PlannerShared::surface_segment(); }
- int bottomsac() { return (int)plannerShared::bottomsac(); }
- int decosac() { return (int)plannerShared::decosac(); }
+ int bottomsac() { return (int)PlannerShared::bottomsac(); }
+ int decosac() { return (int)PlannerShared::decosac(); }
int problemsolvingtime() { return prefs.problemsolvingtime; }
- int sacfactor() { return (int)plannerShared::sacfactor(); }
- bool o2narcotic() { return (int)plannerShared::o2narcotic(); }
- int bottompo2() { return (int)plannerShared::bottompo2(); }
- int decopo2() { return (int)plannerShared::decopo2(); }
- int bestmixend() { return plannerShared::bestmixend(); }
+ int sacfactor() { return (int)PlannerShared::sacfactor(); }
+ bool o2narcotic() { return (int)PlannerShared::o2narcotic(); }
+ int bottompo2() { return (int)PlannerShared::bottompo2(); }
+ int decopo2() { return (int)PlannerShared::decopo2(); }
+ int bestmixend() { return PlannerShared::bestmixend(); }
bool display_runtime() { return prefs.display_runtime; }
bool display_duration() { return prefs.display_duration; }
@@ -237,28 +237,28 @@ public slots:
void set_descrate(int value) { DivePlannerPointsModel::instance()->setDescrateDisplay(value); }
void set_dive_mode(DIVE_MODE value) { DivePlannerPointsModel::instance()->setRebreatherMode((int)value); }
- void set_planner_deco_mode(DECO_MODE value) { plannerShared::set_planner_deco_mode((deco_mode)value); }
- void set_reserve_gas(int value) { plannerShared::set_reserve_gas(value); }
+ void set_planner_deco_mode(DECO_MODE value) { PlannerShared::set_planner_deco_mode((deco_mode)value); }
+ void set_reserve_gas(int value) { PlannerShared::set_reserve_gas(value); }
void set_safetystop(bool value) { DivePlannerPointsModel::instance()->setSafetyStop(value); }
void set_gflow(int value) { DivePlannerPointsModel::instance()->setGFLow(value); }
void set_gfhigh(int value) { DivePlannerPointsModel::instance()->setGFHigh(value); }
void set_vpmb_conservatism(int value) { DivePlannerPointsModel::instance()->setVpmbConservatism(value); }
- void set_dobailout(bool value) { plannerShared::set_dobailout(value); }
+ void set_dobailout(bool value) { PlannerShared::set_dobailout(value); }
void set_drop_stone_mode(bool value) { DivePlannerPointsModel::instance()->setDropStoneMode(value); }
void set_last_stop6m(bool value) { DivePlannerPointsModel::instance()->setLastStop6m(value); }
void set_switch_at_req_stop(bool value) { DivePlannerPointsModel::instance()->setSwitchAtReqStop(value); }
- void set_doo2breaks(bool value) { plannerShared::set_doo2breaks(value); }
- void set_min_switch_duration(int value) { plannerShared::set_min_switch_duration(value); }
- void set_surface_segment(int value) { plannerShared::set_surface_segment(value); }
+ void set_doo2breaks(bool value) { PlannerShared::set_doo2breaks(value); }
+ void set_min_switch_duration(int value) { PlannerShared::set_min_switch_duration(value); }
+ void set_surface_segment(int value) { PlannerShared::set_surface_segment(value); }
- void set_bottomsac(int value) { plannerShared::set_bottomsac((double)value); }
- void set_decosac(int value) { plannerShared::set_decosac((double)value); }
+ void set_bottomsac(int value) { PlannerShared::set_bottomsac((double)value); }
+ void set_decosac(int value) { PlannerShared::set_decosac((double)value); }
void set_problemsolvingtime(int value) { DivePlannerPointsModel::instance()->setProblemSolvingTime(value); }
- void set_sacfactor(int value) { plannerShared::set_sacfactor((double)value); }
- void set_o2narcotic(bool value) { plannerShared::set_o2narcotic(value); }
- void set_bottompo2(int value) { plannerShared::set_bottompo2((double)value); }
- void set_decopo2(int value) { plannerShared::set_decopo2((double)value); }
- void set_bestmixend(int value) { plannerShared::set_bestmixend(value); }
+ void set_sacfactor(int value) { PlannerShared::set_sacfactor((double)value); }
+ void set_o2narcotic(bool value) { PlannerShared::set_o2narcotic(value); }
+ void set_bottompo2(int value) { PlannerShared::set_bottompo2((double)value); }
+ void set_decopo2(int value) { PlannerShared::set_decopo2((double)value); }
+ void set_bestmixend(int value) { PlannerShared::set_bestmixend(value); }
void set_display_runtime(bool value) { DivePlannerPointsModel::instance()->setDisplayRuntime(value); }
void set_display_duration(bool value) { DivePlannerPointsModel::instance()->setDisplayDuration(value); }
diff --git a/tests/testplannershared.cpp b/tests/testplannershared.cpp
index d3de0526d..42cc7e164 100644
--- a/tests/testplannershared.cpp
+++ b/tests/testplannershared.cpp
@@ -77,118 +77,118 @@ void TestPlannerShared::test_planning()
void TestPlannerShared::test_gas()
{
// test independent of metric/imperial
- plannerShared::set_sacfactor(4.2);
+ PlannerShared::set_sacfactor(4.2);
QCOMPARE(qPrefDivePlanner::sacfactor(), 42);
- plannerShared::set_sacfactor(3.5);
+ PlannerShared::set_sacfactor(3.5);
QCOMPARE(qPrefDivePlanner::sacfactor(), 35);
qPrefDivePlanner::set_sacfactor(280);
- QCOMPARE(plannerShared::sacfactor(), 28);
+ QCOMPARE(PlannerShared::sacfactor(), 28);
qPrefDivePlanner::set_sacfactor(200);
- QCOMPARE(plannerShared::sacfactor(), 20);
+ QCOMPARE(PlannerShared::sacfactor(), 20);
// Set system to use meters
qPrefUnits::set_unit_system(METRIC);
- plannerShared::set_bottomsac(30);
+ PlannerShared::set_bottomsac(30);
QCOMPARE(qPrefDivePlanner::bottomsac(), 30000);
- plannerShared::set_bottomsac(5);
+ PlannerShared::set_bottomsac(5);
QCOMPARE(qPrefDivePlanner::bottomsac(), 5000);
qPrefDivePlanner::set_bottomsac(8000);
- QCOMPARE(plannerShared::bottomsac(), 8);
+ QCOMPARE(PlannerShared::bottomsac(), 8);
qPrefDivePlanner::set_bottomsac(10000);
- QCOMPARE(plannerShared::bottomsac(), 10);
+ QCOMPARE(PlannerShared::bottomsac(), 10);
- plannerShared::set_decosac(30);
+ PlannerShared::set_decosac(30);
QCOMPARE(qPrefDivePlanner::decosac(), 30000);
- plannerShared::set_decosac(5);
+ PlannerShared::set_decosac(5);
QCOMPARE(qPrefDivePlanner::decosac(), 5000);
qPrefDivePlanner::set_decosac(8000);
- QCOMPARE(plannerShared::decosac(), 8);
+ QCOMPARE(PlannerShared::decosac(), 8);
qPrefDivePlanner::set_decosac(10000);
- QCOMPARE(plannerShared::decosac(), 10);
+ QCOMPARE(PlannerShared::decosac(), 10);
- plannerShared::set_bottompo2(1.5);
+ PlannerShared::set_bottompo2(1.5);
QCOMPARE(qPrefDivePlanner::bottompo2(), 1500);
- plannerShared::set_bottompo2(1.6);
+ PlannerShared::set_bottompo2(1.6);
QCOMPARE(qPrefDivePlanner::bottompo2(), 1600);
qPrefDivePlanner::set_bottompo2(1200);
- QCOMPARE(plannerShared::bottompo2(), 1.2);
+ QCOMPARE(PlannerShared::bottompo2(), 1.2);
qPrefDivePlanner::set_bottompo2(1000);
- QCOMPARE(plannerShared::bottompo2(), 1.0);
+ QCOMPARE(PlannerShared::bottompo2(), 1.0);
- plannerShared::set_decopo2(1.5);
+ PlannerShared::set_decopo2(1.5);
QCOMPARE(qPrefDivePlanner::decopo2(), 1500);
- plannerShared::set_decopo2(1.6);
+ PlannerShared::set_decopo2(1.6);
QCOMPARE(qPrefDivePlanner::decopo2(), 1600);
qPrefDivePlanner::set_decopo2(1100);
- QCOMPARE(plannerShared::decopo2(), 1.1);
+ QCOMPARE(PlannerShared::decopo2(), 1.1);
qPrefDivePlanner::set_decopo2(1000);
- QCOMPARE(plannerShared::decopo2(), 1.0);
+ QCOMPARE(PlannerShared::decopo2(), 1.0);
- plannerShared::set_bestmixend(16);
+ PlannerShared::set_bestmixend(16);
QCOMPARE(qPrefDivePlanner::bestmixend(), 16000);
- plannerShared::set_bestmixend(7);
+ PlannerShared::set_bestmixend(7);
QCOMPARE(qPrefDivePlanner::bestmixend(), 7000);
qPrefDivePlanner::set_bestmixend(8000);
- QCOMPARE(plannerShared::bestmixend(), 8);
+ QCOMPARE(PlannerShared::bestmixend(), 8);
qPrefDivePlanner::set_bestmixend(10000);
- QCOMPARE(plannerShared::bestmixend(), 10);
+ QCOMPARE(PlannerShared::bestmixend(), 10);
// Set system to use feet
qPrefUnits::set_unit_system(IMPERIAL);
- plannerShared::set_bottomsac(0.9);
+ PlannerShared::set_bottomsac(0.9);
QCOMPARE(qPrefDivePlanner::bottomsac(), 255);
- plannerShared::set_bottomsac(0.01);
+ PlannerShared::set_bottomsac(0.01);
QCOMPARE(qPrefDivePlanner::bottomsac(), 3);
// Remark return will from qPref is in m / 1000.
qPrefDivePlanner::set_bottomsac(2830);
- QCOMPARE(int(plannerShared::bottomsac()), 9);
+ QCOMPARE(int(PlannerShared::bottomsac()), 9);
qPrefDivePlanner::set_bottomsac(16000);
- QCOMPARE(int(plannerShared::bottomsac()), 56);
+ QCOMPARE(int(PlannerShared::bottomsac()), 56);
- plannerShared::set_decosac(0.9);
+ PlannerShared::set_decosac(0.9);
QCOMPARE(qPrefDivePlanner::decosac(), 255);
- plannerShared::set_decosac(0.01);
+ PlannerShared::set_decosac(0.01);
QCOMPARE(qPrefDivePlanner::decosac(), 3);
// Remark return will from qPref is in m / 1000.
qPrefDivePlanner::set_decosac(11500);
- QCOMPARE(int(plannerShared::decosac()), 40);
+ QCOMPARE(int(PlannerShared::decosac()), 40);
qPrefDivePlanner::set_decosac(19800);
- QCOMPARE(int(plannerShared::decosac()), 69);
+ QCOMPARE(int(PlannerShared::decosac()), 69);
// Remark bottompo2 is in BAR, even though unit system is
// Imperial, the desktop version is like that.
- plannerShared::set_bottompo2(1.5);
+ PlannerShared::set_bottompo2(1.5);
QCOMPARE(qPrefDivePlanner::bottompo2(), 1500);
- plannerShared::set_bottompo2(1.6);
+ PlannerShared::set_bottompo2(1.6);
QCOMPARE(qPrefDivePlanner::bottompo2(), 1600);
qPrefDivePlanner::set_bottompo2(1200);
- QCOMPARE(plannerShared::bottompo2(), 1.2);
+ QCOMPARE(PlannerShared::bottompo2(), 1.2);
qPrefDivePlanner::set_bottompo2(1000);
- QCOMPARE(plannerShared::bottompo2(), 1.0);
+ QCOMPARE(PlannerShared::bottompo2(), 1.0);
// Remark decopo2 is in BAR, even though unit system is
// Imperial, the desktop version is like that.
- plannerShared::set_decopo2(1.5);
+ PlannerShared::set_decopo2(1.5);
QCOMPARE(qPrefDivePlanner::decopo2(), 1500);
- plannerShared::set_decopo2(1.6);
+ PlannerShared::set_decopo2(1.6);
QCOMPARE(qPrefDivePlanner::decopo2(), 1600);
qPrefDivePlanner::set_decopo2(1200);
-//Not implemented QCOMPARE(plannerShared::decopo2(), 1.2);
+//Not implemented QCOMPARE(PlannerShared::decopo2(), 1.2);
qPrefDivePlanner::set_decopo2(1000);
- QCOMPARE(plannerShared::decopo2(), 1.0);
+ QCOMPARE(PlannerShared::decopo2(), 1.0);
- plannerShared::set_bestmixend(33);
+ PlannerShared::set_bestmixend(33);
QCOMPARE(qPrefDivePlanner::bestmixend(), 10058);
- plannerShared::set_bestmixend(27);
+ PlannerShared::set_bestmixend(27);
QCOMPARE(qPrefDivePlanner::bestmixend(), 8230);
qPrefDivePlanner::set_bestmixend(11000);
- QCOMPARE(plannerShared::bestmixend(), 36);
+ QCOMPARE(PlannerShared::bestmixend(), 36);
qPrefDivePlanner::set_bestmixend(7000);
- QCOMPARE(plannerShared::bestmixend(), 23);
+ QCOMPARE(PlannerShared::bestmixend(), 23);
// Variables currently not tested
// o2narcotic