diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp index 2c6583e04..00ab07f53 100644 --- a/configuredivecomputerthreads.cpp +++ b/configuredivecomputerthreads.cpp @@ -55,6 +55,13 @@ #define OSTC3_GRAPHICAL_SPEED_INDICATOR 0x40 #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_TOTAL_TIME 0x20 #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_event_progress_t progress; 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 gas gas1; diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index a6017e92a..eb790e6d3 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -802,6 +802,7 @@ void ConfigureDiveComputerDialog::reloadValuesOSTC3() ui.serialNoLineEdit->setText(deviceDetails->serialNo); ui.firmwareVersionLineEdit->setText(deviceDetails->firmwareVersion); ui.customTextLlineEdit->setText(deviceDetails->customText); + ui.modelLineEdit->setText(deviceDetails->model); ui.diveModeComboBox->setCurrentIndex(deviceDetails->diveMode); ui.saturationSpinBox->setValue(deviceDetails->saturation); ui.desaturationSpinBox->setValue(deviceDetails->desaturation); diff --git a/qt-ui/configuredivecomputerdialog.ui b/qt-ui/configuredivecomputerdialog.ui index f7820f7bd..0986d71ca 100644 --- a/qt-ui/configuredivecomputerdialog.ui +++ b/qt-ui/configuredivecomputerdialog.ui @@ -253,7 +253,7 @@ Basic settings - + @@ -277,7 +277,7 @@ - + @@ -331,30 +331,7 @@ - - - - Custom text - - - customTextLlineEdit - - - - - - - - 1 - 0 - - - - 60 - - - - + Language @@ -364,41 +341,7 @@ - - - - - OC - - - - - CC - - - - - Gauge - - - - - Apnea - - - - - - - - Dive mode - - - diveModeComboBox - - - - + @@ -417,17 +360,7 @@ - - - - Date format - - - dateFormatComboBox - - - - + @@ -446,7 +379,17 @@ - + + + + Date format + + + dateFormatComboBox + + + + Brightness @@ -456,7 +399,7 @@ - + Units @@ -466,7 +409,7 @@ - + Salinity (0-5%) @@ -476,7 +419,7 @@ - + % @@ -486,21 +429,7 @@ - - - - - 2s - - - - - 10s - - - - - + @@ -550,7 +479,7 @@ - + Qt::Vertical @@ -563,7 +492,98 @@ - + + + + false + + + Reset device to default settings + + + + + + + Compass gain + + + compassGainComboBox + + + + + + + Custom text + + + customTextLlineEdit + + + + + + + + 1 + 0 + + + + 60 + + + + + + + Computer model + + + + + + + true + + + + + + + Dive mode + + + diveModeComboBox + + + + + + + + OC + + + + + CC + + + + + Gauge + + + + + Apnea + + + + + Sampling rate @@ -573,6 +593,30 @@ + + + + + 2s + + + + + 10s + + + + + + + + Dive mode color + + + diveModeColour + + + @@ -604,16 +648,6 @@ - - - - Dive mode color - - - diveModeColour - - - @@ -621,26 +655,6 @@ - - - - false - - - Reset device to default settings - - - - - - - Compass gain - - - compassGainComboBox - - -