mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make the reserve gas units aware
In the planner, for recreational mode, there is a setting indicating the pressure at which the diver should be back at the surface. This pressure was hardcoded to bar. Fixes #1027 [Dirk Hohndel: small modifications, more reasonable step for psi, more reasonable maxima] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e8f8051efe
commit
48007ebc30
2 changed files with 16 additions and 2 deletions
|
|
@ -481,7 +481,10 @@ void DivePlannerPointsModel::setSafetyStop(bool value)
|
|||
|
||||
void DivePlannerPointsModel::setReserveGas(int reserve)
|
||||
{
|
||||
prefs.reserve_gas = reserve * 1000;
|
||||
if (prefs.units.pressure == units::BAR)
|
||||
prefs.reserve_gas = reserve * 1000;
|
||||
else
|
||||
prefs.reserve_gas = psi_to_mbar(reserve);
|
||||
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue