mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
CCR option: display o2 sensor data
This patch creates the possibility of viewing the individual sensor values when the po2 button on the profile toolbar is activated. This follows exactly the procedure for optionally displaying the setpoint values while viewing po2. A checkbox in the preferences panel determines whether sensor information is shown. By default it is set to OFF. When checked, and the po2 button is activated, sensor1 values are shown in grey, sensor2 in blue and sensor3 in brown. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2923329e8e
commit
a700be3207
10 changed files with 82 additions and 10 deletions
|
@ -84,6 +84,9 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent),
|
|||
pheGasItem(new PartialPressureGasItem()),
|
||||
po2GasItem(new PartialPressureGasItem()),
|
||||
o2SetpointGasItem(new PartialPressureGasItem()),
|
||||
ccrsensor1GasItem(new PartialPressureGasItem()),
|
||||
ccrsensor2GasItem(new PartialPressureGasItem()),
|
||||
ccrsensor3GasItem(new PartialPressureGasItem()),
|
||||
heartBeatAxis(new DiveCartesianAxis()),
|
||||
heartBeatItem(new DiveHeartrateItem()),
|
||||
percentageAxis(new DiveCartesianAxis()),
|
||||
|
@ -152,6 +155,9 @@ ProfileWidget2::~ProfileWidget2()
|
|||
delete pheGasItem;
|
||||
delete po2GasItem;
|
||||
delete o2SetpointGasItem;
|
||||
delete ccrsensor1GasItem;
|
||||
delete ccrsensor2GasItem;
|
||||
delete ccrsensor3GasItem;
|
||||
delete heartBeatAxis;
|
||||
delete heartBeatItem;
|
||||
delete percentageAxis;
|
||||
|
@ -191,6 +197,9 @@ void ProfileWidget2::addItemsToScene()
|
|||
scene()->addItem(pheGasItem);
|
||||
scene()->addItem(po2GasItem);
|
||||
scene()->addItem(o2SetpointGasItem);
|
||||
scene()->addItem(ccrsensor1GasItem);
|
||||
scene()->addItem(ccrsensor2GasItem);
|
||||
scene()->addItem(ccrsensor3GasItem);
|
||||
scene()->addItem(percentageAxis);
|
||||
scene()->addItem(heartBeatAxis);
|
||||
scene()->addItem(heartBeatItem);
|
||||
|
@ -297,6 +306,9 @@ void ProfileWidget2::setupItemOnScene()
|
|||
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");
|
||||
CREATE_PP_GAS(ccrsensor1GasItem, CCRSENSOR1, CCRSENSOR1, PO2_ALERT, &prefs.pp_graphs.po2_threshold, "ccrsensorgraph");
|
||||
CREATE_PP_GAS(ccrsensor2GasItem, CCRSENSOR2, CCRSENSOR2, PO2_ALERT, &prefs.pp_graphs.po2_threshold, "ccrsensorgraph");
|
||||
CREATE_PP_GAS(ccrsensor3GasItem, CCRSENSOR3, CCRSENSOR3, PO2_ALERT, &prefs.pp_graphs.po2_threshold, "ccrsensorgraph");
|
||||
#undef CREATE_PP_GAS
|
||||
|
||||
temperatureAxis->setTextVisible(false);
|
||||
|
@ -509,7 +521,10 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
|
|||
currentdc = fake_dc(currentdc);
|
||||
}
|
||||
|
||||
o2SetpointGasItem->setVisible(current_dive && (currentdc->divemode == CCR) && prefs.show_ccr_setpoint && prefs.pp_graphs.po2);
|
||||
o2SetpointGasItem->setVisible(prefs.show_ccr_setpoint && (currentdc->divemode == CCR) && prefs.pp_graphs.po2 && current_dive);
|
||||
ccrsensor1GasItem->setVisible(prefs.show_ccr_sensors && (currentdc->divemode == CCR) && prefs.pp_graphs.po2 && current_dive);
|
||||
ccrsensor2GasItem->setVisible(prefs.show_ccr_sensors && (currentdc->divemode == CCR) && prefs.pp_graphs.po2 && current_dive);
|
||||
ccrsensor3GasItem->setVisible(prefs.show_ccr_sensors && (currentdc->divemode == CCR) && prefs.pp_graphs.po2 && (currentdc->no_o2sensors > 2) && current_dive);
|
||||
|
||||
/* 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
|
||||
|
@ -860,6 +875,9 @@ void ProfileWidget2::setEmptyState()
|
|||
pn2GasItem->setVisible(false);
|
||||
po2GasItem->setVisible(false);
|
||||
o2SetpointGasItem->setVisible(false);
|
||||
ccrsensor1GasItem->setVisible(false);
|
||||
ccrsensor2GasItem->setVisible(false);
|
||||
ccrsensor3GasItem->setVisible(false);
|
||||
pheGasItem->setVisible(false);
|
||||
ambPressureItem->setVisible(false);
|
||||
gflineItem->setVisible(false);
|
||||
|
@ -957,8 +975,11 @@ void ProfileWidget2::setProfileState()
|
|||
}
|
||||
pn2GasItem->setVisible(prefs.pp_graphs.pn2);
|
||||
po2GasItem->setVisible(prefs.pp_graphs.po2);
|
||||
o2SetpointGasItem->setVisible(current_dive && prefs.pp_graphs.po2 && (current_dc->divemode == CCR) && (prefs.show_ccr_setpoint));
|
||||
pheGasItem->setVisible(prefs.pp_graphs.phe);
|
||||
o2SetpointGasItem->setVisible(current_dive && prefs.pp_graphs.po2 && (current_dc->divemode == CCR) && (prefs.show_ccr_setpoint));
|
||||
ccrsensor1GasItem->setVisible(prefs.show_ccr_sensors && (current_dc->divemode == CCR) && prefs.pp_graphs.po2 && current_dive);
|
||||
ccrsensor2GasItem->setVisible(prefs.show_ccr_sensors && (current_dc->divemode == CCR) && prefs.pp_graphs.po2 && (current_dc->no_o2sensors > 1) && current_dive);
|
||||
ccrsensor3GasItem->setVisible(prefs.show_ccr_sensors && (current_dc->divemode == CCR) && prefs.pp_graphs.po2 && (current_dc->no_o2sensors > 2) && current_dive);
|
||||
|
||||
timeAxis->setPos(itemPos.time.pos.on);
|
||||
timeAxis->setLine(itemPos.time.expanded);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue