mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Recalculate the decompression if the date / time of a dive changes
The pre-existing tissue load going into a dive can change if the start time of a dive changes. Therefore we need to recalculate the ceiling when editing start time (or date) of a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e1db94ea0c
commit
71d21c375c
4 changed files with 15 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "helpers.h"
|
||||
#include "diveplanner.h"
|
||||
#include "libdivecomputer/parser.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <QPen>
|
||||
#include <QPainter>
|
||||
|
@ -675,6 +676,7 @@ DiveCalculatedCeiling::DiveCalculatedCeiling() : is3mIncrement(false), gradientF
|
|||
gradientFactor->setY(0);
|
||||
gradientFactor->setBrush(getColor(PRESSURE_TEXT));
|
||||
gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
|
||||
connect(MainWindow::instance()->information(), SIGNAL(dateTimeChanged()), this, SLOT(recalc()));
|
||||
settingsChanged();
|
||||
}
|
||||
|
||||
|
@ -757,11 +759,16 @@ void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QMo
|
|||
setBrush(pat);
|
||||
}
|
||||
|
||||
void DiveCalculatedCeiling::recalc()
|
||||
{
|
||||
dataModel->calculateDecompression();
|
||||
}
|
||||
|
||||
void DiveCalculatedCeiling::settingsChanged()
|
||||
{
|
||||
if (dataModel && is3mIncrement != prefs.calcceiling3m) {
|
||||
// recalculate that part.
|
||||
dataModel->calculateDecompression();
|
||||
recalc();
|
||||
}
|
||||
is3mIncrement = prefs.calcceiling3m;
|
||||
setVisible(prefs.calcceiling);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue