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.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 1841f8529..a250b08ad 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -323,6 +323,9 @@ void DivePlannerWidget::settingsChanged()
} else {
ui.atmHeight->setSuffix(("m"));
}
+ ui.atmHeight->blockSignals(true);
+ ui.atmHeight->setValue((int) get_depth_units((int) (log(1013.0 / plannerModel->getSurfacePressure()) * 7800000), NULL,NULL));
+ ui.atmHeight->blockSignals(false);
}
void DivePlannerPointsModel::addCylinder_clicked()
@@ -334,7 +337,7 @@ void DivePlannerWidget::atmPressureChanged(const int pressure)
{
plannerModel->setSurfacePressure(pressure);
ui.atmHeight->blockSignals(true);
- ui.atmHeight->setValue((int) get_depth_units((int)(log(1013.0 / pressure) * 7800000), NULL,NULL));
+ ui.atmHeight->setValue((int) get_depth_units((int) (log(1013.0 / pressure) * 7800000), NULL,NULL));
ui.atmHeight->blockSignals(false);
}
@@ -712,6 +715,11 @@ void DivePlannerPointsModel::setSurfacePressure(int pressure)
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
+int DivePlannerPointsModel::getSurfacePressure()
+{
+ return diveplan.surface_pressure;
+}
+
void DivePlannerPointsModel::setLastStop6m(bool value)
{
set_last_stop(value);