mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Set surface pressure and salinity correctly when replanning
We need to initialize the UI elements accordingly. Fixes #1094 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e182581f77
commit
fb2ba72e42
3 changed files with 14 additions and 0 deletions
|
@ -181,6 +181,16 @@ void DivePlannerWidget::setupStartTime(QDateTime startTime)
|
||||||
ui.dateEdit->setDate(startTime.date());
|
ui.dateEdit->setDate(startTime.date());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivePlannerWidget::setSurfacePressure(int surface_pressure)
|
||||||
|
{
|
||||||
|
ui.ATMPressure->setValue(surface_pressure);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DivePlannerWidget::setSalinity(int salinity)
|
||||||
|
{
|
||||||
|
ui.salinity->setValue(salinity / 10000.0);
|
||||||
|
}
|
||||||
|
|
||||||
void DivePlannerWidget::settingsChanged()
|
void DivePlannerWidget::settingsChanged()
|
||||||
{
|
{
|
||||||
// Adopt units
|
// Adopt units
|
||||||
|
|
|
@ -52,6 +52,8 @@ slots:
|
||||||
void heightChanged(const int height);
|
void heightChanged(const int height);
|
||||||
void salinityChanged(const double salinity);
|
void salinityChanged(const double salinity);
|
||||||
void printDecoPlan();
|
void printDecoPlan();
|
||||||
|
void setSurfacePressure(int surface_pressure);
|
||||||
|
void setSalinity(int salinity);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DivePlanner ui;
|
Ui::DivePlanner ui;
|
||||||
|
|
|
@ -914,6 +914,8 @@ void MainWindow::on_actionReplanDive_triggered()
|
||||||
setApplicationState("PlanDive");
|
setApplicationState("PlanDive");
|
||||||
divePlannerWidget()->setReplanButton(true);
|
divePlannerWidget()->setReplanButton(true);
|
||||||
divePlannerWidget()->setupStartTime(QDateTime::fromMSecsSinceEpoch(1000 * current_dive->when, Qt::UTC));
|
divePlannerWidget()->setupStartTime(QDateTime::fromMSecsSinceEpoch(1000 * current_dive->when, Qt::UTC));
|
||||||
|
divePlannerWidget()->setSurfacePressure(current_dive->surface_pressure.mbar);
|
||||||
|
divePlannerWidget()->setSalinity(current_dive->salinity);
|
||||||
DivePlannerPointsModel::instance()->loadFromDive(current_dive);
|
DivePlannerPointsModel::instance()->loadFromDive(current_dive);
|
||||||
reset_cylinders(&displayed_dive, true);
|
reset_cylinders(&displayed_dive, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue