diff --git a/qt-ui/configuredivecomputer.cpp b/qt-ui/configuredivecomputer.cpp index a91a48d25..01df1c744 100644 --- a/qt-ui/configuredivecomputer.cpp +++ b/qt-ui/configuredivecomputer.cpp @@ -63,6 +63,7 @@ bool ConfigureDiveComputer::saveXMLBackup(QString fileName, DeviceDetails *detai xml += addSettingToXML("CustomText", details->customText()); xml += addSettingToXML("DiveMode", details->diveMode()); xml += addSettingToXML("Saturation", details->saturation()); + xml += addSettingToXML("Desaturation", details->desaturation()); xml += addSettingToXML("LastDeco", details->lastDeco()); xml += addSettingToXML("Brightness", details->brightness()); xml += addSettingToXML("Units", details->units()); @@ -131,6 +132,9 @@ bool ConfigureDiveComputer::restoreXMLBackup(QString fileName, DeviceDetails *de if (settingName == "Saturation") details->setSaturation(keyString.toInt()); + if (settingName == "Desaturation") + details->setDesaturation(keyString.toInt()); + if (settingName == "DiveMode") details->setDiveMode(keyString.toInt()); diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index 769f2cdc8..ece02a3d0 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -118,6 +118,7 @@ void ConfigureDiveComputerDialog::populateDeviceDetails() deviceDetails->setCustomText(ui->customTextLlineEdit->text()); deviceDetails->setDiveMode(ui->diveModeComboBox->currentIndex()); deviceDetails->setSaturation(ui->saturationSpinBox->value()); + deviceDetails->setDesaturation(ui->desaturationSpinBox->value()); deviceDetails->setLastDeco(ui->lastDecoSpinBox->value()); deviceDetails->setBrightness(ui->brightnessComboBox->currentIndex()); deviceDetails->setUnits(ui->unitsComboBox->currentIndex()); @@ -168,7 +169,7 @@ void ConfigureDiveComputerDialog::on_cancel_clicked() void ConfigureDiveComputerDialog::deviceReadFinished() { - + ui->statusLabel->setText(tr("Dive computer details read successfully.")); } void ConfigureDiveComputerDialog::on_saveSettingsPushButton_clicked() @@ -191,6 +192,7 @@ void ConfigureDiveComputerDialog::reloadValues() ui->customTextLlineEdit->setText(deviceDetails->customText()); ui->diveModeComboBox->setCurrentIndex(deviceDetails->diveMode()); ui->saturationSpinBox->setValue(deviceDetails->saturation()); + ui->desaturationSpinBox->setValue(deviceDetails->desaturation()); ui->lastDecoSpinBox->setValue(deviceDetails->lastDeco()); ui->brightnessComboBox->setCurrentIndex(deviceDetails->brightness()); ui->unitsComboBox->setCurrentIndex(deviceDetails->units()); @@ -200,6 +202,12 @@ void ConfigureDiveComputerDialog::reloadValues() ui->languageComboBox->setCurrentIndex(deviceDetails->language()); ui->dateFormatComboBox->setCurrentIndex(deviceDetails->dateFormat()); ui->compassGainComboBox->setCurrentIndex(deviceDetails->compassGain()); + + //load gas 1 values + ui->ostc3GasTable->setItem(0,1, new QTableWidgetItem(QString::number(deviceDetails->gas1().oxygen))); + ui->ostc3GasTable->setItem(0,2, new QTableWidgetItem(QString::number(deviceDetails->gas1().helium))); + ui->ostc3GasTable->setItem(0,3, new QTableWidgetItem(QString::number(deviceDetails->gas1().type))); + ui->ostc3GasTable->setItem(0,4, new QTableWidgetItem(QString::number(deviceDetails->gas1().depth))); } diff --git a/qt-ui/configuredivecomputerdialog.ui b/qt-ui/configuredivecomputerdialog.ui index 076b66fd1..6099535e8 100644 --- a/qt-ui/configuredivecomputerdialog.ui +++ b/qt-ui/configuredivecomputerdialog.ui @@ -6,8 +6,8 @@ 0 0 - 592 - 507 + 701 + 620 @@ -98,62 +98,38 @@ HW OSTC 3 - - - - m - - - - - + + - Dive Mode Colour: + Serial No. - - + + + + true + + + + + - Sync dive computer time with PC + Firmware Version: - - + + + + true + + + + + - Units: - - - - - - - Salinity (0-5%): - - - - - - - % - - - 5 - - - - - - - Language: - - - - - - - Date Format: + Custom Text: @@ -167,97 +143,13 @@ - - + + - Custom Text: + Language: - - - - Compass Gain: - - - - - - - true - - - - - - - Last Deco: - - - - - - - true - - - - - - - - Standard - - - - - Red - - - - - Green - - - - - Blue - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - MMDDYY - - - - - DDMMYY - - - - - YYMMDD - - - - @@ -282,81 +174,6 @@ - - - - - m/°C - - - - - ft/°F - - - - - - - - Brightness: - - - - - - - Serial No. - - - - - - - Sampling Rate: - - - - - - - - Eco - - - - - Medium - - - - - High - - - - - - - - - 2s - - - - - 10s - - - - - - - - Firmware Version: - - - @@ -388,6 +205,197 @@ + + + + Saturation: + + + + + + + % + + + + + + + Desaturation: + + + + + + + % + + + + + + + Last Deco: + + + + + + + m + + + + + + + Brightness: + + + + + + + + Eco + + + + + Medium + + + + + High + + + + + + + + Date Format: + + + + + + + + MMDDYY + + + + + DDMMYY + + + + + YYMMDD + + + + + + + + Units: + + + + + + + + m/°C + + + + + ft/°F + + + + + + + + Sampling Rate: + + + + + + + + 2s + + + + + 10s + + + + + + + + Salinity (0-5%): + + + + + + + % + + + 5 + + + + + + + Dive Mode Colour: + + + + + + + + Standard + + + + + Red + + + + + Green + + + + + Blue + + + + + + + + Compass Gain: + + + @@ -438,33 +446,183 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gas No. + + + + + %He + + + + + %O2 + + + + + Type + + + + + Change Depth + + + + + Gas 1 + + + + + Gas 2 + + + + + Gas 3 + + + + + Gas 4 + + + + + Gas 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gas No. + + + + + %He + + + + + %O2 + + + + + Type + + + + + Change Depth + + + + + Gas 1 + + + + + Gas 2 + + + + + Gas 3 + + + + + Gas 4 + + + + + Gas 5 + + + + + + - Saturation: + Sync dive computer time with PC - - - - % + + + + Qt::Vertical - - - - - - Desaturation: + + + 20 + 40 + - - - - - - % - - + diff --git a/qt-ui/configuredivecomputerthreads.cpp b/qt-ui/configuredivecomputerthreads.cpp index f0e2bde6e..3afb11bc5 100644 --- a/qt-ui/configuredivecomputerthreads.cpp +++ b/qt-ui/configuredivecomputerthreads.cpp @@ -32,6 +32,31 @@ void ReadSettingsThread::run() m_deviceDetails->setSamplingRate(0); m_deviceDetails->setUnits(0); + + //Gread gas mixes + gas gas1; + gas gas2; + gas gas3; + gas gas4; + gas gas5; + //Gas 1 + unsigned char gasData[4] = {0,0,0,0}; + rc = hw_ostc3_device_config_read(m_data->device, 0x10, gasData, sizeof(gasData)); + if (rc == DC_STATUS_SUCCESS) { + //Gas 1 read successful + gas gas1; + gas1.depth = gasData[3]; + gas1.oxygen = gasData[0]; + gas1.helium = gasData[1]; + gas1.type = gasData[2]; + } + + m_deviceDetails->setGas1(gas1); + m_deviceDetails->setGas2(gas2); + m_deviceDetails->setGas3(gas3); + m_deviceDetails->setGas4(gas4); + m_deviceDetails->setGas5(gas5); + //Read general settings unsigned char uData[1] = {0}; //DiveMode