aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/configuredivecomputerdialog.cpp
diff options
context:
space:
mode:
authorGravatar Joseph W. Joshua <joejoshw@gmail.com>2014-06-21 10:22:47 +0300
committerGravatar Thiago Macieira <thiago@macieira.org>2014-08-13 10:48:15 -0700
commit8aa7fddb22cd6ab4d533082598be04649bb1ff21 (patch)
tree041bf6c67978468389a65f45d83bde4ee1add6e9 /qt-ui/configuredivecomputerdialog.cpp
parent9c032f20c02fbb7c1e3906dbc8392539e0125327 (diff)
downloadsubsurface-8aa7fddb22cd6ab4d533082598be04649bb1ff21.tar.gz
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 <joejoshw@gmail.com> Signed-off-by: Thiago Macieira <thiago@macieira.org>
Diffstat (limited to 'qt-ui/configuredivecomputerdialog.cpp')
-rw-r--r--qt-ui/configuredivecomputerdialog.cpp42
1 files changed, 42 insertions, 0 deletions
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)));
}