Enable the configuration of more OSTC3 settings

This enables enables you to configure a couple of new settings in the
OSTC3 devices.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2015-09-03 00:00:00 +02:00 committed by Dirk Hohndel
parent c69d5619ce
commit 37953d163e
6 changed files with 316 additions and 108 deletions

View file

@ -182,6 +182,14 @@ bool ConfigureDiveComputer::saveXMLBackup(QString fileName, DeviceDetails *detai
writer.writeTextElement("CalibrationGas", QString::number(details->calibrationGas));
writer.writeTextElement("FlipScreen", QString::number(details->flipScreen));
writer.writeTextElement("SetPointFallback", QString::number(details->setPointFallback));
writer.writeTextElement("LeftButtonSensitivity", QString::number(details->leftButtonSensitivity));
writer.writeTextElement("RightButtonSensitivity", QString::number(details->rightButtonSensitivity));
writer.writeTextElement("BottomGasConsumption", QString::number(details->bottomGasConsumption));
writer.writeTextElement("DecoGasConsumption", QString::number(details->decoGasConsumption));
writer.writeTextElement("ModWarning", QString::number(details->modWarning));
writer.writeTextElement("DynamicAscendRate", QString::number(details->dynamicAscendRate));
writer.writeTextElement("GraphicalSpeedIndicator", QString::number(details->graphicalSpeedIndicator));
writer.writeTextElement("AlwaysShowppO2", QString::number(details->alwaysShowppO2));
// Suunto vyper settings.
writer.writeTextElement("Altitude", QString::number(details->altitude));
@ -463,6 +471,30 @@ bool ConfigureDiveComputer::restoreXMLBackup(QString fileName, DeviceDetails *de
if (settingName == "SetPointFallback")
details->setPointFallback = keyString.toInt();
if (settingName == "LeftButtonSensitivity")
details->leftButtonSensitivity = keyString.toInt();
if (settingName == "RightButtonSensitivity")
details->rightButtonSensitivity = keyString.toInt();
if (settingName == "BottomGasConsumption")
details->bottomGasConsumption = keyString.toInt();
if (settingName == "DecoGasConsumption")
details->decoGasConsumption = keyString.toInt();
if (settingName == "ModWarning")
details->modWarning = keyString.toInt();
if (settingName == "DynamicAscendRate")
details->dynamicAscendRate = keyString.toInt();
if (settingName == "GraphicalSpeedIndicator")
details->graphicalSpeedIndicator = keyString.toInt();
if (settingName == "AlwaysShowppO2")
details->alwaysShowppO2 = keyString.toInt();
if (settingName == "Altitude")
details->altitude = keyString.toInt();

View file

@ -46,6 +46,14 @@
#define OSTC3_CALIBRATION_GAS_O2 0x37
#define OSTC3_SETPOINT_FALLBACK 0x38
#define OSTC3_FLIP_SCREEN 0x39
#define OSTC3_LEFT_BUTTON_SENSIVITY 0x3A
#define OSTC3_RIGHT_BUTTON_SENSIVITY 0x3A
#define OSTC3_BOTTOM_GAS_CONSUMPTION 0x3C
#define OSTC3_DECO_GAS_CONSUMPTION 0x3D
#define OSTC3_MOD_WARNING 0x3E
#define OSTC3_DYNAMIC_ASCEND_RATE 0x3F
#define OSTC3_GRAPHICAL_SPEED_INDICATOR 0x40
#define OSTC3_ALWAYS_SHOW_PPO2 0x41
#define SUUNTO_VYPER_MAXDEPTH 0x1e
#define SUUNTO_VYPER_TOTAL_TIME 0x20
@ -582,6 +590,14 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
READ_SETTING(OSTC3_CALIBRATION_GAS_O2, calibrationGas);
READ_SETTING(OSTC3_FLIP_SCREEN, flipScreen);
READ_SETTING(OSTC3_SETPOINT_FALLBACK, setPointFallback);
READ_SETTING(OSTC3_LEFT_BUTTON_SENSIVITY, leftButtonSensitivity);
READ_SETTING(OSTC3_RIGHT_BUTTON_SENSIVITY, rightButtonSensitivity);
READ_SETTING(OSTC3_BOTTOM_GAS_CONSUMPTION, bottomGasConsumption);
READ_SETTING(OSTC3_DECO_GAS_CONSUMPTION, decoGasConsumption);
READ_SETTING(OSTC3_MOD_WARNING, modWarning);
READ_SETTING(OSTC3_DYNAMIC_ASCEND_RATE, dynamicAscendRate);
READ_SETTING(OSTC3_GRAPHICAL_SPEED_INDICATOR, graphicalSpeedIndicator);
READ_SETTING(OSTC3_ALWAYS_SHOW_PPO2, alwaysShowppO2);
#undef READ_SETTING
@ -808,6 +824,14 @@ static dc_status_t write_ostc3_settings(dc_device_t *device, DeviceDetails *m_de
WRITE_SETTING(OSTC3_CALIBRATION_GAS_O2, calibrationGas);
WRITE_SETTING(OSTC3_FLIP_SCREEN, flipScreen);
WRITE_SETTING(OSTC3_SETPOINT_FALLBACK, setPointFallback);
WRITE_SETTING(OSTC3_LEFT_BUTTON_SENSIVITY, leftButtonSensitivity);
WRITE_SETTING(OSTC3_RIGHT_BUTTON_SENSIVITY, rightButtonSensitivity);
WRITE_SETTING(OSTC3_BOTTOM_GAS_CONSUMPTION, bottomGasConsumption);
WRITE_SETTING(OSTC3_DECO_GAS_CONSUMPTION, decoGasConsumption);
WRITE_SETTING(OSTC3_MOD_WARNING, modWarning);
WRITE_SETTING(OSTC3_DYNAMIC_ASCEND_RATE, dynamicAscendRate);
WRITE_SETTING(OSTC3_GRAPHICAL_SPEED_INDICATOR, graphicalSpeedIndicator);
WRITE_SETTING(OSTC3_ALWAYS_SHOW_PPO2, alwaysShowppO2);
#undef WRITE_SETTING

View file

@ -65,6 +65,14 @@ DeviceDetails::DeviceDetails(QObject *parent) :
alarmTimeEnabled(false),
alarmTime(0),
alarmDepthEnabled(false),
alarmDepth(0)
alarmDepth(0),
leftButtonSensitivity(0),
rightButtonSensitivity(0),
bottomGasConsumption(0),
decoGasConsumption(0),
modWarning(false),
dynamicAscendRate(false),
graphicalSpeedIndicator(false),
alwaysShowppO2(false)
{
}

View file

@ -83,6 +83,14 @@ public:
int alarmTime;
bool alarmDepthEnabled;
int alarmDepth;
int leftButtonSensitivity;
int rightButtonSensitivity;
int bottomGasConsumption;
int decoGasConsumption;
bool modWarning;
bool dynamicAscendRate;
bool graphicalSpeedIndicator;
bool alwaysShowppO2;
};

View file

@ -432,6 +432,14 @@ void ConfigureDiveComputerDialog::populateDeviceDetailsOSTC3()
deviceDetails->calibrationGas = ui.calibrationGasSpinBox->value();
deviceDetails->flipScreen = ui.flipScreenCheckBox->isChecked();
deviceDetails->setPointFallback = ui.setPointFallbackCheckBox->isChecked();
deviceDetails->leftButtonSensitivity = ui.leftButtonSensitivity->value();
deviceDetails->rightButtonSensitivity = ui.rightButtonSensitivity->value();
deviceDetails->bottomGasConsumption = ui.bottomGasConsumption->value();
deviceDetails->decoGasConsumption = ui.decoGasConsumption->value();
deviceDetails->modWarning = ui.modWarning->isChecked();
deviceDetails->dynamicAscendRate = ui.dynamicAscendRate->isChecked();
deviceDetails->graphicalSpeedIndicator = ui.graphicalSpeedIndicator->isChecked();
deviceDetails->alwaysShowppO2 = ui.alwaysShowppO2->isChecked();
//set gas values
gas gas1;
@ -796,6 +804,14 @@ void ConfigureDiveComputerDialog::reloadValuesOSTC3()
ui.calibrationGasSpinBox->setValue(deviceDetails->calibrationGas);
ui.flipScreenCheckBox->setChecked(deviceDetails->flipScreen);
ui.setPointFallbackCheckBox->setChecked(deviceDetails->setPointFallback);
ui.leftButtonSensitivity->setValue(deviceDetails->leftButtonSensitivity);
ui.rightButtonSensitivity->setValue(deviceDetails->rightButtonSensitivity);
ui.bottomGasConsumption->setValue(deviceDetails->bottomGasConsumption);
ui.decoGasConsumption->setValue(deviceDetails->decoGasConsumption);
ui.modWarning->setChecked(deviceDetails->modWarning);
ui.dynamicAscendRate->setChecked(deviceDetails->dynamicAscendRate);
ui.graphicalSpeedIndicator->setChecked(deviceDetails->graphicalSpeedIndicator);
ui.alwaysShowppO2->setChecked(deviceDetails->alwaysShowppO2);
//load gas 1 values
ui.ostc3GasTable->setItem(0, 1, new QTableWidgetItem(QString::number(deviceDetails->gas1.oxygen)));

View file

@ -224,6 +224,44 @@
<string>Basic settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="4">
<widget class="QComboBox" name="languageComboBox">
<item>
<property name="text">
<string>English</string>
</property>
</item>
<item>
<property name="text">
<string>German</string>
</property>
</item>
<item>
<property name="text">
<string>French</string>
</property>
</item>
<item>
<property name="text">
<string>Italian</string>
</property>
</item>
</widget>
</item>
<item row="5" column="4">
<widget class="QComboBox" name="unitsComboBox">
<item>
<property name="text">
<string>m/°C</string>
</property>
</item>
<item>
<property name="text">
<string>ft/°F</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@ -297,40 +335,6 @@
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QComboBox" name="languageComboBox">
<item>
<property name="text">
<string>English</string>
</property>
</item>
<item>
<property name="text">
<string>German</string>
</property>
</item>
<item>
<property name="text">
<string>French</string>
</property>
</item>
<item>
<property name="text">
<string>Italian</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Dive mode</string>
</property>
<property name="buddy">
<cstring>diveModeComboBox</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="diveModeComboBox">
<item>
@ -355,13 +359,13 @@
</item>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_6">
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Date format</string>
<string>Dive mode</string>
</property>
<property name="buddy">
<cstring>dateFormatComboBox</cstring>
<cstring>diveModeComboBox</cstring>
</property>
</widget>
</item>
@ -384,13 +388,13 @@
</item>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_10">
<item row="2" column="3">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Brightness</string>
<string>Date format</string>
</property>
<property name="buddy">
<cstring>brightnessComboBox</cstring>
<cstring>dateFormatComboBox</cstring>
</property>
</widget>
</item>
@ -413,6 +417,16 @@
</item>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Brightness</string>
</property>
<property name="buddy">
<cstring>brightnessComboBox</cstring>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_12">
<property name="text">
@ -423,20 +437,6 @@
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QComboBox" name="unitsComboBox">
<item>
<property name="text">
<string>m/°C</string>
</property>
</item>
<item>
<property name="text">
<string>ft/°F</string>
</property>
</item>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_14">
<property name="text">
@ -457,14 +457,18 @@
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QLabel" name="label_15">
<item row="4" column="1">
<widget class="QComboBox" name="samplingRateComboBox">
<item>
<property name="text">
<string>Compass gain</string>
<string>2s</string>
</property>
<property name="buddy">
<cstring>compassGainComboBox</cstring>
</item>
<item>
<property name="text">
<string>10s</string>
</property>
</item>
</widget>
</item>
<item row="7" column="4">
@ -540,30 +544,6 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="samplingRateComboBox">
<item>
<property name="text">
<string>2s</string>
</property>
</item>
<item>
<property name="text">
<string>10s</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Dive mode color</string>
</property>
<property name="buddy">
<cstring>diveModeColour</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="diveModeColour">
<item>
@ -595,6 +575,16 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Dive mode color</string>
</property>
<property name="buddy">
<cstring>diveModeColour</cstring>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3">
<widget class="QCheckBox" name="safetyStopCheckBox">
<property name="text">
@ -612,6 +602,16 @@
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Compass gain</string>
</property>
<property name="buddy">
<cstring>compassGainComboBox</cstring>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="advancedSettings">
@ -619,6 +619,20 @@
<string>Advanced settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout1">
<item row="10" column="3">
<widget class="QLabel" name="label_43">
<property name="text">
<string>Left button sensitivity</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<widget class="QCheckBox" name="alwaysShowppO2">
<property name="text">
<string>Always show ppO2</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="aGFSelectableCheckBox">
<property name="text">
@ -712,7 +726,7 @@
</property>
</widget>
</item>
<item row="13" column="0">
<item row="14" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -777,16 +791,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="futureTTSSpinBox">
<property name="suffix">
<string> min</string>
</property>
<property name="maximum">
<number>9</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="decoTypeComboBox">
<property name="currentIndex">
@ -804,6 +808,16 @@
</item>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="futureTTSSpinBox">
<property name="suffix">
<string> min</string>
</property>
<property name="maximum">
<number>9</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
@ -830,6 +844,13 @@
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Alt GFLow</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QSpinBox" name="aGFHighSpinBox">
<property name="enabled">
@ -849,6 +870,13 @@
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_37">
<property name="text">
<string>Alt GFHigh</string>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QLabel" name="label_7">
<property name="text">
@ -859,24 +887,116 @@
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_36">
<item row="6" column="0">
<widget class="QCheckBox" name="flipScreenCheckBox">
<property name="text">
<string>Alt GFLow</string>
<string>Flip screen</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_37">
<item row="11" column="3">
<widget class="QLabel" name="label_44">
<property name="text">
<string>Alt GFHigh</string>
<string>Right button sensitivity</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="flipScreenCheckBox">
<widget class="QCheckBox" name="modWarning">
<property name="text">
<string>Flip screen</string>
<string>Mod warning</string>
</property>
</widget>
</item>
<item row="10" column="0" colspan="2">
<widget class="QCheckBox" name="graphicalSpeedIndicator">
<property name="text">
<string>Graphical speed indicator</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="dynamicAscendRate">
<property name="text">
<string>Dynamic acend rate</string>
</property>
</widget>
</item>
<item row="12" column="3">
<widget class="QLabel" name="label_46">
<property name="text">
<string>Bottom gas consumption</string>
</property>
</widget>
</item>
<item row="13" column="3">
<widget class="QLabel" name="label_48">
<property name="text">
<string>Deco gas consumption</string>
</property>
</widget>
</item>
<item row="10" column="4">
<widget class="QSpinBox" name="leftButtonSensitivity">
<property name="suffix">
<string>%</string>
</property>
<property name="minimum">
<number>20</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>40</number>
</property>
</widget>
</item>
<item row="11" column="4">
<widget class="QSpinBox" name="rightButtonSensitivity">
<property name="suffix">
<string>%</string>
</property>
<property name="minimum">
<number>20</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>40</number>
</property>
</widget>
</item>
<item row="12" column="4">
<widget class="QSpinBox" name="bottomGasConsumption">
<property name="suffix">
<string> l/m</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>
<item row="13" column="4">
<widget class="QSpinBox" name="decoGasConsumption">
<property name="suffix">
<string> l/m</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>