From 81a812539c95f2e709995d446065803c09e9136a Mon Sep 17 00:00:00 2001 From: Willem Ferguson Date: Wed, 14 Mar 2018 17:13:37 +0200 Subject: Plot OC-pO2 graph for SCR dives This commit allows plotting the OC-equivalent pO2 graph for PSCR dives. This happens in both the cases where there is no external O2-monitoring AND when there is external pO2 monitoring. The calculations are only done for PSCR dives and is achieved as follows: 1) Within plot-info create a pressure-t called OC_pO2 in profile.h and populate this variable with the open-circuit pO2 values in profile.c. 2) Create a new partialPressureGasItem ocpo2GasItem in profilewidget2.h and, in profilewidget2.cpp, initialise it to read the plot-info OC_pO2 values and enable its display by using the setVisible method. The diveplotdatamodel was also touched in order to achieve this. 3) Create a pref button that controls the display of OC-pO2 for SCR dives 4) Change the colour of the OC-pO2 grpah to orange 5) Change the connection of the crr_OC_pO2 signal to be appropriate 6) rename the OC_pO2 attribute to scr_OC-pO2 Signed-off-by: Willem Ferguson --- desktop-widgets/preferences/preferences_graph.cpp | 2 + desktop-widgets/preferences/preferences_graph.ui | 113 ++++++++++++---------- 2 files changed, 63 insertions(+), 52 deletions(-) (limited to 'desktop-widgets/preferences') diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp index ccc9aee65..91cd773d8 100644 --- a/desktop-widgets/preferences/preferences_graph.cpp +++ b/desktop-widgets/preferences/preferences_graph.cpp @@ -40,6 +40,7 @@ void PreferencesGraph::refreshSettings() ui->vpmb_conservatism->setValue(prefs.vpmb_conservatism); ui->show_ccr_setpoint->setChecked(prefs.show_ccr_setpoint); ui->show_ccr_sensors->setChecked(prefs.show_ccr_sensors); + ui->show_scr_ocpo2->setChecked(prefs.show_scr_ocpo2); ui->defaultSetpoint->setValue((double)prefs.defaultsetpoint / 1000.0); ui->psro2rate->setValue(prefs.o2consumption / 1000.0); ui->pscrfactor->setValue(lrint(1000.0 / prefs.pscr_ratio)); @@ -71,6 +72,7 @@ void PreferencesGraph::syncSettings() tech->setVpmbConservatism(ui->vpmb_conservatism->value()); tech->setShowCCRSetpoint(ui->show_ccr_setpoint->isChecked()); tech->setShowCCRSensors(ui->show_ccr_sensors->isChecked()); + tech->setShowSCROCpO2(ui->show_scr_ocpo2->isChecked()); tech->setDisplayUnusedTanks(ui->display_unused_tanks->isChecked()); tech->setShowAverageDepth(ui->show_average_depth->isChecked()); tech->setShowIcd(ui->show_icd->isChecked()); diff --git a/desktop-widgets/preferences/preferences_graph.ui b/desktop-widgets/preferences/preferences_graph.ui index e711ea1c7..020ae498f 100644 --- a/desktop-widgets/preferences/preferences_graph.ui +++ b/desktop-widgets/preferences/preferences_graph.ui @@ -158,18 +158,72 @@ - Show individual O₂ sensor values when viewing pO₂ + Show O₂ sensor values when viewing pO₂ - Show setpoints when viewing pO₂ + Show CCR setpoints when viewing pO₂ + + + pSCR options: + + + + + + + pSCR metabolic rate O₂ + + + Qt::AlignCenter + + + + + + + ℓ/min + + + 3 + + + + + + + Dilution ratio + + + Qt::AlignCenter + + + + + + + + + + 1: + + + + + + + Show equivalent OC pO₂ with pSCR pO₂ + + + + Show warnings for isobaric counterdiffusion @@ -195,16 +249,6 @@ - - - - - - - 1: - - - @@ -225,16 +269,6 @@ - - - - Dilution ratio - - - Qt::AlignCenter - - - @@ -271,16 +305,6 @@ - - - - Metabolic rate O₂ - - - Qt::AlignCenter - - - @@ -291,16 +315,6 @@ - - - - ℓ/min - - - 3 - - - @@ -321,13 +335,6 @@ - - - - pSCR options: - - - @@ -386,16 +393,18 @@ pheThreshold maxpo2 defaultSetpoint - show_ccr_setpoint show_ccr_sensors + show_ccr_setpoint + psro2rate + pscrfactor + show_scr_ocpo2 + show_icd red_ceiling vpmb vpmb_conservatism buehlmann gflow gfhigh - psro2rate - pscrfactor display_unused_tanks show_average_depth -- cgit v1.2.3-70-g09d2