summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Willem Ferguson <willemferguson@zoology.up.ac.za>2015-01-05 09:20:26 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-05 09:18:06 -0800
commit0de3bc84523778ad74a305a5f9e85645c90e02cf (patch)
treefcef310e491b9bb8de14c88ca756c21eaaccf25c /qt-ui/profile/profilewidget2.cpp
parent27bfbee4e8c3644dedea61f67338dcb2b83ffbed (diff)
downloadsubsurface-0de3bc84523778ad74a305a5f9e85645c90e02cf.tar.gz
Display CCR setpoint values on the po2 graph
When a CCR dive is viewed and the toolbar button for PO2 is activated, both the PO2 (green line) and the O2 setpoint (red line) are shown. This allows evaluation of the PO2 in the CCR loop with respect to the pre-configured O2 setpoint. The setpoint graph can be disabled from the Preferences/Graphs tab by checking the appropriate checkbox. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r--qt-ui/profile/profilewidget2.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index f9aa49eff..f986a2c30 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -93,6 +93,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
pn2GasItem(new PartialPressureGasItem()),
pheGasItem(new PartialPressureGasItem()),
po2GasItem(new PartialPressureGasItem()),
+ o2SetpointGasItem(new PartialPressureGasItem()),
heartBeatAxis(new DiveCartesianAxis()),
heartBeatItem(new DiveHeartrateItem()),
percentageAxis(new DiveCartesianAxis()),
@@ -162,6 +163,7 @@ ProfileWidget2::~ProfileWidget2()
delete pn2GasItem;
delete pheGasItem;
delete po2GasItem;
+ delete o2SetpointGasItem;
delete heartBeatAxis;
delete heartBeatItem;
delete percentageAxis;
@@ -201,6 +203,7 @@ void ProfileWidget2::addItemsToScene()
scene()->addItem(pn2GasItem);
scene()->addItem(pheGasItem);
scene()->addItem(po2GasItem);
+ scene()->addItem(o2SetpointGasItem);
scene()->addItem(percentageAxis);
scene()->addItem(heartBeatAxis);
scene()->addItem(heartBeatItem);
@@ -313,6 +316,7 @@ void ProfileWidget2::setupItemOnScene()
CREATE_PP_GAS(pn2GasItem, PN2, PN2, PN2_ALERT, &prefs.pp_graphs.pn2_threshold, "pn2graph");
CREATE_PP_GAS(pheGasItem, PHE, PHE, PHE_ALERT, &prefs.pp_graphs.phe_threshold, "phegraph");
CREATE_PP_GAS(po2GasItem, PO2, PO2, PO2_ALERT, &prefs.pp_graphs.po2_threshold, "po2graph");
+ CREATE_PP_GAS(o2SetpointGasItem, O2SETPOINT, PO2_ALERT, PO2_ALERT, &prefs.pp_graphs.po2_threshold, "po2graph");
#undef CREATE_PP_GAS
temperatureAxis->setTextVisible(false);
@@ -527,6 +531,11 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
currentdc = fake_dc(currentdc);
}
+ if ((current_dc->dctype == CCR) && (prefs.show_ccr_setpoint))
+ o2SetpointGasItem->setVisible(true);
+ else
+ o2SetpointGasItem->setVisible(false);
+
/* This struct holds all the data that's about to be plotted.
* I'm not sure this is the best approach ( but since we are
* interpolating some points of the Dive, maybe it is... )
@@ -883,6 +892,7 @@ void ProfileWidget2::setEmptyState()
tankItem->setVisible(false);
pn2GasItem->setVisible(false);
po2GasItem->setVisible(false);
+ o2SetpointGasItem->setVisible(false);
pheGasItem->setVisible(false);
ambPressureItem->setVisible(false);
gflineItem->setVisible(false);
@@ -981,6 +991,7 @@ void ProfileWidget2::setProfileState()
}
pn2GasItem->setVisible(prefs.pp_graphs.pn2);
po2GasItem->setVisible(prefs.pp_graphs.po2);
+ o2SetpointGasItem->setVisible(true);
pheGasItem->setVisible(prefs.pp_graphs.phe);
timeAxis->setPos(itemPos.time.pos.on);