mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: Display VPM-B rather than GF when in VPM-B mode
If we are planning a dive using VPM-B with +x conservatism, we want to print "VPM-B +x" at the top of the profile, instead of "GF xx/yy". Accordingly, the variable gradientFactor in profilewidget2.cpp is renamed decoModelParameters to reflect what it represents. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
5c16305b4a
commit
ad660da6d1
2 changed files with 20 additions and 14 deletions
|
@ -87,7 +87,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
|
||||||
gasPressureItem(new DiveGasPressureItem()),
|
gasPressureItem(new DiveGasPressureItem()),
|
||||||
diveComputerText(new DiveTextItem()),
|
diveComputerText(new DiveTextItem()),
|
||||||
diveCeiling(new DiveCalculatedCeiling()),
|
diveCeiling(new DiveCalculatedCeiling()),
|
||||||
gradientFactor(new DiveTextItem()),
|
decoModelParameters(new DiveTextItem()),
|
||||||
reportedCeiling(new DiveReportedCeiling()),
|
reportedCeiling(new DiveReportedCeiling()),
|
||||||
pn2GasItem(new PartialPressureGasItem()),
|
pn2GasItem(new PartialPressureGasItem()),
|
||||||
pheGasItem(new PartialPressureGasItem()),
|
pheGasItem(new PartialPressureGasItem()),
|
||||||
|
@ -204,7 +204,7 @@ void ProfileWidget2::addItemsToScene()
|
||||||
diveComputerText->setData(SUBSURFACE_OBJ_DATA, SUBSURFACE_OBJ_DC_TEXT);
|
diveComputerText->setData(SUBSURFACE_OBJ_DATA, SUBSURFACE_OBJ_DC_TEXT);
|
||||||
scene()->addItem(diveComputerText);
|
scene()->addItem(diveComputerText);
|
||||||
scene()->addItem(diveCeiling);
|
scene()->addItem(diveCeiling);
|
||||||
scene()->addItem(gradientFactor);
|
scene()->addItem(decoModelParameters);
|
||||||
scene()->addItem(reportedCeiling);
|
scene()->addItem(reportedCeiling);
|
||||||
scene()->addItem(pn2GasItem);
|
scene()->addItem(pn2GasItem);
|
||||||
scene()->addItem(pheGasItem);
|
scene()->addItem(pheGasItem);
|
||||||
|
@ -288,11 +288,11 @@ void ProfileWidget2::setupItemOnScene()
|
||||||
rulerItem->setAxis(timeAxis, profileYAxis);
|
rulerItem->setAxis(timeAxis, profileYAxis);
|
||||||
tankItem->setHorizontalAxis(timeAxis);
|
tankItem->setHorizontalAxis(timeAxis);
|
||||||
|
|
||||||
// show the gradient factor at the top in the center
|
// show the deco model parameters at the top in the center
|
||||||
gradientFactor->setY(0);
|
decoModelParameters->setY(0);
|
||||||
gradientFactor->setX(50);
|
decoModelParameters->setX(50);
|
||||||
gradientFactor->setBrush(getColor(PRESSURE_TEXT));
|
decoModelParameters->setBrush(getColor(PRESSURE_TEXT));
|
||||||
gradientFactor->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
|
decoModelParameters->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
|
||||||
|
|
||||||
setupItem(reportedCeiling, timeAxis, profileYAxis, dataModel, DivePlotDataModel::CEILING, DivePlotDataModel::TIME, 1);
|
setupItem(reportedCeiling, timeAxis, profileYAxis, dataModel, DivePlotDataModel::CEILING, DivePlotDataModel::TIME, 1);
|
||||||
setupItem(diveCeiling, timeAxis, profileYAxis, dataModel, DivePlotDataModel::CEILING, DivePlotDataModel::TIME, 1);
|
setupItem(diveCeiling, timeAxis, profileYAxis, dataModel, DivePlotDataModel::CEILING, DivePlotDataModel::TIME, 1);
|
||||||
|
@ -509,7 +509,10 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
|
||||||
|
|
||||||
// this copies the dive and makes copies of all the relevant additional data
|
// this copies the dive and makes copies of all the relevant additional data
|
||||||
copy_dive(d, &displayed_dive);
|
copy_dive(d, &displayed_dive);
|
||||||
gradientFactor->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh));
|
if (prefs.deco_mode == VPMB)
|
||||||
|
decoModelParameters->setText(QString("VPM-B +%1").arg(prefs.conservatism_level));
|
||||||
|
else
|
||||||
|
decoModelParameters->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh));
|
||||||
} else {
|
} else {
|
||||||
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
|
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
|
||||||
plannerModel->createTemporaryPlan();
|
plannerModel->createTemporaryPlan();
|
||||||
|
@ -518,7 +521,10 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
|
||||||
plannerModel->deleteTemporaryPlan();
|
plannerModel->deleteTemporaryPlan();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gradientFactor->setText(QString("GF %1/%2").arg(diveplan.gflow).arg(diveplan.gfhigh));
|
if (prefs.deco_mode == VPMB)
|
||||||
|
decoModelParameters->setText(QString("VPM-B +%1").arg(prefs.conservatism_level));
|
||||||
|
else
|
||||||
|
decoModelParameters->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh));
|
||||||
}
|
}
|
||||||
|
|
||||||
// special handling for the first time we display things
|
// special handling for the first time we display things
|
||||||
|
@ -926,7 +932,7 @@ void ProfileWidget2::setEmptyState()
|
||||||
toolTipItem->setVisible(false);
|
toolTipItem->setVisible(false);
|
||||||
diveComputerText->setVisible(false);
|
diveComputerText->setVisible(false);
|
||||||
diveCeiling->setVisible(false);
|
diveCeiling->setVisible(false);
|
||||||
gradientFactor->setVisible(false);
|
decoModelParameters->setVisible(false);
|
||||||
reportedCeiling->setVisible(false);
|
reportedCeiling->setVisible(false);
|
||||||
rulerItem->setVisible(false);
|
rulerItem->setVisible(false);
|
||||||
tankItem->setVisible(false);
|
tankItem->setVisible(false);
|
||||||
|
@ -1053,7 +1059,7 @@ void ProfileWidget2::setProfileState()
|
||||||
diveComputerText->setPos(itemPos.dcLabel.on);
|
diveComputerText->setPos(itemPos.dcLabel.on);
|
||||||
|
|
||||||
diveCeiling->setVisible(prefs.calcceiling);
|
diveCeiling->setVisible(prefs.calcceiling);
|
||||||
gradientFactor->setVisible(prefs.calcceiling);
|
decoModelParameters->setVisible(prefs.calcceiling);
|
||||||
reportedCeiling->setVisible(prefs.dcceiling);
|
reportedCeiling->setVisible(prefs.dcceiling);
|
||||||
|
|
||||||
if (prefs.calcalltissues) {
|
if (prefs.calcalltissues) {
|
||||||
|
@ -1131,7 +1137,7 @@ void ProfileWidget2::setAddState()
|
||||||
/* show the same stuff that the profile shows. */
|
/* show the same stuff that the profile shows. */
|
||||||
currentState = ADD; /* enable the add state. */
|
currentState = ADD; /* enable the add state. */
|
||||||
diveCeiling->setVisible(true);
|
diveCeiling->setVisible(true);
|
||||||
gradientFactor->setVisible(true);
|
decoModelParameters->setVisible(true);
|
||||||
setBackgroundBrush(QColor("#A7DCFF"));
|
setBackgroundBrush(QColor("#A7DCFF"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1165,7 +1171,7 @@ void ProfileWidget2::setPlanState()
|
||||||
/* show the same stuff that the profile shows. */
|
/* show the same stuff that the profile shows. */
|
||||||
currentState = PLAN; /* enable the add state. */
|
currentState = PLAN; /* enable the add state. */
|
||||||
diveCeiling->setVisible(true);
|
diveCeiling->setVisible(true);
|
||||||
gradientFactor->setVisible(true);
|
decoModelParameters->setVisible(true);
|
||||||
setBackgroundBrush(QColor("#D7E3EF"));
|
setBackgroundBrush(QColor("#D7E3EF"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,7 @@ private:
|
||||||
QList<DiveEventItem *> eventItems;
|
QList<DiveEventItem *> eventItems;
|
||||||
DiveTextItem *diveComputerText;
|
DiveTextItem *diveComputerText;
|
||||||
DiveCalculatedCeiling *diveCeiling;
|
DiveCalculatedCeiling *diveCeiling;
|
||||||
DiveTextItem *gradientFactor;
|
DiveTextItem *decoModelParameters;
|
||||||
QList<DiveCalculatedTissue *> allTissues;
|
QList<DiveCalculatedTissue *> allTissues;
|
||||||
DiveReportedCeiling *reportedCeiling;
|
DiveReportedCeiling *reportedCeiling;
|
||||||
PartialPressureGasItem *pn2GasItem;
|
PartialPressureGasItem *pn2GasItem;
|
||||||
|
|
Loading…
Add table
Reference in a new issue