summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index d825c6e84..b8d251c2c 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -297,6 +297,7 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg
connect(ui.dateEdit, SIGNAL(dateChanged(QDate)), plannerModel, SLOT(setStartDate(QDate)));
connect(ui.ATMPressure, SIGNAL(valueChanged(int)), this, SLOT(atmPressureChanged(int)));
connect(ui.atmHeight, SIGNAL(valueChanged(int)), this, SLOT(heightChanged(int)));
+ connect(ui.salinity, SIGNAL(valueChanged(double)), this, SLOT(salinityChanged(double)));
connect(DivePlannerPointsModel::instance(), SIGNAL(startTimeChanged(QDateTime)), this, SLOT(setupStartTime(QDateTime)));
// Creating (and canceling) the plan
@@ -367,6 +368,12 @@ void DivePlannerWidget::heightChanged(const int height)
plannerModel->setSurfacePressure(pressure);
}
+void DivePlannerWidget::salinityChanged(const double salinity)
+{
+ /* Salinity is expressed in weight in grams per 10l */
+ plannerModel->setSalinity(10000 * salinity);
+}
+
void PlannerSettingsWidget::bottomSacChanged(const double bottomSac)
{
plannerModel->setBottomSac(bottomSac);
@@ -786,6 +793,12 @@ void DivePlannerPointsModel::setSurfacePressure(int pressure)
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
+void DivePlannerPointsModel::setSalinity(int salinity)
+{
+ diveplan.salinity = salinity;
+ emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
+}
+
int DivePlannerPointsModel::getSurfacePressure()
{
return diveplan.surface_pressure;