2016-01-11 21:40:07 +00:00
|
|
|
#include "SettingsObjectWrapper.h"
|
|
|
|
#include <QSettings>
|
|
|
|
|
|
|
|
static QString tecDetails = QStringLiteral("TecDetails");
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::showPo2() const
|
|
|
|
{
|
|
|
|
return prefs.pp_graphs.po2;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::showPn2() const
|
|
|
|
{
|
|
|
|
return prefs.pp_graphs.pn2;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::showPhe() const
|
|
|
|
{
|
|
|
|
return prefs.pp_graphs.phe;
|
|
|
|
}
|
|
|
|
|
|
|
|
double PartialPressureGasSettings::po2Threshold() const
|
|
|
|
{
|
|
|
|
return prefs.pp_graphs.po2_threshold;
|
|
|
|
}
|
|
|
|
|
|
|
|
double PartialPressureGasSettings::pn2Threshold() const
|
|
|
|
{
|
|
|
|
return prefs.pp_graphs.pn2_threshold;
|
|
|
|
}
|
|
|
|
|
|
|
|
double PartialPressureGasSettings::pheThreshold() const
|
|
|
|
{
|
|
|
|
return prefs.pp_graphs.phe_threshold;
|
|
|
|
}
|
|
|
|
|
2016-01-11 21:58:33 +00:00
|
|
|
double PartialPressureGasSettings:: modp02() const
|
|
|
|
{
|
|
|
|
return prefs.modpO2;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::ead() const
|
|
|
|
{
|
|
|
|
return prefs.ead;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::dcceiling() const
|
|
|
|
{
|
|
|
|
return prefs.dcceiling;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::redceiling() const
|
|
|
|
{
|
|
|
|
return prefs.redceiling;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::calcceiling() const
|
|
|
|
{
|
|
|
|
return prefs.calcceiling;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::calcceiling3m() const
|
|
|
|
{
|
|
|
|
return prefs.calcceiling3m;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::calcalltissues() const
|
|
|
|
{
|
|
|
|
return prefs.calcalltissues;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::calcndltts() const
|
|
|
|
{
|
|
|
|
return prefs.calcndltts;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::gflow() const
|
|
|
|
{
|
|
|
|
return prefs.gflow;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::gfhigh() const
|
|
|
|
{
|
|
|
|
return prefs.gfhigh;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::hrgraph() const
|
|
|
|
{
|
|
|
|
return prefs.hrgraph;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::tankBar() const
|
|
|
|
{
|
|
|
|
return prefs.tankbar;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::percentageGraph() const
|
|
|
|
{
|
|
|
|
return prefs.percentagegraph;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::rulerGraph() const
|
|
|
|
{
|
|
|
|
return prefs.rulergraph;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PartialPressureGasSettings::showCCRSetpoint() const
|
|
|
|
{
|
|
|
|
return prefs.show_ccr_setpoint;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PartialPressureGasSettings::showCCRSensors() const
|
|
|
|
{
|
|
|
|
return prefs.show_ccr_sensors;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::zoomedPlot() const
|
|
|
|
{
|
|
|
|
return prefs.zoomed_plot;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::showSac() const
|
|
|
|
{
|
|
|
|
return prefs.show_sac;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool PartialPressureGasSettings::gfLowAtMaxDepth() const
|
|
|
|
{
|
|
|
|
return prefs.gf_low_at_maxdepth;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::displayUnusedTanks() const
|
|
|
|
{
|
|
|
|
return prefs.display_unused_tanks;
|
|
|
|
}
|
|
|
|
|
|
|
|
short PartialPressureGasSettings::showAverageDepth() const
|
|
|
|
{
|
|
|
|
return prefs.show_average_depth;
|
|
|
|
}
|
|
|
|
|
2016-01-11 22:33:50 +00:00
|
|
|
short int PartialPressureGasSettings::mod() const
|
|
|
|
{
|
|
|
|
return prefs.mod;
|
|
|
|
}
|
|
|
|
|
2016-01-11 21:40:07 +00:00
|
|
|
void PartialPressureGasSettings::setShowPo2(short value)
|
|
|
|
{
|
|
|
|
QSettings s;
|
|
|
|
s.beginGroup(tecDetails);
|
|
|
|
s.setValue("po2graph", value);
|
|
|
|
prefs.pp_graphs.po2 = value;
|
|
|
|
emit showPo2Changed(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PartialPressureGasSettings::setShowPn2(short value)
|
|
|
|
{
|
|
|
|
QSettings s;
|
|
|
|
s.beginGroup(tecDetails);
|
|
|
|
s.setValue("pn2graph", value);
|
|
|
|
prefs.pp_graphs.pn2 = value;
|
|
|
|
emit showPn2Changed(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PartialPressureGasSettings::setShowPhe(short value)
|
|
|
|
{
|
|
|
|
QSettings s;
|
|
|
|
s.beginGroup(tecDetails);
|
|
|
|
s.setValue("phegraph", value);
|
|
|
|
prefs.pp_graphs.phe = value;
|
|
|
|
emit showPheChanged(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PartialPressureGasSettings::setPo2Threshold(double value)
|
|
|
|
{
|
|
|
|
QSettings s;
|
|
|
|
s.beginGroup(tecDetails);
|
|
|
|
s.setValue("po2threshold", value);
|
|
|
|
prefs.pp_graphs.po2_threshold = value;
|
|
|
|
emit po2ThresholdChanged(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PartialPressureGasSettings::setPn2Threshold(double value)
|
|
|
|
{
|
|
|
|
QSettings s;
|
|
|
|
s.beginGroup(tecDetails);
|
|
|
|
s.setValue("pn2threshold", value);
|
|
|
|
prefs.pp_graphs.pn2_threshold = value;
|
|
|
|
emit pn2ThresholdChanged(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PartialPressureGasSettings::setPheThreshold(double value)
|
|
|
|
{
|
|
|
|
QSettings s;
|
|
|
|
s.beginGroup(tecDetails);
|
|
|
|
s.setValue("phethreshold", value);
|
|
|
|
prefs.pp_graphs.phe_threshold = value;
|
|
|
|
emit pheThresholdChanged(value);
|
|
|
|
}
|
2016-01-11 22:33:50 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|