mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Probe and expose OSTC3 model information
This looks at the OSTC3 hw descriptor and exposes that model info as a read-only line edit, so you can see in clear text the name of the model of computer. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
94a86df9a3
commit
8946c82242
3 changed files with 173 additions and 124 deletions
|
@ -55,6 +55,13 @@
|
||||||
#define OSTC3_GRAPHICAL_SPEED_INDICATOR 0x40
|
#define OSTC3_GRAPHICAL_SPEED_INDICATOR 0x40
|
||||||
#define OSTC3_ALWAYS_SHOW_PPO2 0x41
|
#define OSTC3_ALWAYS_SHOW_PPO2 0x41
|
||||||
|
|
||||||
|
#define OSTC3_HW_OSTC_3 0x0A
|
||||||
|
#define OSTC3_HW_OSTC_3P 0x1A
|
||||||
|
#define OSTC3_HW_OSTC_CR 0x05
|
||||||
|
#define OSTC3_HW_OSTC_SPORT 0x12
|
||||||
|
#define OSTC3_HW_OSTC_2 0x11
|
||||||
|
|
||||||
|
|
||||||
#define SUUNTO_VYPER_MAXDEPTH 0x1e
|
#define SUUNTO_VYPER_MAXDEPTH 0x1e
|
||||||
#define SUUNTO_VYPER_TOTAL_TIME 0x20
|
#define SUUNTO_VYPER_TOTAL_TIME 0x20
|
||||||
#define SUUNTO_VYPER_NUMBEROFDIVES 0x22
|
#define SUUNTO_VYPER_NUMBEROFDIVES 0x22
|
||||||
|
@ -401,7 +408,34 @@ static dc_status_t read_ostc3_settings(dc_device_t *device, DeviceDetails *m_dev
|
||||||
dc_status_t rc;
|
dc_status_t rc;
|
||||||
dc_event_progress_t progress;
|
dc_event_progress_t progress;
|
||||||
progress.current = 0;
|
progress.current = 0;
|
||||||
progress.maximum = 51;
|
progress.maximum = 52;
|
||||||
|
unsigned char hardware[1];
|
||||||
|
|
||||||
|
//Read hardware type
|
||||||
|
rc = hw_ostc3_device_hardware (device, hardware, sizeof (hardware));
|
||||||
|
if (rc != DC_STATUS_SUCCESS)
|
||||||
|
return rc;
|
||||||
|
EMIT_PROGRESS();
|
||||||
|
|
||||||
|
// FIXME: can we grab this info from libdivecomputer descriptor
|
||||||
|
// instead of hard coded here?
|
||||||
|
switch(hardware[0]) {
|
||||||
|
case OSTC3_HW_OSTC_3:
|
||||||
|
m_deviceDetails->model = "3";
|
||||||
|
break;
|
||||||
|
case OSTC3_HW_OSTC_3P:
|
||||||
|
m_deviceDetails->model = "3+";
|
||||||
|
break;
|
||||||
|
case OSTC3_HW_OSTC_CR:
|
||||||
|
m_deviceDetails->model = "CR";
|
||||||
|
break;
|
||||||
|
case OSTC3_HW_OSTC_SPORT:
|
||||||
|
m_deviceDetails->model = "Sport";
|
||||||
|
break;
|
||||||
|
case OSTC3_HW_OSTC_2:
|
||||||
|
m_deviceDetails->model = "2";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
//Read gas mixes
|
//Read gas mixes
|
||||||
gas gas1;
|
gas gas1;
|
||||||
|
|
|
@ -802,6 +802,7 @@ void ConfigureDiveComputerDialog::reloadValuesOSTC3()
|
||||||
ui.serialNoLineEdit->setText(deviceDetails->serialNo);
|
ui.serialNoLineEdit->setText(deviceDetails->serialNo);
|
||||||
ui.firmwareVersionLineEdit->setText(deviceDetails->firmwareVersion);
|
ui.firmwareVersionLineEdit->setText(deviceDetails->firmwareVersion);
|
||||||
ui.customTextLlineEdit->setText(deviceDetails->customText);
|
ui.customTextLlineEdit->setText(deviceDetails->customText);
|
||||||
|
ui.modelLineEdit->setText(deviceDetails->model);
|
||||||
ui.diveModeComboBox->setCurrentIndex(deviceDetails->diveMode);
|
ui.diveModeComboBox->setCurrentIndex(deviceDetails->diveMode);
|
||||||
ui.saturationSpinBox->setValue(deviceDetails->saturation);
|
ui.saturationSpinBox->setValue(deviceDetails->saturation);
|
||||||
ui.desaturationSpinBox->setValue(deviceDetails->desaturation);
|
ui.desaturationSpinBox->setValue(deviceDetails->desaturation);
|
||||||
|
|
|
@ -253,7 +253,7 @@
|
||||||
<string>Basic settings</string>
|
<string>Basic settings</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="4">
|
<item row="2" column="4">
|
||||||
<widget class="QComboBox" name="languageComboBox">
|
<widget class="QComboBox" name="languageComboBox">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -277,7 +277,7 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="4">
|
<item row="6" column="4">
|
||||||
<widget class="QComboBox" name="unitsComboBox">
|
<widget class="QComboBox" name="unitsComboBox">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -331,30 +331,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="3">
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>Custom text</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>customTextLlineEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" colspan="2">
|
|
||||||
<widget class="QLineEdit" name="customTextLlineEdit">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
|
||||||
<horstretch>1</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maxLength">
|
|
||||||
<number>60</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="3">
|
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Language</string>
|
<string>Language</string>
|
||||||
|
@ -364,41 +341,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="3" column="4">
|
||||||
<widget class="QComboBox" name="diveModeComboBox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>OC</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>CC</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Gauge</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Apnea</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="4">
|
|
||||||
<widget class="QComboBox" name="dateFormatComboBox">
|
<widget class="QComboBox" name="dateFormatComboBox">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -417,17 +360,7 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="3">
|
<item row="5" column="4">
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="text">
|
|
||||||
<string>Date format</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>dateFormatComboBox</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="4">
|
|
||||||
<widget class="QComboBox" name="brightnessComboBox">
|
<widget class="QComboBox" name="brightnessComboBox">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -446,7 +379,17 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="3">
|
<item row="3" column="3">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="text">
|
||||||
|
<string>Date format</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>dateFormatComboBox</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="3">
|
||||||
<widget class="QLabel" name="label_10">
|
<widget class="QLabel" name="label_10">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Brightness</string>
|
<string>Brightness</string>
|
||||||
|
@ -456,7 +399,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="3">
|
<item row="6" column="3">
|
||||||
<widget class="QLabel" name="label_12">
|
<widget class="QLabel" name="label_12">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Units</string>
|
<string>Units</string>
|
||||||
|
@ -466,7 +409,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="3">
|
<item row="7" column="3">
|
||||||
<widget class="QLabel" name="label_14">
|
<widget class="QLabel" name="label_14">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Salinity (0-5%)</string>
|
<string>Salinity (0-5%)</string>
|
||||||
|
@ -476,7 +419,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="4">
|
<item row="7" column="4">
|
||||||
<widget class="QSpinBox" name="salinitySpinBox">
|
<widget class="QSpinBox" name="salinitySpinBox">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>%</string>
|
<string>%</string>
|
||||||
|
@ -486,21 +429,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="8" column="4">
|
||||||
<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="7" column="4">
|
|
||||||
<widget class="QComboBox" name="compassGainComboBox">
|
<widget class="QComboBox" name="compassGainComboBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
@ -550,7 +479,7 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="2">
|
<item row="9" column="2">
|
||||||
<spacer name="verticalSpacer1">
|
<spacer name="verticalSpacer1">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -563,7 +492,98 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="11" column="3" colspan="2">
|
||||||
|
<widget class="QPushButton" name="resetButton">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset device to default settings</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" 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>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Custom text</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>customTextLlineEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" colspan="2">
|
||||||
|
<widget class="QLineEdit" name="customTextLlineEdit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>60</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="3">
|
||||||
|
<widget class="QLabel" name="label_62">
|
||||||
|
<property name="text">
|
||||||
|
<string>Computer model</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<widget class="QLineEdit" name="modelLineEdit">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</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>
|
||||||
|
<property name="text">
|
||||||
|
<string>OC</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>CC</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Gauge</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Apnea</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_11">
|
<widget class="QLabel" name="label_11">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Sampling rate</string>
|
<string>Sampling rate</string>
|
||||||
|
@ -573,6 +593,30 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" 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">
|
<item row="5" column="1">
|
||||||
<widget class="QComboBox" name="diveModeColour">
|
<widget class="QComboBox" name="diveModeColour">
|
||||||
<item>
|
<item>
|
||||||
|
@ -604,16 +648,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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">
|
<item row="7" column="0" colspan="3">
|
||||||
<widget class="QCheckBox" name="safetyStopCheckBox">
|
<widget class="QCheckBox" name="safetyStopCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -621,26 +655,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="3" colspan="2">
|
|
||||||
<widget class="QPushButton" name="resetButton">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Reset device to default settings</string>
|
|
||||||
</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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="advancedSettings">
|
<widget class="QWidget" name="advancedSettings">
|
||||||
|
|
Loading…
Add table
Reference in a new issue