diff --git a/sleepyhead/Graphs/gLineChart.cpp b/sleepyhead/Graphs/gLineChart.cpp
index 41550f87..16ac87ca 100644
--- a/sleepyhead/Graphs/gLineChart.cpp
+++ b/sleepyhead/Graphs/gLineChart.cpp
@@ -243,6 +243,11 @@ skipcheck:
addDotLine(DottedLine(CPAP_Leak, Calc_UpperThresh, schema::channel[CPAP_Leak].calc[Calc_UpperThresh].enabled));
} else if (m_codes[0] == CPAP_FlowRate) {
addDotLine(DottedLine(CPAP_FlowRate, Calc_Zero, schema::channel[CPAP_FlowRate].calc[Calc_Zero].enabled));
+ } else if (m_codes[0] == OXI_Pulse) {
+ addDotLine(DottedLine(OXI_Pulse, Calc_UpperThresh, schema::channel[OXI_Pulse].calc[Calc_UpperThresh].enabled));
+ addDotLine(DottedLine(OXI_Pulse, Calc_LowerThresh, schema::channel[OXI_Pulse].calc[Calc_LowerThresh].enabled));
+ } else if (m_codes[0] == OXI_SPO2) {
+ addDotLine(DottedLine(OXI_SPO2, Calc_LowerThresh, schema::channel[OXI_SPO2].calc[Calc_LowerThresh].enabled));
}
diff --git a/sleepyhead/SleepLib/schema.cpp b/sleepyhead/SleepLib/schema.cpp
index 53021609..469c94c3 100644
--- a/sleepyhead/SleepLib/schema.cpp
+++ b/sleepyhead/SleepLib/schema.cpp
@@ -258,11 +258,15 @@ void init()
QObject::tr("Pulse Rate"), QObject::tr("Heart rate in beats per minute"),
QObject::tr("Pulse Rate"), STR_UNIT_BPM, DEFAULT, QColor("red")));
+ schema::channel[OXI_Pulse].setLowerThreshold(40);
+ schema::channel[OXI_Pulse].setUpperThreshold(130);
schema::channel.add(GRP_OXI, new Channel(OXI_SPO2 = 0x1801, WAVEFORM, MT_OXIMETER, SESSION, "SPO2",
QObject::tr("SpO2 %"), QObject::tr("Blood-oxygen saturation percentage"),
QObject::tr("SpO2"), STR_UNIT_Percentage, DEFAULT, QColor("blue")));
+ schema::channel[OXI_SPO2].setLowerThreshold(88);
+
schema::channel.add(GRP_OXI, new Channel(OXI_Plethy = 0x1802, WAVEFORM, MT_OXIMETER, SESSION, "Plethy",
QObject::tr("Plethysomogram"),
QObject::tr("An optical Photo-plethysomogram showing heart rhythm"),
@@ -351,6 +355,8 @@ void init()
QObject::tr("Rate of detected mask leakage"), QObject::tr("Leak Rate"),
STR_UNIT_LPM, DEFAULT, QColor("dark green")));
+ schema::channel[CPAP_Leak].setLowerThreshold(24.0);
+
schema::channel.add(GRP_CPAP, new Channel(CPAP_IE = 0x1109, WAVEFORM, MT_CPAP, SESSION, "IE",
QObject::tr("I:E Ratio"),
QObject::tr("Ratio between Inspiratory and Expiratory time"), QObject::tr("I:E Ratio"),
@@ -916,10 +922,10 @@ QString ChannelCalc::label()
m_label = QObject::tr("Zero");
break;
case Calc_UpperThresh:
- m_label = QString("%1 %2").arg(lab).arg(QObject::tr("Threshold"));
+ m_label = QString("%1 %2").arg(lab).arg(QObject::tr("Upper Threshold"));
break;
case Calc_LowerThresh:
- m_label = QString("%1 %2").arg(lab).arg(QObject::tr("Threshold"));
+ m_label = QString("%1 %2").arg(lab).arg(QObject::tr("Lower Threshold"));
break;
}
return m_label;
diff --git a/sleepyhead/SleepLib/schema.h b/sleepyhead/SleepLib/schema.h
index 029cb6e5..721b2e37 100644
--- a/sleepyhead/SleepLib/schema.h
+++ b/sleepyhead/SleepLib/schema.h
@@ -148,7 +148,6 @@ class Channel
ChanType m_type;
MachineType m_machtype;
ScopeType m_scope;
- DataType m_datatype;
QString m_code; // Untranslatable
@@ -156,6 +155,7 @@ class Channel
QString m_description;
QString m_label;
QString m_unit;
+ DataType m_datatype;
QColor m_defaultcolor;
diff --git a/sleepyhead/preferencesdialog.cpp b/sleepyhead/preferencesdialog.cpp
index 362b9763..eff20b6b 100644
--- a/sleepyhead/preferencesdialog.cpp
+++ b/sleepyhead/preferencesdialog.cpp
@@ -112,6 +112,10 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
ui->showLeakRedline->setChecked(profile->cpap->showLeakRedline());
ui->leakRedlineSpinbox->setValue(profile->cpap->leakRedline());
+ ui->oxiDesaturationThreshold->setValue(schema::channel[OXI_SPO2].lowerThreshold());
+ ui->flagPulseAbove->setValue(schema::channel[OXI_Pulse].upperThreshold());
+ ui->flagPulseBelow->setValue(schema::channel[OXI_Pulse].lowerThreshold());
+
ui->spo2Drop->setValue(profile->oxi->spO2DropPercentage());
ui->spo2DropTime->setValue(profile->oxi->spO2DropDuration());
ui->pulseChange->setValue(profile->oxi->pulseChangeBPM());
@@ -231,6 +235,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
ui->overviewLinecharts->setCurrentIndex(profile->appearance->overviewLinechartMode());
ui->oximetrySync->setChecked(profile->oxi->syncOximetry());
+ ui->oximetrySync->setVisible(false);
int ot = ui->oximetryType->findText(profile->oxi->oximeterType(), Qt::MatchExactly);
if (ot < 0) { ot = 0; }
@@ -459,6 +464,11 @@ bool PreferencesDialog::Save()
}
}
+ schema::channel[OXI_SPO2].setLowerThreshold(ui->oxiDesaturationThreshold->value());
+ schema::channel[OXI_Pulse].setLowerThreshold(ui->flagPulseBelow->value());
+ schema::channel[OXI_Pulse].setUpperThreshold(ui->flagPulseAbove->value());
+
+
profile->cpap->setUserEventPieChart(ui->showUserFlagsInPie->isChecked());
profile->session->setLockSummarySessions(ui->LockSummarySessionSplitting->isChecked());
diff --git a/sleepyhead/preferencesdialog.ui b/sleepyhead/preferencesdialog.ui
index 77368c3e..a07074e4 100644
--- a/sleepyhead/preferencesdialog.ui
+++ b/sleepyhead/preferencesdialog.ui
@@ -1600,14 +1600,14 @@ Try to sync it to your PC's clock (which should be synced to a timeserver)
-
-
+
bpm
-
-
+
bpm