From 70bb4c145bd60c80153b9700edd5a914a45fea84 Mon Sep 17 00:00:00 2001 From: Willem Ferguson Date: Sun, 29 Apr 2018 07:00:17 +0200 Subject: [PATCH] Fix CCR setpoint display bug 1) The connection for the display of CCR-setpoint o2SetpointGasItem was erroneous, being connected to partialpressuregasSettings. It is now correctly connected to technicalDetailsSettings. 2) The colour of the setpoint graph is changed from PO2_ALERT (red) to an orange colour in order to show setpoint in red only when it exceeds 1.6. This emphasises the visibility of red parts of the gas pressure graphs whenever gas limits are exceeed. Signed-off-by: Willem Ferguson --- core/color.cpp | 2 +- profile-widget/profilewidget2.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/color.cpp b/core/color.cpp index 6ac7fc761..c0b8a4643 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -28,7 +28,7 @@ void fill_profile_color() profile_color[PN2_ALERT] = COLOR(RED1, BLACK1_LOW_TRANS, RED1); profile_color[PHE] = COLOR(PEANUT, BLACK1_LOW_TRANS, PEANUT); profile_color[PHE_ALERT] = COLOR(RED1, BLACK1_LOW_TRANS, RED1); - profile_color[O2SETPOINT] = COLOR(RED1, BLACK1_LOW_TRANS, RED1); + profile_color[O2SETPOINT] = COLOR(PIRATEGOLD1_MED_TRANS, BLACK1_LOW_TRANS, PIRATEGOLD1_MED_TRANS); profile_color[CCRSENSOR1] = COLOR(TUNDORA1_MED_TRANS, BLACK1_LOW_TRANS, TUNDORA1_MED_TRANS); profile_color[CCRSENSOR2] = COLOR(ROYALBLUE2_LOW_TRANS, BLACK1_LOW_TRANS, ROYALBLUE2_LOW_TRANS); profile_color[CCRSENSOR3] = COLOR(PEANUT, BLACK1_LOW_TRANS, PEANUT); diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index fa0e98cea..1e7e64daf 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -313,7 +313,7 @@ void ProfileWidget2::setupItemOnScene() createPPGas(pn2GasItem, DivePlotDataModel::PN2, PN2, PN2_ALERT, NULL, &prefs.pp_graphs.pn2_threshold); createPPGas(pheGasItem, DivePlotDataModel::PHE, PHE, PHE_ALERT, NULL, &prefs.pp_graphs.phe_threshold); createPPGas(po2GasItem, DivePlotDataModel::PO2, PO2, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max); - createPPGas(o2SetpointGasItem, DivePlotDataModel::O2SETPOINT, PO2_ALERT, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max); + createPPGas(o2SetpointGasItem, DivePlotDataModel::O2SETPOINT, O2SETPOINT, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max); createPPGas(ccrsensor1GasItem, DivePlotDataModel::CCRSENSOR1, CCRSENSOR1, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max); createPPGas(ccrsensor2GasItem, DivePlotDataModel::CCRSENSOR2, CCRSENSOR2, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max); createPPGas(ccrsensor3GasItem, DivePlotDataModel::CCRSENSOR3, CCRSENSOR3, PO2_ALERT, &prefs.pp_graphs.po2_threshold_min, &prefs.pp_graphs.po2_threshold_max); @@ -326,10 +326,10 @@ void ProfileWidget2::setupItemOnScene() connect(SettingsObjectWrapper::instance()->pp_gas, &PartialPressureGasSettings::showPheChanged, pheGasItem, &PartialPressureGasItem::setVisible); connect(SettingsObjectWrapper::instance()->pp_gas, &PartialPressureGasSettings::showPo2Changed, po2GasItem, &PartialPressureGasItem::setVisible); connect(SettingsObjectWrapper::instance()->pp_gas, &PartialPressureGasSettings::showPn2Changed, pn2GasItem, &PartialPressureGasItem::setVisible); - connect(SettingsObjectWrapper::instance()->pp_gas, &PartialPressureGasSettings::showPo2Changed, o2SetpointGasItem, &PartialPressureGasItem::setVisible); //WARNING: The old code was broken, I'm not sure what should trigger the visibility of those graphs, since the old code didn't triggered them // because it was using a wrong settings. + connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showCCRSetpointChanged, o2SetpointGasItem, &PartialPressureGasItem::setVisible); connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showSCROCpO2Changed, ocpo2GasItem, &PartialPressureGasItem::setVisible); connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showCCRSensorsChanged, ccrsensor1GasItem, &PartialPressureGasItem::setVisible); connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::showCCRSensorsChanged, ccrsensor2GasItem, &PartialPressureGasItem::setVisible);