diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-11 20:33:50 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-11 15:47:07 -0800 |
commit | 752a03eeb133ee030e2bc63b7bcf521d841bcb22 (patch) | |
tree | 85fc1e1646016fffd8e19fc3a706c410ffe2681a | |
parent | 0cfd687799056572d472c82d4422fc677d1841e0 (diff) | |
download | subsurface-752a03eeb133ee030e2bc63b7bcf521d841bcb22.tar.gz |
Finish PartialPressureGasSettings
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp | 207 | ||||
-rw-r--r-- | subsurface-core/subsurface-qt/SettingsObjectWrapper.h | 26 |
2 files changed, 232 insertions, 1 deletions
diff --git a/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp b/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp index a08e6aec1..8bb5877d3 100644 --- a/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp +++ b/subsurface-core/subsurface-qt/SettingsObjectWrapper.cpp @@ -138,6 +138,11 @@ short PartialPressureGasSettings::showAverageDepth() const return prefs.show_average_depth; } +short int PartialPressureGasSettings::mod() const +{ + return prefs.mod; +} + void PartialPressureGasSettings::setShowPo2(short value) { QSettings s; @@ -191,3 +196,205 @@ void PartialPressureGasSettings::setPheThreshold(double value) prefs.pp_graphs.phe_threshold = value; emit pheThresholdChanged(value); } + +void PartialPressureGasSettings::setModpO2(double value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("modpO2", value); + prefs.modpO2 = value; + emit modpO2Changed(value); +} + +void PartialPressureGasSettings::setEad(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("ead", value); + prefs.ead = value; + emit eadChanged(value); +} + +void PartialPressureGasSettings::setMod(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("mod", value); + prefs.mod = value; + emit modChanged(value); +} + +void PartialPressureGasSettings::setDcceiling(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("dcceiling", value); + prefs.dcceiling = value; + emit dcceilingChanged(value); +} + +void PartialPressureGasSettings::setRedceiling(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("redceiling", value); + prefs.redceiling = value; + emit redceilingChanged(value); +} + +void PartialPressureGasSettings::setCalcceiling(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("calcceiling", value); + prefs.calcceiling = value; + emit calcceilingChanged(value); +} + +void PartialPressureGasSettings::setCalcceiling3m(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("calcceiling3m", value); + prefs.calcceiling3m = value; + emit calcceiling3mChanged(value); +} + +void PartialPressureGasSettings::setCalcalltissues(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("calcalltissues", value); + prefs.calcalltissues = value; + emit calcalltissuesChanged(value); +} + +void PartialPressureGasSettings::setCalcndltts(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("calcndltts", value); + prefs.calcndltts = value; + emit calcndlttsChanged(value); +} + +void PartialPressureGasSettings::setGflow(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("gflow", value); + prefs.gflow = value; + set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth); + emit gflowChanged(value); +} + +void PartialPressureGasSettings::setGfhigh(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("gfhigh", value); + prefs.gfhigh = value; + set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth); + emit gfhighChanged(value); +} + +void PartialPressureGasSettings::setHRgraph(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("hrgraph", value); + prefs.hrgraph = value; + emit hrgraphChanged(value); +} + +void PartialPressureGasSettings::setTankBar(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("tankbar", value); + prefs.tankbar = value; + emit tankBarChanged(value); +} + +void PartialPressureGasSettings::setPercentageGraph(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("percentagegraph", value); + prefs.percentagegraph = value; + emit percentageGraphChanged(value); +} + +void PartialPressureGasSettings::setRulerGraph(short value) +{ + /* TODO: search for the QSettings of the RulerBar */ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("phethreshold", value); + prefs.pp_graphs.phe_threshold = value; + emit pheThresholdChanged(value); +} + +void PartialPressureGasSettings::setShowCCRSetpoint(bool value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("show_ccr_setpoint", value); + prefs.show_ccr_setpoint = value; + emit showCCRSetpointChanged(value); +} + +void PartialPressureGasSettings::setShowCCRSensors(bool value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("show_ccr_sensors", value); + prefs.show_ccr_sensors = value; + emit showCCRSensorsChanged(value); +} + +void PartialPressureGasSettings::setZoomedPlot(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("zoomed_plot", value); + prefs.zoomed_plot = value; + emit zoomedPlotChanged(value); +} + +void PartialPressureGasSettings::setShowSac(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("show_sac", value); + prefs.show_sac = value; + emit showSacChanged(value); +} + +void PartialPressureGasSettings::setGfLowAtMaxDepth(bool value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("gf_low_at_maxdepth", value); + prefs.gf_low_at_maxdepth = value; + set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth); + emit gfLowAtMaxDepthChanged(value); +} + +void PartialPressureGasSettings::setDisplayUnusedTanks(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("display_unused_tanks", value); + prefs.display_unused_tanks = value; + emit displayUnusedTanksChanged(value); +} + +void PartialPressureGasSettings::setShowAverageDepth(short value) +{ + QSettings s; + s.beginGroup(tecDetails); + s.setValue("show_average_depth", value); + prefs.show_average_depth = value; + emit showAverageDepthChanged(value); +} diff --git a/subsurface-core/subsurface-qt/SettingsObjectWrapper.h b/subsurface-core/subsurface-qt/SettingsObjectWrapper.h index b65ad9c12..411a4567e 100644 --- a/subsurface-core/subsurface-qt/SettingsObjectWrapper.h +++ b/subsurface-core/subsurface-qt/SettingsObjectWrapper.h @@ -22,6 +22,7 @@ class PartialPressureGasSettings : public QObject { Q_PROPERTY(double phe_threshold READ pheThreshold WRITE setPheThreshold NOTIFY pheThresholdChanged) Q_PROPERTY(double modpO2 READ modp02 WRITE setModp02 NOTIFY modpO2Changed) Q_PROPERTY(short ead READ ead WRITE setEad NOTIFY eadChanged) + Q_PROPERTY(short mod READ mod WRITE setMod NOTIFY modChanged); Q_PROPERTY(short dcceiling READ dcceiling WRITE setDCceiling NOTIFY dcceilingChanged) Q_PROPERTY(short redceiling READ redceiling WRITE setRedceiling NOTIFY redceilingChanged) Q_PROPERTY(short calcceiling READ calcceiling WRITE setCalcceiling NOTIFY calcceilingChanged) @@ -52,6 +53,7 @@ public: double pheThreshold() const; double modp02() const; short ead() const; + short mod() const; short dcceiling() const; short redceiling() const; short calcceiling() const; @@ -79,6 +81,28 @@ public slots: void setPo2Threshold(double value); void setPn2Threshold(double value); void setPheThreshold(double value); + void setMod(short value); + void setModp02(double value); + void setEad(short value); + void setDCceiling(short value); + void setRedceiling(short value); + void setCalcceiling(short value); + void setCalcceiling3m(short value); + void setCalcalltissues(short value); + void setCalcndltts(short value); + void setGflow(short value); + void setGfhigh(short value); + void setHRgraph(short value); + void setTankBar(short value); + void setPercentageGraph(short value); + void setRulerGraph(short value); + void setShowCCRSetpoint(bool value); + void setShowCCRSensors(bool value); + void setZoomedPlot(short value); + void setShowSac(short value); + void setGfLowAtMaxDepth(bool value); + void setDisplayUnusedTanks(short value); + void setShowAverageDepth(short value); signals: void showPo2Changed(short value); @@ -89,6 +113,7 @@ signals: void pheThresholdChanged(double value); void modpO2Changed(double value); void eadChanged(short value); + void modChanged(short value); void dcceilingChanged(short value); void redceilingChanged(short value); void calcceilingChanged(short value); @@ -174,7 +199,6 @@ class SettingsObjectWrapper : public QObject { Q_PROPERTY(bool time_format_override READ timeFormatOverride WRITE setTimeFormatOverride NOTIFY timeFormatOverrideChanged) Q_PROPERTY(bool date_format_override READ dateFormatOverride WRITE setDateFormatOverride NOTIFY dateFormatOverrideChanged) Q_PROPERTY(double font_size READ fontSize WRITE setFontSize NOTIFY fontSizeChanged) - Q_PROPERTY(short mod READ mod WRITE setMod NOTIFY modChanged); Q_PROPERTY(int animation_speed READ animationSpeed WRITE setAnimationSpeed NOTIFY animationSpeedChanged) Q_PROPERTY(short display_invalid_dives READ displayInvalidDives WRITE setDisplayInvalidDives NOTIFY displayInvalidDivesChanged) Q_PROPERTY(short unit_system READ unitSystem WRITE setUnitSystem NOTIFY uintSystemChanged) |