mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
units: replace SURFACE_PRESSURE by 1_atm
Moreover, convert diveplan::surface_pressure from int to pressure_t. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ae81b42fe2
commit
dd5def35f5
11 changed files with 56 additions and 64 deletions
|
@ -170,8 +170,9 @@ void DivePlannerWidget::settingsChanged()
|
|||
ui.startTime->setDisplayFormat(QString::fromStdString(prefs.time_format));
|
||||
}
|
||||
|
||||
void DivePlannerWidget::atmPressureChanged(const int pressure)
|
||||
void DivePlannerWidget::atmPressureChanged(int pressure_in_mbar)
|
||||
{
|
||||
pressure_t pressure { .mbar = pressure_in_mbar };
|
||||
DivePlannerPointsModel::instance()->setSurfacePressure(pressure);
|
||||
ui.atmHeight->blockSignals(true);
|
||||
ui.atmHeight->setValue((int) get_depth_units((int) pressure_to_altitude(pressure), NULL, NULL));
|
||||
|
@ -180,9 +181,9 @@ void DivePlannerWidget::atmPressureChanged(const int pressure)
|
|||
|
||||
void DivePlannerWidget::heightChanged(const int height)
|
||||
{ // height is in ft or in meters
|
||||
int pressure = (int) (altitude_to_pressure(units_to_depth((double) height).mm));
|
||||
pressure_t pressure = altitude_to_pressure(units_to_depth((double) height).mm);
|
||||
ui.ATMPressure->blockSignals(true);
|
||||
ui.ATMPressure->setValue(pressure);
|
||||
ui.ATMPressure->setValue(pressure.mbar);
|
||||
ui.ATMPressure->blockSignals(false);
|
||||
DivePlannerPointsModel::instance()->setSurfacePressure(pressure);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue