From 8aa7fddb22cd6ab4d533082598be04649bb1ff21 Mon Sep 17 00:00:00 2001 From: "Joseph W. Joshua" Date: Sat, 21 Jun 2014 10:22:47 +0300 Subject: Add read/write support for OSTC 3 SetPoint settings Implements support for reading, writing and backup/restore of set point settings for the OSTC 3. Signed-off-by: Joseph W. Joshua Signed-off-by: Thiago Macieira --- qt-ui/configuredivecomputerdialog.cpp | 42 +++ qt-ui/configuredivecomputerdialog.ui | 616 ++++++++++++++++++++-------------- 2 files changed, 412 insertions(+), 246 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/configuredivecomputerdialog.cpp b/qt-ui/configuredivecomputerdialog.cpp index f878ec11a..81d8f0326 100644 --- a/qt-ui/configuredivecomputerdialog.cpp +++ b/qt-ui/configuredivecomputerdialog.cpp @@ -205,6 +205,28 @@ void ConfigureDiveComputerDialog::populateDeviceDetails() deviceDetails->setDil3(dil3); deviceDetails->setDil4(dil4); deviceDetails->setDil5(dil5); + + //set set point details + setpoint sp1; + setpoint sp2; + setpoint sp3; + setpoint sp4; + setpoint sp5; + + sp1.sp = ui->ostc3SetPointTable->item(0, 1)->text().toInt(); + sp1.depth = ui->ostc3SetPointTable->item(0, 2)->text().toInt(); + + sp2.sp = ui->ostc3SetPointTable->item(1, 1)->text().toInt(); + sp2.depth = ui->ostc3SetPointTable->item(1, 2)->text().toInt(); + + sp3.sp = ui->ostc3SetPointTable->item(2, 1)->text().toInt(); + sp3.depth = ui->ostc3SetPointTable->item(2, 2)->text().toInt(); + + sp4.sp = ui->ostc3SetPointTable->item(3, 1)->text().toInt(); + sp4.depth = ui->ostc3SetPointTable->item(3, 2)->text().toInt(); + + sp5.sp = ui->ostc3SetPointTable->item(4, 1)->text().toInt(); + sp5.depth = ui->ostc3SetPointTable->item(4, 2)->text().toInt(); } void ConfigureDiveComputerDialog::readSettings() @@ -338,6 +360,26 @@ void ConfigureDiveComputerDialog::reloadValues() ui->ostc3DilTable->setItem(4,2, new QTableWidgetItem(QString::number(deviceDetails->dil5().helium))); ui->ostc3DilTable->setItem(4,3, new QTableWidgetItem(QString::number(deviceDetails->dil5().type))); ui->ostc3DilTable->setItem(4,4, new QTableWidgetItem(QString::number(deviceDetails->dil5().depth))); + + //load set point 1 values + ui->ostc3SetPointTable->setItem(0, 1, new QTableWidgetItem(QString::number(deviceDetails->sp1().sp))); + ui->ostc3SetPointTable->setItem(0, 2, new QTableWidgetItem(QString::number(deviceDetails->sp1().depth))); + + //load set point 2 values + ui->ostc3SetPointTable->setItem(1, 1, new QTableWidgetItem(QString::number(deviceDetails->sp2().sp))); + ui->ostc3SetPointTable->setItem(1, 2, new QTableWidgetItem(QString::number(deviceDetails->sp2().depth))); + + //load set point 3 values + ui->ostc3SetPointTable->setItem(2, 1, new QTableWidgetItem(QString::number(deviceDetails->sp3().sp))); + ui->ostc3SetPointTable->setItem(2, 2, new QTableWidgetItem(QString::number(deviceDetails->sp3().depth))); + + //load set point 4 values + ui->ostc3SetPointTable->setItem(3, 1, new QTableWidgetItem(QString::number(deviceDetails->sp4().sp))); + ui->ostc3SetPointTable->setItem(3, 2, new QTableWidgetItem(QString::number(deviceDetails->sp4().depth))); + + //load set point 5 values + ui->ostc3SetPointTable->setItem(4, 1, new QTableWidgetItem(QString::number(deviceDetails->sp5().sp))); + ui->ostc3SetPointTable->setItem(4, 2, new QTableWidgetItem(QString::number(deviceDetails->sp5().depth))); } diff --git a/qt-ui/configuredivecomputerdialog.ui b/qt-ui/configuredivecomputerdialog.ui index 0f99e597a..4274a3abe 100644 --- a/qt-ui/configuredivecomputerdialog.ui +++ b/qt-ui/configuredivecomputerdialog.ui @@ -6,8 +6,8 @@ 0 0 - 699 - 618 + 787 + 672 @@ -21,6 +21,9 @@ Device or Mount Point + + device + @@ -98,356 +101,388 @@ HW OSTC 3 - - + + + + + m/°C + + + + + ft/°F + + + + + + - Serial No. + Salinity (0-5%): + + + salinitySpinBox - - - - true + + + + Custom Text: + + + customTextLlineEdit - - - - Firmware Version: + + + + % - - - - true + + + + % - - - - Custom Text: + + + + % + + + 5 - - - - - 1 - 0 - + + + + m - - + + - Language: + Last Deco: + + + lastDecoSpinBox - - - - - English - - + + - German + Eco - French + Medium - Italian + High - - - - Dive Mode: + + + + true - - + + - OC + English - CC + German - Gauge + French - Apnea + Italian - - - - Saturation: - - - - - - - % - - - - - + + - Desaturation: - - - - - - - % + Language: - - - - - - Last Deco: + + languageComboBox - - - - m + + + + + 1 + 0 + - - - - Brightness: + + + + + 1 + 0 + - - - - - Eco + 230LSB/Gauss - Medium + 330LSB/Gauss - High + 390LSB/Gauss - - - - - - Date Format: - - - - - - MMDDYY + 440LSB/Gauss - DDMMYY + 660LSB/Gauss - YYMMDD + 820LSB/Gauss - - - - - - Units: - - - - - - m/°C + 1090LSB/Gauss - ft/°F + 1370LSB/Gauss - - + + - Sampling Rate: + Compass Gain: + + + compassGainComboBox - - - + + + + Dive Mode: + + + diveModeComboBox + + + + + + + + 0 + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %He + + + + + %O2 + + + + + Type + + + + + Change Depth + + + + + Dil 1 + + + + + Dil 2 + + + - 2s + Dil 3 - + - 10s + Dil 4 + + + + + Dil 5 - - + + - Salinity (0-5%): - - - - - - - % + Units: - - 5 + + unitsComboBox - - + + - Dive Mode Colour: + Desaturation: + + + desaturationSpinBox - - + + - Standard + OC - Red + CC - Green + Gauge - Blue + Apnea - - + + - Compass Gain: + Serial No. + + + serialNoLineEdit - - - - - 1 - 0 - + + + + Brightness: + + + brightnessComboBox + + + + + + + Saturation: + + + saturationSpinBox - - - 230LSB/Gauss - - - - - 330LSB/Gauss - - - - - 390LSB/Gauss - - - - - 440LSB/Gauss - - - - - 660LSB/Gauss - - - - - 820LSB/Gauss - - - - - 1090LSB/Gauss - - - - - 1370LSB/Gauss - - + + + 0 + 1 + + @@ -525,8 +560,125 @@ - - + + + + + MMDDYY + + + + + DDMMYY + + + + + YYMMDD + + + + + + + + true + + + + + + + Firmware Version: + + + firmwareVersionLineEdit + + + + + + + Date Format: + + + dateFormatComboBox + + + + + + + + Standard + + + + + Red + + + + + Green + + + + + Blue + + + + + + + + Sampling Rate: + + + samplingRateComboBox + + + + + + + Sync dive computer time with PC + + + + + + + + 2s + + + + + 10s + + + + + + + + Dive Mode Colour: + + + diveModeColour + + + + + + + + 0 + 1 + + @@ -559,71 +711,41 @@ - %He - - - - - %O2 - - - - - Type + Set Point [cbar] - Change Depth + Change Depth [m] - Dil 1 + SP 1 - Dil 2 + SP 2 - Dil 3 + SP 3 - Dil 4 + SP 4 - Dil 5 + SP 5 - - - - Sync dive computer time with PC - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -684,17 +806,19 @@ customTextLlineEdit languageComboBox diveModeComboBox + dateFormatComboBox saturationSpinBox desaturationSpinBox lastDecoSpinBox brightnessComboBox - dateFormatComboBox - unitsComboBox samplingRateComboBox - salinitySpinBox + unitsComboBox diveModeColour - compassGainComboBox + salinitySpinBox dateTimeSyncCheckBox + compassGainComboBox + ostc3GasTable + ostc3DilTable cancel -- cgit v1.2.3-70-g09d2