diff options
-rw-r--r-- | qt-ui/diveplanner.cpp | 10 | ||||
-rw-r--r-- | qt-ui/diveplanner.h | 1 |
2 files changed, 10 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); diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 806b02cc2..26e2943fc 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -67,6 +67,7 @@ slots: void setGFHigh(const int gfhigh); void setGFLow(const int ghflow); void setSurfacePressure(int pressure); + int getSurfacePressure(); void setBottomSac(int sac); void setDecoSac(int sac); void setStartTime(const QTime &t); |