From 433bd5a4f85b6048ae4d3b393a4e726f3ee61026 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sat, 23 Aug 2014 16:21:50 +1000 Subject: [PATCH] Give each graph individual flag overlays --- sleepyhead/Graphs/gGraphView.cpp | 189 ++++++++++++++---- sleepyhead/Graphs/gGraphView.h | 1 - sleepyhead/Graphs/gLineChart.cpp | 54 +---- sleepyhead/Graphs/gLineChart.h | 3 +- .../loader_plugins/intellipap_loader.cpp | 4 +- .../SleepLib/loader_plugins/prs1_loader.cpp | 46 ++--- .../SleepLib/loader_plugins/resmed_loader.cpp | 4 +- .../loader_plugins/weinmann_loader.cpp | 4 + sleepyhead/SleepLib/schema.cpp | 139 ++++++------- sleepyhead/SleepLib/schema.h | 11 +- sleepyhead/build_number.h | 2 +- sleepyhead/daily.cpp | 90 +-------- sleepyhead/docs/release_notes.html | 18 +- sleepyhead/scripts/build_number | 2 +- sleepyhead/scripts/inc_build.bat | 5 - sleepyhead/sleepyhead.pro | 27 +-- 16 files changed, 294 insertions(+), 305 deletions(-) delete mode 100644 sleepyhead/scripts/inc_build.bat diff --git a/sleepyhead/Graphs/gGraphView.cpp b/sleepyhead/Graphs/gGraphView.cpp index a3fa4a1c..0fd6dcf3 100644 --- a/sleepyhead/Graphs/gGraphView.cpp +++ b/sleepyhead/Graphs/gGraphView.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) # include @@ -358,12 +360,12 @@ gGraphView::gGraphView(QWidget *parent, gGraphView *shared) plots_menu = context_menu->addMenu(tr("Plots")); connect(plots_menu, SIGNAL(triggered(QAction*)), this, SLOT(onPlotsClicked(QAction*))); - overlay_menu = context_menu->addMenu("Overlays"); +// overlay_menu = context_menu->addMenu("Overlays"); - cpap_menu = overlay_menu->addMenu(tr("CPAP")); + cpap_menu = context_menu->addMenu(tr("CPAP Overlays")); connect(cpap_menu, SIGNAL(triggered(QAction*)), this, SLOT(onOverlaysClicked(QAction*))); - oximeter_menu = overlay_menu->addMenu(tr("Oximeter")); + oximeter_menu = context_menu->addMenu(tr("Oximeter Overlays")); connect(oximeter_menu, SIGNAL(triggered(QAction*)), this, SLOT(onOverlaysClicked(QAction*))); lines_menu = context_menu->addMenu(tr("Dotted Lines")); @@ -1644,6 +1646,23 @@ Layer * gGraphView::findLayer(gGraph * graph, LayerType type) return nullptr; } +class MyWidgetAction : public QWidgetAction +{ +public: + MyWidgetAction(ChannelID code, QObject * parent = nullptr) :QWidgetAction(parent), code(code) { chbox = nullptr; } +protected: + virtual QWidget * createWidget(QWidget * parent) { + connect(chbox, SIGNAL(toggled(bool)), this, SLOT(setChecked(bool))); + connect(chbox, SIGNAL(clicked()), this, SLOT(trigger())); + + return chbox; + } + QCheckBox * chbox; + ChannelID code; +}; + + + void gGraphView::populateMenu(gGraph * graph) { // First check for any linechart for this graph.. @@ -1680,42 +1699,85 @@ void gGraphView::populateMenu(gGraph * graph) } oximeter_menu->clear(); - - using namespace schema; - ChanType flags = ChanType (SPAN | MINOR_FLAG | FLAG); - QList chans = lc->m_day->getSortedMachineChannels(MT_OXIMETER, flags); - - for (int i=0; i < chans.size() ; ++i) { - ChannelID code = chans.at(i); - QAction * action = oximeter_menu->addAction(schema::channel[code].fullname()); - action->setToolTip(schema::channel[code].description()); - action->setData(QString("%1|%2").arg(graph->name()).arg(code)); - action->setCheckable(true); - action->setChecked(schema::channel[code].enabled()); - } - - if (oximeter_menu->actions().size() > 0) { - oximeter_menu->menuAction()->setVisible(true); - overlay_menu->menuAction()->setVisible(true); - } - cpap_menu->clear(); - chans = lc->m_day->getSortedMachineChannels(MT_CPAP, flags); + using namespace schema; + quint32 showflags = schema::FLAG | schema::MINOR_FLAG | schema::SPAN; + if (p_profile->general->showUnknownFlags()) showflags |= schema::UNKNOWN; + QList chans = lc->m_day->getSortedMachineChannels(showflags); + QAction * action; + + QHash Vis; + if (chans.size() > 0) { + action = cpap_menu->addAction(QObject::tr("%1 Events").arg(graph->title())); + QFont font = QApplication::font(); + font.setBold(true); + font.setPointSize(font.pointSize() + 3); + action->setFont(font); + action->setData(QString("")); + action->setEnabled(false); + cpap_menu->addSeparator(); + + + } for (int i=0; i < chans.size() ; ++i) { ChannelID code = chans.at(i); - QAction * action = cpap_menu->addAction(schema::channel[code].fullname()); - action->setToolTip(schema::channel[code].description()); - action->setData(QString("%1|%2").arg(graph->name()).arg(code)); - action->setCheckable(true); - action->setChecked(schema::channel[code].enabled()); + schema::Channel & chan = schema::channel[code]; + + QWidgetAction * widget = new QWidgetAction(context_menu); + + QCheckBox *chbox = new QCheckBox(schema::channel[code].fullname(), context_menu); + chbox->setMouseTracking(true); + chbox->setToolTip(schema::channel[code].description()); + + widget->setDefaultWidget(chbox); + + widget->setCheckable(true); + widget->setData(QString("%1|%2").arg(graph->name()).arg(code)); + + connect(chbox, SIGNAL(toggled(bool)), widget, SLOT(setChecked(bool))); + connect(chbox, SIGNAL(clicked()), widget, SLOT(trigger())); + + bool b = lc->m_flags_enabled[code]; + chbox->setChecked(b); + Vis[chan.machtype()] += b ? 1 : 0; + + + action = nullptr; + if (chan.machtype() == MT_OXIMETER) { + oximeter_menu->insertAction(nullptr, widget); + } else if ( chan.machtype() == MT_CPAP) { + cpap_menu->insertAction(nullptr,widget); + } } + QString HideAllEvents = QObject::tr("Hide All Events"); + QString ShowAllEvents = QObject::tr("Show All Events"); if (cpap_menu->actions().size() > 0) { - cpap_menu->menuAction()->setVisible(true); - overlay_menu->menuAction()->setVisible(true); + cpap_menu->addSeparator(); + if (Vis[MT_CPAP] > 0) { + action = cpap_menu->addAction(HideAllEvents); + action->setData(QString("%1|HideAll:CPAP").arg(graph->name())); + } else { + action = cpap_menu->addAction(ShowAllEvents); + action->setData(QString("%1|ShowAll:CPAP").arg(graph->name())); + } } + if (oximeter_menu->actions().size() > 0) { + oximeter_menu->addSeparator(); + if (Vis[MT_OXIMETER] > 0) { + action = oximeter_menu->addAction(HideAllEvents); + action->setData(QString("%1|HideAll:OXI").arg(graph->name())); + } else { + action = oximeter_menu->addAction(ShowAllEvents); + action->setData(QString("%1|ShowAll:OXI").arg(graph->name())); + } + } + + oximeter_menu->menuAction()->setVisible(oximeter_menu->actions().size() > 0); + cpap_menu->menuAction()->setVisible(cpap_menu->actions().size() > 0); + } else { lines_menu->clear(); @@ -1726,7 +1788,6 @@ void gGraphView::populateMenu(gGraph * graph) oximeter_menu->menuAction()->setVisible(false); cpap_menu->clear(); cpap_menu->menuAction()->setVisible(false); - overlay_menu->menuAction()->setVisible(false); } } @@ -1754,26 +1815,66 @@ void gGraphView::onPlotsClicked(QAction *action) void gGraphView::onOverlaysClicked(QAction *action) { QString name = action->data().toString().section("|",0,0); - ChannelID code = action->data().toString().section("|",-1).toInt(); + QString data = action->data().toString().section("|",-1); + QHash::iterator it = m_graphsbyname.find(name); + if (it == m_graphsbyname.end()) return; + gGraph * graph = it.value(); - action->setChecked(!action->isChecked()); - schema::channel[code].setEnabled(!schema::channel[code].enabled()); + gLineChart * lc = dynamic_cast(findLayer(graph, LT_LineChart)); + if (!lc) return; -// QHash::iterator it = m_graphsbyname.find(name); -// if (it == m_graphsbyname.end()) return; + bool ok; + ChannelID code = data.toInt(&ok); + if (ok) { + // Just toggling a flag on/off + bool b = ! lc->m_flags_enabled[code]; + lc->m_flags_enabled[code] = b; + QWidgetAction * widget = qobject_cast(action); + if (widget) { + widget->setChecked(b); + } + timedRedraw(0); + return; + } -// gGraph * graph = it.value(); + QString hideall = data.section(":",0,0); -// gLineChart * lc = dynamic_cast(findLayer(graph, LT_LineChart)); + if ((hideall == "HideAll") || (hideall == "ShowAll")) { -// if (!lc) return; + bool value = (hideall == "HideAll") ? false : true; + QString group = data.section(":",-1).toUpper(); + MachineType mtype; + if (group == "CPAP") mtype = MT_CPAP; + else if (group == "OXI") mtype = MT_OXIMETER; + else mtype = MT_UNKNOWN; + + QHash::iterator it; + QHash::iterator mfe = lc->m_flags_enabled.end(); + + // First toggle the actual flag bits + for (it = lc->m_flags_enabled.begin(); it != mfe; ++it) { + if (schema::channel[it.key()].machtype() == mtype) { + lc->m_flags_enabled[it.key()] = value; + } + } + + // Now toggle the menu actions.. bleh + if (mtype == MT_CPAP) { + for (int i=0; i< cpap_menu->actions().size(); i++) { + if (cpap_menu->actions().at(i)->isCheckable()) { + cpap_menu->actions().at(i)->setChecked(value); + } + } + } else if (mtype == MT_OXIMETER) { + for (int i=0; i< oximeter_menu->actions().size(); i++) { + if (oximeter_menu->actions().at(i)->isCheckable()) { + oximeter_menu->actions().at(i)->setChecked(value); + } + } + } + } -// lc->m_enabled[code] = !lc->m_enabled[code]; -// graph->min_y = graph->MinY(); -// graph->max_y = graph->MaxY(); -// lc->Miny(); -// lc->Maxy(); } diff --git a/sleepyhead/Graphs/gGraphView.h b/sleepyhead/Graphs/gGraphView.h index 82bb2b2d..2cd26034 100644 --- a/sleepyhead/Graphs/gGraphView.h +++ b/sleepyhead/Graphs/gGraphView.h @@ -444,7 +444,6 @@ class gGraphView QMenu * lines_menu; QMenu * plots_menu; - QMenu * overlay_menu; QMenu * oximeter_menu; QMenu * cpap_menu; diff --git a/sleepyhead/Graphs/gLineChart.cpp b/sleepyhead/Graphs/gLineChart.cpp index 265858f2..182b4e4f 100644 --- a/sleepyhead/Graphs/gLineChart.cpp +++ b/sleepyhead/Graphs/gLineChart.cpp @@ -176,6 +176,13 @@ skipcheck: for (int i=0; i < available.size(); ++i) { ChannelID code = available.at(i); + if (!m_flags_enabled.contains(code)) { + bool b = false; + + if (((m_codes[0] == CPAP_FlowRate) || ((m_codes[0] == CPAP_MaskPressureHi))) && (schema::channel[code].machtype() == MT_CPAP)) b = true; + if ((m_codes[0] == CPAP_Leak) && (code == CPAP_LargeLeak)) b = true; + m_flags_enabled[code] = b; + } if (!m_day->channelExists(code)) continue; @@ -1010,56 +1017,14 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion) } -// for (int gi = 0; gi < m_codes.size(); gi++) { -// ChannelID code = m_codes[gi]; -// schema::Channel &chan = schema::channel[code]; -// int linewidth = (10 * ratioX); -// QRectF rec(0, rect.top()-3, 0,0); -// if (chan.upperThreshold() > 0) { -// QString text = m_threshold.at(gi); -// rec = painter.boundingRect(rec, Qt::AlignBottom | Qt::AlignLeft, text); -// rec.moveRight(legendx); -// legendx -= rec.width(); -// painter.setPen(Qt::black); -// painter.drawText(rec, Qt::AlignBottom | Qt::AlignRight, text); - -// QColor color = chan.upperThresholdColor(); -// color.setAlpha(200); -// painter.setPen(QPen(QBrush(color),1 * ratioY,Qt::DotLine)); - -// int yp = rec.top()+(rec.height()/2); -// painter.drawLine(rec.left()-linewidth, yp , rec.left()-(2 * ratioX), yp); -// legendx -= linewidth + (2*ratioX); -// } -// if (chan.lowerThreshold() > 0) { -// QString text = m_threshold.at(gi); -// rec = painter.boundingRect(rec, Qt::AlignBottom | Qt::AlignLeft, text); -// rec.moveRight(legendx); -// legendx -= rec.width(); -// painter.setPen(Qt::black); -// painter.drawText(rec, Qt::AlignBottom | Qt::AlignRight, text); - -// QColor color = chan.lowerThresholdColor(); -// color.setAlpha(200); -// painter.setPen(QPen(QBrush(color),1,Qt::DotLine)); - -// int yp = rec.top()+(rec.height()/2); -// painter.drawLine(rec.left()-linewidth, yp , rec.left()-(2 * ratioX), yp); -// legendx -= linewidth + (2*ratioX); -// } - -// } painter.setClipping(true); if (!total_points) { // No Data? - // if (m_report_empty) { QString msg = QObject::tr("Plots Disabled"); int x, y; GetTextExtent(msg, x, y, bigfont); w.renderText(msg, rect, Qt::AlignCenter, 0, Qt::gray, bigfont); -// DrawText(w,msg,left+(width/2.0)-(x/2.0),rect.top()-w.GetBottomMargin()-height/2.0+y/2.0,0,Qt::gray,bigfont); -// } } painter.setClipping(false); @@ -1113,7 +1078,10 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion) for (fit = flags.begin(); fit != flags.end(); ++fit) { ChannelID code = fit.key(); - if (!m_day->channelExists(code)) continue; + if (code == 4098) { + int i=5; Q_UNUSED(i); + } + if ((!m_flags_enabled[code]) || (!m_day->channelExists(code))) continue; gLineOverlayBar * lob = fit.value(); lob->setBlockHover(blockhover); lob->paint(painter, w, region); diff --git a/sleepyhead/Graphs/gLineChart.h b/sleepyhead/Graphs/gLineChart.h index dba694cf..b63cec3e 100644 --- a/sleepyhead/Graphs/gLineChart.h +++ b/sleepyhead/Graphs/gLineChart.h @@ -122,6 +122,7 @@ class gLineChart: public Layer void addDotLine(DottedLine dot) { m_dotlines.append(dot); } QList m_dotlines; + QHash m_flags_enabled; protected: //! \brief Mouse moved over this layers area (shows the hover-over tooltips here) @@ -143,7 +144,7 @@ class gLineChart: public Layer QVector m_codes; QStringList m_threshold; QVector m_square; - QHash m_enabled; + QHash m_enabled; // plot enabled QHash flags; QVector lines; diff --git a/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp b/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp index 450865b4..1deac880 100644 --- a/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp @@ -583,7 +583,7 @@ void IntellipapLoader::initChannels() { using namespace schema; Channel * chan = nullptr; - channel.add(GRP_CPAP, chan = new Channel(INTP_SmartFlexMode = 0x1165, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(INTP_SmartFlexMode = 0x1165, SETTING, MT_CPAP, SESSION, "INTPSmartFlexMode", QObject::tr("SmartFlex Mode"), QObject::tr("Intellipap pressure relief mode."), QObject::tr("SmartFlex Mode"), @@ -594,7 +594,7 @@ void IntellipapLoader::initChannels() chan->addOption(1, QObject::tr("Ramp Only")); chan->addOption(2, QObject::tr("Full Time")); - channel.add(GRP_CPAP, chan = new Channel(INTP_SmartFlexLevel = 0x1169, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(INTP_SmartFlexLevel = 0x1169, SETTING, MT_CPAP, SESSION, "INTPSmartFlexLevel", QObject::tr("SmartFlex Level"), QObject::tr("Intellipap pressure relief level."), QObject::tr("SmartFlex Level"), diff --git a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp index b7761774..72b1c22b 100644 --- a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp @@ -2073,14 +2073,14 @@ void PRS1Loader::initChannels() { Channel * chan = nullptr; - channel.add(GRP_CPAP, new Channel(CPAP_PressurePulse = 0x1009, MINOR_FLAG, SESSION, + channel.add(GRP_CPAP, new Channel(CPAP_PressurePulse = 0x1009, MINOR_FLAG, MT_CPAP, SESSION, "PressurePulse", QObject::tr("Pressure Pulse"), QObject::tr("A pulse of pressure 'pinged' to detect a closed airway."), QObject::tr("PP"), STR_UNIT_EventsPerHour, DEFAULT, QColor("dark red"))); - channel.add(GRP_CPAP, chan = new Channel(PRS1_FlexMode = 0xe105, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_FlexMode = 0xe105, SETTING, MT_CPAP, SESSION, "PRS1FlexMode", QObject::tr("Flex Mode"), QObject::tr("PRS1 pressure relief mode."), QObject::tr("Flex Mode"), @@ -2094,7 +2094,7 @@ void PRS1Loader::initChannels() chan->addOption(FLEX_RiseTime, QObject::tr("Rise Time")); chan->addOption(FLEX_BiFlex, QObject::tr("Bi-Flex")); - channel.add(GRP_CPAP, chan = new Channel(PRS1_FlexLevel = 0xe106, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_FlexLevel = 0xe106, SETTING, MT_CPAP, SESSION, "PRS1FlexSet", QObject::tr("Flex Level"), QObject::tr("PRS1 pressure relief setting."), @@ -2108,7 +2108,7 @@ void PRS1Loader::initChannels() chan->addOption(4, QObject::tr("x4")); chan->addOption(5, QObject::tr("x5")); - channel.add(GRP_CPAP, chan = new Channel(PRS1_HumidStatus = 0xe101, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_HumidStatus = 0xe101, SETTING, MT_CPAP, SESSION, "PRS1HumidStat", QObject::tr("Humidifier Status"), QObject::tr("PRS1 humidifier connected?"), @@ -2117,7 +2117,7 @@ void PRS1Loader::initChannels() chan->addOption(0, QObject::tr("Disconnected")); chan->addOption(1, QObject::tr("Connected")); - channel.add(GRP_CPAP, chan = new Channel(PRS1_HeatedTubing = 0xe10d, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_HeatedTubing = 0xe10d, SETTING, MT_CPAP, SESSION, "PRS1HeatedTubing", QObject::tr("Heated Tubing"), QObject::tr("Heated Tubing Connected"), @@ -2126,7 +2126,7 @@ void PRS1Loader::initChannels() chan->addOption(0, QObject::tr("Yes")); chan->addOption(1, QObject::tr("No")); - channel.add(GRP_CPAP, chan = new Channel(PRS1_HumidLevel = 0xe102, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_HumidLevel = 0xe102, SETTING, MT_CPAP, SESSION, "PRS1HumidLevel", QObject::tr("Humidification Level"), QObject::tr("PRS1 Humidification level"), @@ -2139,7 +2139,7 @@ void PRS1Loader::initChannels() chan->addOption(4, QObject::tr("x4")); chan->addOption(5, QObject::tr("x5")); - channel.add(GRP_CPAP, chan = new Channel(PRS1_SysOneResistStat = 0xe103, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_SysOneResistStat = 0xe103, SETTING, MT_CPAP, SESSION, "SysOneResistStat", QObject::tr("System One Resistance Status"), QObject::tr("System One Resistance Status"), @@ -2148,7 +2148,7 @@ void PRS1Loader::initChannels() chan->addOption(0, STR_TR_Off); chan->addOption(1, STR_TR_On); - channel.add(GRP_CPAP, chan = new Channel(PRS1_SysOneResistSet = 0xe104, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_SysOneResistSet = 0xe104, SETTING, MT_CPAP, SESSION, "SysOneResistSet", QObject::tr("System One Resistance Setting"), QObject::tr("System One Mask Resistance Setting"), @@ -2161,7 +2161,7 @@ void PRS1Loader::initChannels() chan->addOption(4, QObject::tr("x4")); chan->addOption(5, QObject::tr("x5")); - channel.add(GRP_CPAP, chan = new Channel(PRS1_HoseDiam = 0xe107, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_HoseDiam = 0xe107, SETTING, MT_CPAP, SESSION, "PRS1HoseDiam", QObject::tr("Hose Diameter"), QObject::tr("Diameter of primary CPAP hose"), @@ -2170,7 +2170,7 @@ void PRS1Loader::initChannels() chan->addOption(0, QObject::tr("22mm")); chan->addOption(1, QObject::tr("15mm")); - channel.add(GRP_CPAP, chan = new Channel(PRS1_SysOneResistStat = 0xe108, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_SysOneResistStat = 0xe108, SETTING, MT_CPAP, SESSION, "SysOneLock", QObject::tr("System One Resistance Lock"), QObject::tr("Whether System One resistance settings are available to you."), @@ -2179,7 +2179,7 @@ void PRS1Loader::initChannels() chan->addOption(0, STR_TR_Off); chan->addOption(1, STR_TR_On); - channel.add(GRP_CPAP, chan = new Channel(PRS1_AutoOn = 0xe109, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_AutoOn = 0xe109, SETTING, MT_CPAP, SESSION, "PRS1AutoOn", QObject::tr("Auto On"), QObject::tr("A few breaths automatically starts machine"), @@ -2188,7 +2188,7 @@ void PRS1Loader::initChannels() chan->addOption(0, STR_TR_Off); chan->addOption(1, STR_TR_On); - channel.add(GRP_CPAP, chan = new Channel(PRS1_AutoOff = 0xe10a, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_AutoOff = 0xe10a, SETTING, MT_CPAP, SESSION, "PRS1AutoOff", QObject::tr("Auto Off"), QObject::tr("Machine automatically switches off"), @@ -2197,7 +2197,7 @@ void PRS1Loader::initChannels() chan->addOption(0, STR_TR_Off); chan->addOption(1, STR_TR_On); - channel.add(GRP_CPAP, chan = new Channel(PRS1_MaskAlert = 0xe10b, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_MaskAlert = 0xe10b, SETTING, MT_CPAP, SESSION, "PRS1MaskAlert", QObject::tr("Mask Alert"), QObject::tr("Whether or not machine allows Mask checking."), @@ -2206,7 +2206,7 @@ void PRS1Loader::initChannels() chan->addOption(0, STR_TR_Off); chan->addOption(1, STR_TR_On); - channel.add(GRP_CPAP, chan = new Channel(PRS1_MaskAlert = 0xe10c, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(PRS1_MaskAlert = 0xe10c, SETTING, MT_CPAP, SESSION, "PRS1ShowAHI", QObject::tr("Show AHI"), QObject::tr("Whether or not machine shows AHI via LCD panel."), @@ -2226,7 +2226,7 @@ void PRS1Loader::initChannels() QString unknownname=QObject::tr("PRS1_%1"); QString unknownshort=QObject::tr("PRS1_%1"); - channel.add(GRP_CPAP, new Channel(PRS1_00 = 0x1150, UNKNOWN, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_00 = 0x1150, UNKNOWN, MT_CPAP, SESSION, "PRS1_00", QString(unknownname).arg(0,2,16,QChar('0')), QString(unknowndesc).arg(0,2,16,QChar('0')), @@ -2234,7 +2234,7 @@ void PRS1Loader::initChannels() STR_UNIT_Unknown, DEFAULT, QColor("black"))); - channel.add(GRP_CPAP, new Channel(PRS1_01 = 0x1151, UNKNOWN, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_01 = 0x1151, UNKNOWN, MT_CPAP, SESSION, "PRS1_01", QString(unknownname).arg(1,2,16,QChar('0')), QString(unknowndesc).arg(1,2,16,QChar('0')), @@ -2242,7 +2242,7 @@ void PRS1Loader::initChannels() STR_UNIT_Unknown, DEFAULT, QColor("black"))); - channel.add(GRP_CPAP, new Channel(PRS1_08 = 0x1152, UNKNOWN, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_08 = 0x1152, UNKNOWN, MT_CPAP, SESSION, "PRS1_08", QString(unknownname).arg(8,2,16,QChar('0')), QString(unknowndesc).arg(8,2,16,QChar('0')), @@ -2250,35 +2250,35 @@ void PRS1Loader::initChannels() STR_UNIT_Unknown, DEFAULT, QColor("black"))); - channel.add(GRP_CPAP, new Channel(PRS1_0A = 0x1154, UNKNOWN, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_0A = 0x1154, UNKNOWN, MT_CPAP, SESSION, "PRS1_0A", QString(unknownname).arg(0xa,2,16,QChar('0')), QString(unknowndesc).arg(0xa,2,16,QChar('0')), QString(unknownshort).arg(0xa,2,16,QChar('0')), STR_UNIT_Unknown, DEFAULT, QColor("black"))); - channel.add(GRP_CPAP, new Channel(PRS1_0B = 0x1155, UNKNOWN, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_0B = 0x1155, UNKNOWN, MT_CPAP, SESSION, "PRS1_0B", QString(unknownname).arg(0xb,2,16,QChar('0')), QString(unknowndesc).arg(0xb,2,16,QChar('0')), QString(unknownshort).arg(0xb,2,16,QChar('0')), STR_UNIT_Unknown, DEFAULT, QColor("black"))); - channel.add(GRP_CPAP, new Channel(PRS1_0C = 0x1156, UNKNOWN, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_0C = 0x1156, UNKNOWN, MT_CPAP, SESSION, "PRS1_0C", QString(unknownname).arg(0xc,2,16,QChar('0')), QString(unknowndesc).arg(0xc,2,16,QChar('0')), QString(unknownshort).arg(0xc,2,16,QChar('0')), STR_UNIT_Unknown, DEFAULT, QColor("black"))); - channel.add(GRP_CPAP, new Channel(PRS1_0E = 0x1157, UNKNOWN, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_0E = 0x1157, UNKNOWN, MT_CPAP, SESSION, "PRS1_0E", QString(unknownname).arg(0xe,2,16,QChar('0')), QString(unknowndesc).arg(0xe,2,16,QChar('0')), QString(unknownshort).arg(0xe,2,16,QChar('0')), STR_UNIT_Unknown, DEFAULT, QColor("black"))); -// channel.add(GRP_CPAP, new Channel(PRS1_12 = 0x1159, UNKNOWN, SESSION, +// channel.add(GRP_CPAP, new Channel(PRS1_12 = 0x1159, UNKNOWN, MT_CPAP, SESSION, // "PRS1_12", // QString(unknownname).arg(0x12,2,16,QChar('0')), // QString(unknowndesc).arg(0x12,2,16,QChar('0')), @@ -2287,7 +2287,7 @@ void PRS1Loader::initChannels() // DEFAULT, QColor("black"))); - channel.add(GRP_CPAP, new Channel(PRS1_TimedBreath = 0x1180, MINOR_FLAG, SESSION, + channel.add(GRP_CPAP, new Channel(PRS1_TimedBreath = 0x1180, MINOR_FLAG, MT_CPAP, SESSION, "PRS1TimedBreath", QObject::tr("Timed Breath"), QObject::tr("Machine Initiated Breath"), diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp index fcafb050..987851be 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp @@ -2450,7 +2450,7 @@ void ResmedLoader::initChannels() { using namespace schema; Channel * chan = nullptr; - channel.add(GRP_CPAP, chan = new Channel(RMS9_EPR = 0xe201, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(RMS9_EPR = 0xe201, SETTING, MT_CPAP, SESSION, "EPR", QObject::tr("EPR"), QObject::tr("ResMed Exhale Pressure Relief"), QObject::tr("EPR"), @@ -2462,7 +2462,7 @@ void ResmedLoader::initChannels() chan->addOption(2, QObject::tr("Full Time")); chan->addOption(3, QObject::tr("Patient???")); - channel.add(GRP_CPAP, chan = new Channel(RMS9_EPRLevel = 0xe202, SETTING, SESSION, + channel.add(GRP_CPAP, chan = new Channel(RMS9_EPRLevel = 0xe202, SETTING, MT_CPAP, SESSION, "EPRLevel", QObject::tr("EPR Level"), QObject::tr("Exhale Pressure Relief Level"), QObject::tr("EPR Level"), diff --git a/sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp b/sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp index f415a65c..8a0d6bd9 100644 --- a/sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/weinmann_loader.cpp @@ -165,6 +165,10 @@ int WeinmannLoader::Open(QString path) qDebug() << date; } + // stores used length of data at 0x46, in 16bit integers, for IPAP, EPAP, snore, leak, + // stores total length of data block at 0x66, in 16 bit integers for IPAP, EPAP, snore, leak + + p+=0x84; } diff --git a/sleepyhead/SleepLib/schema.cpp b/sleepyhead/SleepLib/schema.cpp index 9677b5c9..53021609 100644 --- a/sleepyhead/SleepLib/schema.cpp +++ b/sleepyhead/SleepLib/schema.cpp @@ -62,8 +62,8 @@ void init() schema_initialized = true; - EmptyChannel = Channel(0, DATA, DAY, "Empty", "Empty", "Empty Channel", "", ""); - SessionEnabledChannel = new Channel(1, DATA, DAY, "Enabled", "Enabled", "Session Enabled", "", ""); + EmptyChannel = Channel(0, DATA, MT_UNKNOWN, DAY, "Empty", "Empty", "Empty Channel", "", ""); + SessionEnabledChannel = new Channel(1, DATA, MT_UNKNOWN, DAY, "Enabled", "Enabled", "Session Enabled", "", ""); channel.channels[1] = SessionEnabledChannel; channel.names["Enabled"] = SessionEnabledChannel; @@ -100,185 +100,185 @@ void init() // Group ChannelID Code Type Scope Lookup Code Translable Name Description Shortened Name Units String FieldType Default Color // Pressure Related Settings - schema::channel.add(GRP_CPAP, new Channel(CPAP_Pressure = 0x110C, WAVEFORM, SESSION, "Pressure", + schema::channel.add(GRP_CPAP, new Channel(CPAP_Pressure = 0x110C, WAVEFORM, MT_CPAP, SESSION, "Pressure", STR_TR_Pressure, QObject::tr("Therapy Pressure"), STR_TR_Pressure, STR_UNIT_CMH2O, DEFAULT, QColor("dark green"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_IPAP = 0x110D, WAVEFORM, SESSION, "IPAP", + schema::channel.add(GRP_CPAP, new Channel(CPAP_IPAP = 0x110D, WAVEFORM, MT_CPAP, SESSION, "IPAP", STR_TR_IPAP, QObject::tr("Inspiratory Pressure"), STR_TR_IPAP, STR_UNIT_CMH2O, DEFAULT, QColor("red"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_IPAPLo = 0x1110, WAVEFORM, SESSION, "IPAPLo", + schema::channel.add(GRP_CPAP, new Channel(CPAP_IPAPLo = 0x1110, WAVEFORM, MT_CPAP, SESSION, "IPAPLo", STR_TR_IPAPLo, QObject::tr("Lower Inspiratory Pressure"), STR_TR_IPAPLo, STR_UNIT_CMH2O, DEFAULT, QColor("orange"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_IPAPHi = 0x1111, WAVEFORM, SESSION, "IPAPHi", + schema::channel.add(GRP_CPAP, new Channel(CPAP_IPAPHi = 0x1111, WAVEFORM, MT_CPAP, SESSION, "IPAPHi", STR_TR_IPAPHi, QObject::tr("Higher Inspiratory Pressure"), STR_TR_IPAPHi, STR_UNIT_CMH2O, DEFAULT, QColor("orange"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_EPAP = 0x110E, WAVEFORM, SESSION, "EPAP", + schema::channel.add(GRP_CPAP, new Channel(CPAP_EPAP = 0x110E, WAVEFORM, MT_CPAP, SESSION, "EPAP", STR_TR_EPAP, QObject::tr("Expiratory Pressure"), STR_TR_EPAP, STR_UNIT_CMH2O, DEFAULT, QColor("green"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_EPAPLo = 0x111C, WAVEFORM, SESSION, "EPAPLo", + schema::channel.add(GRP_CPAP, new Channel(CPAP_EPAPLo = 0x111C, WAVEFORM, MT_CPAP, SESSION, "EPAPLo", STR_TR_EPAPLo, QObject::tr("Lower Expiratory Pressure"), STR_TR_EPAPLo, STR_UNIT_CMH2O, DEFAULT, QColor("light blue"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_EPAPHi = 0x111D, WAVEFORM, SESSION, "EPAPHi", + schema::channel.add(GRP_CPAP, new Channel(CPAP_EPAPHi = 0x111D, WAVEFORM, MT_CPAP, SESSION, "EPAPHi", STR_TR_EPAPHi, QObject::tr("Higher Expiratory Pressure"), STR_TR_EPAPHi, STR_UNIT_CMH2O, DEFAULT, QColor("aqua"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_PS = 0x110F, WAVEFORM, SESSION, "PS", + schema::channel.add(GRP_CPAP, new Channel(CPAP_PS = 0x110F, WAVEFORM, MT_CPAP, SESSION, "PS", STR_TR_PS, QObject::tr("Pressure Support"), STR_TR_PS, STR_UNIT_CMH2O, DEFAULT, QColor("grey"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_PSMin = 0x111A, SETTING, SESSION, "PSMin", + schema::channel.add(GRP_CPAP, new Channel(CPAP_PSMin = 0x111A, SETTING, MT_CPAP, SESSION, "PSMin", QObject::tr("PS Min") , QObject::tr("Pressure Support Minimum"), QObject::tr("PS Min"), STR_UNIT_CMH2O, DEFAULT, QColor("dark cyan"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_PSMax = 0x111B, SETTING, SESSION, "PSMax", + schema::channel.add(GRP_CPAP, new Channel(CPAP_PSMax = 0x111B, SETTING, MT_CPAP, SESSION, "PSMax", QObject::tr("PS Max"), QObject::tr("Pressure Support Maximum"), QObject::tr("PS Max"), STR_UNIT_CMH2O, DEFAULT, QColor("dark magenta"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_PressureMin = 0x1020, SETTING, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_PressureMin = 0x1020, SETTING, MT_CPAP, SESSION, "PressureMin", QObject::tr("Min Pressure") , QObject::tr("Minimum Therapy Pressure"), QObject::tr("Pressure Min"), STR_UNIT_CMH2O, DEFAULT, QColor("black"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_PressureMax = 0x1021, SETTING, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_PressureMax = 0x1021, SETTING, MT_CPAP, SESSION, "PressureMax", QObject::tr("Max Pressure"), QObject::tr("Maximum Therapy Pressure"), QObject::tr("Pressure Max"), STR_UNIT_CMH2O, DEFAULT, QColor("black"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_RampTime = 0x1022, SETTING, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_RampTime = 0x1022, SETTING, MT_CPAP, SESSION, "RampTime", QObject::tr("Ramp Time") , QObject::tr("Ramp Delay Period"), QObject::tr("Ramp Time"), STR_UNIT_Minutes, DEFAULT, QColor("black"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_RampPressure = 0x1023, SETTING, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_RampPressure = 0x1023, SETTING, MT_CPAP, SESSION, "RampPressure", QObject::tr("Ramp Pressure"), QObject::tr("Starting Ramp Pressure"), QObject::tr("Ramp Pressure"), STR_UNIT_CMH2O, DEFAULT, QColor("black"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_Ramp = 0x1027, SPAN, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_Ramp = 0x1027, SPAN, MT_CPAP, SESSION, "Ramp", QObject::tr("Ramp Event") , QObject::tr("Ramp Event"), QObject::tr("Ramp"), STR_UNIT_EventsPerHour, DEFAULT, QColor("light blue"))); // Flags - schema::channel.add(GRP_CPAP, new Channel(CPAP_CSR = 0x1000, SPAN, SESSION, "CSR", + schema::channel.add(GRP_CPAP, new Channel(CPAP_CSR = 0x1000, SPAN, MT_CPAP, SESSION, "CSR", QObject::tr("Periodic Breathing"), QObject::tr("A period of periodic breathing"), QObject::tr("PB"), STR_UNIT_Percentage, DEFAULT, COLOR_CSR)); - schema::channel.add(GRP_CPAP, new Channel(CPAP_ClearAirway = 0x1001, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_ClearAirway = 0x1001, FLAG, MT_CPAP, SESSION, "ClearAirway", QObject::tr("Clear Airway Apnea"), QObject::tr("An apnea where the airway is open"), QObject::tr("CA"), STR_UNIT_EventsPerHour, DEFAULT, QColor("purple"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_Obstructive = 0x1002, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_Obstructive = 0x1002, FLAG, MT_CPAP, SESSION, "Obstructive", QObject::tr("Obstructive Apnea"), QObject::tr("An apnea caused by airway obstruction"), QObject::tr("OA"), STR_UNIT_EventsPerHour, DEFAULT, QColor("#40c0ff"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_Hypopnea = 0x1003, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_Hypopnea = 0x1003, FLAG, MT_CPAP, SESSION, "Hypopnea", QObject::tr("Hypopnea"), QObject::tr("A partially obstructed airway"), QObject::tr("H"), STR_UNIT_EventsPerHour, DEFAULT, QColor("blue"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_Apnea = 0x1004, FLAG, SESSION, "Apnea", + schema::channel.add(GRP_CPAP, new Channel(CPAP_Apnea = 0x1004, FLAG, MT_CPAP, SESSION, "Apnea", QObject::tr("Unclassified Apnea"), QObject::tr("An apnea that could not fit into a category"), QObject::tr("UA"), STR_UNIT_EventsPerHour, DEFAULT, QColor("dark green"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_FlowLimit = 0x1005, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_FlowLimit = 0x1005, FLAG, MT_CPAP, SESSION, "FlowLimit", QObject::tr("Flow Limitation"), QObject::tr("An restriction in breathing from normal, causing a flattening of the flow waveform."), QObject::tr("FL"), STR_UNIT_EventsPerHour, DEFAULT, QColor("#404040"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_RERA = 0x1006, FLAG, SESSION, "RERA", + schema::channel.add(GRP_CPAP, new Channel(CPAP_RERA = 0x1006, FLAG, MT_CPAP, SESSION, "RERA", QObject::tr("Respiratory Effort Related Arousal"), QObject::tr("An restriction in breathing that causes an either an awakening or sleep disturbance."), QObject::tr("RE"), STR_UNIT_EventsPerHour, DEFAULT, QColor("gold"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_VSnore = 0x1007, FLAG, SESSION, "VSnore", + schema::channel.add(GRP_CPAP, new Channel(CPAP_VSnore = 0x1007, FLAG, MT_CPAP, SESSION, "VSnore", QObject::tr("Vibratory Snore"), QObject::tr("A vibratory snore"), QObject::tr("VS"), STR_UNIT_EventsPerHour, DEFAULT, QColor("red"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_VSnore2 = 0x1008, FLAG, SESSION, "VSnore2", + schema::channel.add(GRP_CPAP, new Channel(CPAP_VSnore2 = 0x1008, FLAG, MT_CPAP, SESSION, "VSnore2", QObject::tr("Vibratory Snore (VS2) "), QObject::tr("A vibratory snore as detcted by a System One machine"), QObject::tr("VS2"), STR_UNIT_EventsPerHour, DEFAULT, QColor("red"))); // This Large Leak record is just a flag marker, used by Intellipap for one - schema::channel.add(GRP_CPAP, new Channel(CPAP_LeakFlag = 0x100a, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_LeakFlag = 0x100a, FLAG, MT_CPAP, SESSION, "LeakFlag", QObject::tr("Leak Flag"), QObject::tr("A large mask leak affecting machine performance."), QObject::tr("LF"), STR_UNIT_EventsPerHour, DEFAULT, QColor("light gray"))); // The following is a Large Leak record that references a waveform span - schema::channel.add(GRP_CPAP, new Channel(CPAP_LargeLeak = 0x1158, SPAN, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_LargeLeak = 0x1158, SPAN, MT_CPAP, SESSION, "LeakSpan", QObject::tr("Large Leak"), QObject::tr("A large mask leak affecting machine performance."), QObject::tr("LL"), STR_UNIT_EventsPerHour, DEFAULT, QColor("light gray"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_NRI = 0x100b, FLAG, SESSION, "NRI", + schema::channel.add(GRP_CPAP, new Channel(CPAP_NRI = 0x100b, FLAG, MT_CPAP, SESSION, "NRI", QObject::tr("Non Responding Event"), QObject::tr("A type of respiratory event that won't respond to a pressure increase."), QObject::tr("NR"), STR_UNIT_EventsPerHour, DEFAULT, QColor("orange"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_ExP = 0x100c, FLAG, SESSION, "ExP", + schema::channel.add(GRP_CPAP, new Channel(CPAP_ExP = 0x100c, FLAG, MT_CPAP, SESSION, "ExP", QObject::tr("Expiratory Puff"), QObject::tr("Intellipap event where you breathe out your mouth."), QObject::tr("EP"), STR_UNIT_EventsPerHour, DEFAULT, QColor("dark magenta"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_SensAwake = 0x100d, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_SensAwake = 0x100d, FLAG, MT_CPAP, SESSION, "SensAwake", QObject::tr("SensAwake"), QObject::tr("SensAwake feature will reduce pressure when waking is detected."), QObject::tr("SA"), STR_UNIT_EventsPerHour, DEFAULT, QColor("gold"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_UserFlag1 = 0x101e, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_UserFlag1 = 0x101e, FLAG, MT_CPAP, SESSION, "UserFlag1", QObject::tr("User Flag #1"), QObject::tr("A user definable event detected by SleepyHead's flow waveform processor."), QObject::tr("UF1"), STR_UNIT_EventsPerHour, DEFAULT, QColor(0xc0,0xc0,0xe0))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_UserFlag2 = 0x101f, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_UserFlag2 = 0x101f, FLAG, MT_CPAP, SESSION, "UserFlag2", QObject::tr("User Flag #2"), QObject::tr("A user definable event detected by SleepyHead's flow waveform processor."), QObject::tr("UF2"), STR_UNIT_EventsPerHour, DEFAULT, QColor(0xa0,0xa0,0xc0))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_UserFlag3 = 0x1024, FLAG, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_UserFlag3 = 0x1024, FLAG, MT_CPAP, SESSION, "UserFlag3", QObject::tr("User Flag #3"), QObject::tr("A user definable event detected by SleepyHead's flow waveform processor."), QObject::tr("UF3"), STR_UNIT_EventsPerHour, DEFAULT, QColor("dark grey"))); // Oximetry - schema::channel.add(GRP_OXI, new Channel(OXI_Pulse = 0x1800, WAVEFORM, SESSION, "Pulse", + schema::channel.add(GRP_OXI, new Channel(OXI_Pulse = 0x1800, WAVEFORM, MT_OXIMETER, SESSION, "Pulse", QObject::tr("Pulse Rate"), QObject::tr("Heart rate in beats per minute"), QObject::tr("Pulse Rate"), STR_UNIT_BPM, DEFAULT, QColor("red"))); - schema::channel.add(GRP_OXI, new Channel(OXI_SPO2 = 0x1801, WAVEFORM, SESSION, "SPO2", + 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.add(GRP_OXI, new Channel(OXI_Plethy = 0x1802, WAVEFORM, SESSION, "Plethy", + 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"), QObject::tr("Plethy"), STR_UNIT_Hz, DEFAULT, QColor("#404040"))); - schema::channel.add(GRP_OXI, new Channel(OXI_Perf = 0x1805, WAVEFORM, SESSION, "Perf. Index", + schema::channel.add(GRP_OXI, new Channel(OXI_Perf = 0x1805, WAVEFORM, MT_OXIMETER, SESSION, "Perf. Index", QObject::tr("Perfusion Index"), QObject::tr("A relative assessment of the pulse strength at the monitoring site"), - QObject::tr("Perf. Index %"), STR_UNIT_Percentage, DEFAULT, QColor("magenta"))); + QObject::tr("Perf. Index %"), STR_UNIT_Percentage, DEFAULT, QColor("magenta"))); - schema::channel.add(GRP_OXI, new Channel(OXI_PulseChange = 0x1803, FLAG, SESSION, + schema::channel.add(GRP_OXI, new Channel(OXI_PulseChange = 0x1803, FLAG, MT_OXIMETER, SESSION, "PulseChange", QObject::tr("Pulse Change"), QObject::tr("A sudden (user definable) change in heart rate"), - QObject::tr("PC"), STR_UNIT_EventsPerHour, DEFAULT, QColor("light grey"))); + QObject::tr("PC"), STR_UNIT_EventsPerHour, DEFAULT, QColor("light grey"))); - schema::channel.add(GRP_OXI, new Channel(OXI_SPO2Drop = 0x1804, FLAG, SESSION, + schema::channel.add(GRP_OXI, new Channel(OXI_SPO2Drop = 0x1804, FLAG, MT_OXIMETER, SESSION, "SPO2Drop", QObject::tr("SpO2 Drop"), QObject::tr("A sudden (user definable) drop in blood oxygen saturation"), QObject::tr("SD"), STR_UNIT_EventsPerHour, DEFAULT, QColor("light blue"))); @@ -306,127 +306,127 @@ void init() // - schema::channel.add(GRP_CPAP, new Channel(CPAP_FlowRate = 0x1100, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_FlowRate = 0x1100, WAVEFORM, MT_CPAP, SESSION, "FlowRate", QObject::tr("Flow Rate"), QObject::tr("Breathing flow rate waveform"), QObject::tr("Flow Rate"), STR_UNIT_LPM, DEFAULT, QColor("black"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_MaskPressure = 0x1101, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_MaskPressure = 0x1101, WAVEFORM, MT_CPAP, SESSION, "MaskPressure", QObject::tr("Mask Pressure"), QObject::tr("Mask Pressure"), QObject::tr("Mask Pressure"), STR_UNIT_CMH2O, DEFAULT, QColor("blue"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_MaskPressureHi = 0x1102, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_MaskPressureHi = 0x1102, WAVEFORM, MT_CPAP, SESSION, "MaskPressureHi", QObject::tr("Mask Pressure"), QObject::tr("Mask Pressure (High resolution)"), QObject::tr("Mask Pressure"), STR_UNIT_CMH2O, DEFAULT, QColor("blue"), 0x1101)); // linked to CPAP_MaskPressure - schema::channel.add(GRP_CPAP, new Channel(CPAP_TidalVolume = 0x1103, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_TidalVolume = 0x1103, WAVEFORM, MT_CPAP, SESSION, "TidalVolume", QObject::tr("Tidal Volume"), QObject::tr("Amount of air displaced per breath"), QObject::tr("Tidal Volume"), STR_UNIT_ml, DEFAULT, QColor("magenta"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_Snore = 0x1104, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_Snore = 0x1104, WAVEFORM, MT_CPAP, SESSION, "Snore", QObject::tr("Snore"), QObject::tr("Graph displaying snore volume"), QObject::tr("Snore"), STR_UNIT_Unknown, DEFAULT, QColor("grey"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_MinuteVent = 0x1105, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_MinuteVent = 0x1105, WAVEFORM, MT_CPAP, SESSION, "MinuteVent", QObject::tr("Minute Ventilation"), QObject::tr("Amount of air displaced per minute"), QObject::tr("Minute Vent."), STR_UNIT_LPM, DEFAULT, QColor("dark cyan"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_RespRate = 0x1106, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_RespRate = 0x1106, WAVEFORM, MT_CPAP, SESSION, "RespRate", QObject::tr("Respiratory Rate"), QObject::tr("Rate of breaths per minute"), QObject::tr("Resp. Rate"), STR_UNIT_BreathsPerMinute, DEFAULT, QColor("dark magenta"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_PTB = 0x1107, WAVEFORM, SESSION, "PTB", + schema::channel.add(GRP_CPAP, new Channel(CPAP_PTB = 0x1107, WAVEFORM, MT_CPAP, SESSION, "PTB", QObject::tr("Patient Triggered Breaths"), QObject::tr("Percentage of breaths triggered by patient"), QObject::tr("Pat. Trig. Breaths"), STR_UNIT_Percentage, DEFAULT, QColor("dark grey"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_Leak = 0x1108, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_Leak = 0x1108, WAVEFORM, MT_CPAP, SESSION, "Leak", QObject::tr("Leak Rate"), QObject::tr("Rate of detected mask leakage"), QObject::tr("Leak Rate"), STR_UNIT_LPM, DEFAULT, QColor("dark green"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_IE = 0x1109, WAVEFORM, SESSION, "IE", + 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"), STR_UNIT_Ratio, DEFAULT, QColor("dark red"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_Te = 0x110A, WAVEFORM, SESSION, "Te", + schema::channel.add(GRP_CPAP, new Channel(CPAP_Te = 0x110A, WAVEFORM, MT_CPAP, SESSION, "Te", QObject::tr("Expiratory Time"), QObject::tr("Time taken to breathe out"), QObject::tr("Exp. Time"), STR_UNIT_Seconds, DEFAULT, QColor("dark green"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_Ti = 0x110B, WAVEFORM, SESSION, "Ti", + schema::channel.add(GRP_CPAP, new Channel(CPAP_Ti = 0x110B, WAVEFORM, MT_CPAP, SESSION, "Ti", QObject::tr("Inspiratory Time"), QObject::tr("Time taken to breathe in"), QObject::tr("Insp. Time"), STR_UNIT_Seconds, DEFAULT, QColor("dark blue"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_RespEvent = 0x1112, DATA, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_RespEvent = 0x1112, DATA, MT_CPAP, SESSION, "RespEvent", QObject::tr("Respiratory Event"), QObject::tr("A ResMed data source showing Respiratory Events"), QObject::tr("Resp. Event"), STR_UNIT_EventsPerHour, DEFAULT, QColor("black"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_FLG = 0x1113, WAVEFORM, SESSION, "FLG", + schema::channel.add(GRP_CPAP, new Channel(CPAP_FLG = 0x1113, WAVEFORM, MT_CPAP, SESSION, "FLG", QObject::tr("Flow Limitation"), QObject::tr("Graph showing severity of flow limitations"), QObject::tr("Flow Limit."), STR_UNIT_Severity, DEFAULT, QColor("dark gray"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_TgMV = 0x1114, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_TgMV = 0x1114, WAVEFORM, MT_CPAP, SESSION, "TgMV", QObject::tr("Target Minute Ventilation"), QObject::tr("Target Minute Ventilation?"), QObject::tr("Target Vent."), STR_UNIT_LPM, DEFAULT, QColor("dark cyan"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_MaxLeak = 0x1115, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_MaxLeak = 0x1115, WAVEFORM, MT_CPAP, SESSION, "MaxLeak", QObject::tr("Maximum Leak"), QObject::tr("The maximum rate of mask leakage"), QObject::tr("Max Leaks"), STR_UNIT_LPM, DEFAULT, QColor("dark red"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_AHI = 0x1116, WAVEFORM, SESSION, "AHI", + schema::channel.add(GRP_CPAP, new Channel(CPAP_AHI = 0x1116, WAVEFORM, MT_CPAP, SESSION, "AHI", QObject::tr("Apnea Hypopnea Index"), QObject::tr("Graph showing running AHI for the past hour"), QObject::tr("AHI"), STR_UNIT_EventsPerHour, DEFAULT, QColor("dark red"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_LeakTotal = 0x1117, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_LeakTotal = 0x1117, WAVEFORM, MT_CPAP, SESSION, "LeakTotal", QObject::tr("Total Leak Rate"), QObject::tr("Detected mask leakage including natural Mask leakages"), QObject::tr("Total Leaks"), STR_UNIT_LPM, DEFAULT, QColor("dark green"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_LeakMedian = 0x1118, WAVEFORM, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_LeakMedian = 0x1118, WAVEFORM, MT_CPAP, SESSION, "LeakMedian", QObject::tr("Median Leak Rate"), QObject::tr("Median rate of detected mask leakage"), QObject::tr("Median Leaks"), STR_UNIT_LPM, DEFAULT, QColor("dark green"))); - schema::channel.add(GRP_CPAP, new Channel(CPAP_RDI = 0x1119, WAVEFORM, SESSION, "RDI", + schema::channel.add(GRP_CPAP, new Channel(CPAP_RDI = 0x1119, WAVEFORM, MT_CPAP, SESSION, "RDI", QObject::tr("Respiratory Disturbance Index"), QObject::tr("Graph showing running RDI for the past hour"), QObject::tr("RDI"), STR_UNIT_EventsPerHour, DEFAULT, QColor("dark red"))); // Positional sensors - schema::channel.add(GRP_POS, new Channel(POS_Orientation = 0x2990, DATA, SESSION, + schema::channel.add(GRP_POS, new Channel(POS_Orientation = 0x2990, DATA, MT_POSITION, SESSION, "Orientation", QObject::tr("Orientation"), QObject::tr("Sleep position in degrees"), QObject::tr("Orientation"), STR_UNIT_Degrees, DEFAULT, QColor("dark blue"))); - schema::channel.add(GRP_POS, new Channel(POS_Inclination = 0x2991, DATA, SESSION, + schema::channel.add(GRP_POS, new Channel(POS_Inclination = 0x2991, DATA, MT_POSITION, SESSION, "Inclination", QObject::tr("Inclination"), QObject::tr("Upright angle in degrees"), QObject::tr("Inclination"), STR_UNIT_Degrees, DEFAULT, QColor("dark magenta"))); - schema::channel.add(GRP_CPAP, new Channel(RMS9_MaskOnTime = 0x1025, DATA, SESSION, + schema::channel.add(GRP_CPAP, new Channel(RMS9_MaskOnTime = 0x1025, DATA, MT_CPAP, SESSION, "MaskOnTime", QObject::tr("Mask On Time"), QObject::tr("Time started according to str.edf"), QObject::tr("Mask On Time"), STR_UNIT_Unknown, DEFAULT, Qt::black)); - schema::channel.add(GRP_CPAP, new Channel(CPAP_SummaryOnly = 0x1026, DATA, SESSION, + schema::channel.add(GRP_CPAP, new Channel(CPAP_SummaryOnly = 0x1026, DATA, MT_CPAP, SESSION, "SummaryOnly", QObject::tr("Summary Only"), QObject::tr("CPAP Session contains summary data only"), QObject::tr("Summary Only"), STR_UNIT_Unknown, DEFAULT, Qt::black)); Channel *ch; - schema::channel.add(GRP_CPAP, ch = new Channel(CPAP_Mode = 0x1200, SETTING, SESSION, + schema::channel.add(GRP_CPAP, ch = new Channel(CPAP_Mode = 0x1200, SETTING, MT_CPAP, SESSION, "PAPMode", QObject::tr("PAP Mode"), QObject::tr("PAP Device Mode"), QObject::tr("PAP Mode"), QString(), @@ -555,10 +555,11 @@ void resetChannels() } } -Channel::Channel(ChannelID id, ChanType type, ScopeType scope, QString code, QString fullname, +Channel::Channel(ChannelID id, ChanType type, MachineType machtype, ScopeType scope, QString code, QString fullname, QString description, QString label, QString unit, DataType datatype, QColor color, int link): m_id(id), m_type(type), + m_machtype(machtype), m_scope(scope), m_code(code), m_fullname(fullname), @@ -753,7 +754,7 @@ bool ChannelList::Load(QString filename) continue; } - chan = new Channel(id, type, scope, name, name, details, label, unit, datatype, color, linkid); + chan = new Channel(id, type, MT_UNKNOWN, scope, name, name, details, label, unit, datatype, color, linkid); channels[id] = chan; names[name] = chan; //qDebug() << "Channel" << id << name << label; diff --git a/sleepyhead/SleepLib/schema.h b/sleepyhead/SleepLib/schema.h index 7e82c27b..029cb6e5 100644 --- a/sleepyhead/SleepLib/schema.h +++ b/sleepyhead/SleepLib/schema.h @@ -87,8 +87,8 @@ extern Channel EmptyChannel; class Channel { public: - Channel() { m_id = 0; m_upperThreshold = 0; m_lowerThreshold = 0; m_enabled = true; m_order = 255; } - Channel(ChannelID id, ChanType type, ScopeType scope, QString code, QString fullname, + Channel() { m_id = 0; m_upperThreshold = 0; m_lowerThreshold = 0; m_enabled = true; m_order = 255; m_machtype = MT_UNKNOWN; } + Channel(ChannelID id, ChanType type, MachineType machtype, ScopeType scope, QString code, QString fullname, QString description, QString label, QString unit, DataType datatype = DEFAULT, QColor = Qt::black, int link = 0); void addColor(Function f, QColor color) { m_colors[f] = color; } @@ -97,6 +97,7 @@ class Channel inline ChannelID id() const { return m_id; } inline ChanType type() const { return m_type; } inline DataType datatype() const { return m_datatype; } + inline MachineType machtype() const { return m_machtype; } const QString &code() { return m_code; } const QString &fullname() { return m_fullname; } const QString &description() { return m_description; } @@ -143,17 +144,21 @@ class Channel protected: int m_id; + ChanType m_type; + MachineType m_machtype; ScopeType m_scope; + DataType m_datatype; + QString m_code; // Untranslatable QString m_fullname; // Translatable Name QString m_description; QString m_label; QString m_unit; - DataType m_datatype; QColor m_defaultcolor; + int m_link; EventDataType m_upperThreshold; diff --git a/sleepyhead/build_number.h b/sleepyhead/build_number.h index bb6ffb71..67e89cde 100644 --- a/sleepyhead/build_number.h +++ b/sleepyhead/build_number.h @@ -1 +1 @@ -const int build_number = 9; +const int build_number = 10; diff --git a/sleepyhead/daily.cpp b/sleepyhead/daily.cpp index 1d28e3b9..c61fc105 100644 --- a/sleepyhead/daily.cpp +++ b/sleepyhead/daily.cpp @@ -164,8 +164,8 @@ Daily::Daily(QWidget *parent,gGraphView * shared) SF->setPinned(true); ChannelID cpapcodes[] = { - CPAP_FlowRate, CPAP_MaskPressure, CPAP_Pressure, CPAP_Leak, CPAP_Snore, CPAP_RespRate, - CPAP_TidalVolume, CPAP_MinuteVent, CPAP_FLG, CPAP_PTB, CPAP_RespEvent, CPAP_Ti, CPAP_Te, + CPAP_FlowRate, CPAP_MaskPressure, CPAP_Pressure, CPAP_Leak, CPAP_Snore, CPAP_FLG, CPAP_RespRate, + CPAP_TidalVolume, CPAP_MinuteVent,CPAP_PTB, CPAP_RespEvent, CPAP_Ti, CPAP_Te, CPAP_IE, ZEO_SleepStage, POS_Inclination, POS_Orientation, CPAP_Test1 }; @@ -196,17 +196,6 @@ Daily::Daily(QWidget *parent,gGraphView * shared) graphlist["AHI"] = AHI; -// graphlist["INTPULSE"] = new gGraph("INTPULSE", GraphView,tr("Int. Pulse"), channelInfo(OXI_Pulse), default_height, oxigrp); -// graphlist["INTSPO2"] = new gGraph("INTSPO2", GraphView,tr("Int. SpO2"), channelInfo(OXI_SPO2), default_height, oxigrp); - - // Event Pie Chart (for snapshot purposes) - // TODO: Convert snapGV to generic for snapshotting multiple graphs (like reports does) -// TAP=new gGraph(GraphView,"Time@Pressure",STR_UNIT_CMH2O,100); -// TAP->showTitle(false); -// gTAPGraph * tap=new gTAPGraph(CPAP_Pressure,GST_Line); -// TAP->AddLayer(AddCPAP(tap)); - //TAP->setMargins(0,0,0,0); - graphlist[STR_GRAPH_EventBreakdown] = GAHI = new gGraph(STR_GRAPH_EventBreakdown, snapGV,tr("Breakdown"),tr("events"),172); gSegmentChart * evseg=new gSegmentChart(GST_Pie); evseg->AddSlice(CPAP_Hypopnea,QColor(0x40,0x40,0xff,0xff),STR_TR_H); @@ -227,44 +216,15 @@ Daily::Daily(QWidget *parent,gGraphView * shared) GAHI->AddLayer(AddCPAP(evseg)); GAHI->setMargins(0,0,0,0); - -// gSegmentChart * evseg2=new gSegmentChart(GST_Pie); -// evseg2->AddSlice(CPAP_Hypopnea,QColor(0x40,0x40,0xff,0xff),STR_TR_H); -// evseg2->AddSlice(CPAP_Apnea,QColor(0x20,0x80,0x20,0xff),STR_TR_UA); -// evseg2->AddSlice(CPAP_Obstructive,QColor(0x40,0xaf,0xbf,0xff),STR_TR_OA); -// evseg2->AddSlice(CPAP_ClearAirway,QColor(0xb2,0x54,0xcd,0xff),STR_TR_CA); - -// SG->AddLayer(AddCPAP(evseg2), LayerRight, default_height, default_height, 0, false, default_height); - gFlagsGroup *fg=new gFlagsGroup(); SF->AddLayer(AddCPAP(fg)); - // Spans -// fg->AddLayer((new gFlagsLine(CPAP_CSR, COLOR_CSR, STR_TR_PB, false, FT_Span))); -// fg->AddLayer((new gFlagsLine(CPAP_LargeLeak, COLOR_LargeLeak, STR_TR_LL, false, FT_Span))); -// fg->AddLayer((new gFlagsLine(CPAP_Ramp, COLOR_Ramp, schema::channel[CPAP_Ramp].label(), false, FT_Span))); -// // Flags -// fg->AddLayer((new gFlagsLine(CPAP_ClearAirway, COLOR_ClearAirway, STR_TR_CA,false))); -// fg->AddLayer((new gFlagsLine(CPAP_Obstructive, COLOR_Obstructive, STR_TR_OA,true))); -// fg->AddLayer((new gFlagsLine(CPAP_Apnea, COLOR_Apnea, STR_TR_UA))); -// fg->AddLayer((new gFlagsLine(CPAP_Hypopnea, COLOR_Hypopnea, STR_TR_H,true))); -// fg->AddLayer((new gFlagsLine(CPAP_ExP, COLOR_ExP, STR_TR_EP,false))); -// fg->AddLayer((new gFlagsLine(CPAP_LeakFlag, COLOR_LeakFlag, STR_TR_LE,false))); -// fg->AddLayer((new gFlagsLine(CPAP_NRI, COLOR_NRI, STR_TR_NRI,false))); -// fg->AddLayer((new gFlagsLine(CPAP_FlowLimit, COLOR_FlowLimit, STR_TR_FL))); -// fg->AddLayer((new gFlagsLine(CPAP_SensAwake, COLOR_SensAwake, STR_TR_SA))); -// fg->AddLayer((new gFlagsLine(CPAP_RERA, COLOR_RERA, STR_TR_RE))); -// fg->AddLayer((new gFlagsLine(CPAP_VSnore, COLOR_VibratorySnore, STR_TR_VS))); -// fg->AddLayer((new gFlagsLine(CPAP_VSnore2, COLOR_VibratorySnore, STR_TR_VS2))); -// if (p_profile->cpap->userEventFlagging()) { -// fg->AddLayer((new gFlagsLine(CPAP_UserFlag1, COLOR_Yellow, STR_TR_UF1))); -// fg->AddLayer((new gFlagsLine(CPAP_UserFlag2, COLOR_DarkGreen, STR_TR_UF2))); -// fg->AddLayer((new gFlagsLine(CPAP_UserFlag3, COLOR_Brown, STR_TR_UF3))); -// } - //fg->AddLayer((new gFlagsLine(PRS1_0B,COLOR_DarkGreen,tr("U0B")))); + + SF->setBlockZoom(true); SF->AddLayer(new gShadowArea()); SF->AddLayer(new gLabelArea(fg),LayerLeft,gYAxis::Margin); + //SF->AddLayer(new gFooBar(),LayerBottom,0,1); SF->AddLayer(new gXAxis(COLOR_Text,false),LayerBottom,0,20); //gXAxis::Margin); @@ -286,55 +246,21 @@ Daily::Daily(QWidget *parent,gGraphView * shared) gLineChart *l; l=new gLineChart(CPAP_FlowRate,false,false); - //gLineOverlaySummary *los=new gLineOverlaySummary(tr("Selection AHI"),5,-4); AddCPAP(l); gGraph *FRW = graphlist[schema::channel[CPAP_FlowRate].code()]; - // Draw layer is important... spans first.. -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_CSR, COLOR_CSR, STR_TR_CSR, FT_Span))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_LargeLeak, COLOR_LargeLeak, STR_TR_LL, FT_Span))); - //FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Ramp, COLOR_Ramp, schema::channel[CPAP_Ramp].label(), FT_Span))); - // Then the graph itself FRW->AddLayer(l); - // Then the LineOverlaySummaries -// FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Hypopnea,COLOR_Hypopnea,STR_TR_H)))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_PressurePulse,COLOR_PressurePulse,STR_TR_PP,FT_Dot))); -// //FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Pressure, COLOR_White,STR_TR_P,FT_Dot))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0B,COLOR_Blue,"0B",FT_Dot))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0E,COLOR_DarkRed,"0E",FT_Dot))); -// gLineOverlayBar * rera = new gLineOverlayBar(CPAP_RERA, COLOR_RERA, STR_TR_RE); -// if (p_profile->general->calculateRDI()) { -// FRW->AddLayer(AddCPAP(los->add(rera))); -// } else { -// FRW->AddLayer(AddCPAP(rera)); -// } -// FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Apnea, COLOR_Apnea, STR_TR_UA)))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_VSnore, COLOR_VibratorySnore, STR_TR_VS))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_FlowLimit, COLOR_FlowLimit, STR_TR_FL))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_SensAwake, COLOR_SensAwake, STR_TR_SA))); -// FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Obstructive, COLOR_Obstructive, STR_TR_OA)))); -// FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_ClearAirway, COLOR_ClearAirway, STR_TR_CA)))); -// if (p_profile->cpap->userEventFlagging()) { -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag1, COLOR_Yellow, tr("U1"),FT_Bar))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag2, COLOR_Orange, tr("U2"),FT_Bar))); -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag3, COLOR_Brown, tr("U3"),FT_Bar))); -// } -// FRW->AddLayer(AddCPAP(new gLineOverlayBar(OXI_SPO2Drop, COLOR_SPO2Drop, STR_TR_O2))); - - FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_SPO2Drop, COLOR_SPO2Drop, STR_TR_O2))); - //FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange, COLOR_PulseChange, STR_TR_PC,FT_Dot))); - -// FRW->AddLayer(AddCPAP(los)); +// FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_SPO2Drop, COLOR_SPO2Drop, STR_TR_O2))); bool square=p_profile->appearance->squareWavePlots(); gLineChart *pc=new gLineChart(CPAP_Pressure, square); graphlist[schema::channel[CPAP_Pressure].code()]->AddLayer(AddCPAP(pc)); - graphlist[schema::channel[CPAP_Pressure].code()]->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Ramp, COLOR_Ramp, schema::channel[CPAP_Ramp].label(), FT_Span))); + // graphlist[schema::channel[CPAP_Pressure].code()]->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Ramp, COLOR_Ramp, schema::channel[CPAP_Ramp].label(), FT_Span))); pc->addPlot(CPAP_EPAP, square); pc->addPlot(CPAP_IPAPLo, square); @@ -358,7 +284,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared) // this is class wide because the leak redline can be reset in preferences.. // Better way would be having a search for linechart layers in graphlist[...] gLineChart *leakchart=new gLineChart(CPAP_Leak, square); - graphlist[schema::channel[CPAP_Leak].code()]->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_LargeLeak, COLOR_LargeLeak, STR_TR_LL, FT_Span))); + // graphlist[schema::channel[CPAP_Leak].code()]->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_LargeLeak, COLOR_LargeLeak, STR_TR_LL, FT_Span))); leakchart->addPlot(CPAP_LeakTotal, square); leakchart->addPlot(CPAP_MaxLeak, square); diff --git a/sleepyhead/docs/release_notes.html b/sleepyhead/docs/release_notes.html index d4481275..1b0f5373 100644 --- a/sleepyhead/docs/release_notes.html +++ b/sleepyhead/docs/release_notes.html @@ -1,14 +1,19 @@ -

SleepyHead v0.9.7-9 Testing

+

SleepyHead v0.9.7-10 Testing

Release Notes

Greetings!

Here is a new and hopefully improved SleepyHead build.

-

You will need to rebuild your CPAP machine database from the Data menu to get the benefit of the latest goodies.

-

This rebuild will be automatic in the final 0.9.7 public builds (well, they will face a forced reimport unless they are ResMed users, but anyway :/)

-

There's still a bit to do with oximetry and F&P Icon, but I'm starting to feel we are getting a lot closer to a reliable build stage.

+

I'm pleased to report that CMS50i and CMS50f oximeters finally work with SleepyHead, a huge thanks to François Revol and Michael Masterson for there assistance with this.

+

Some of you German users will be pleased to learn that the (Pulox) PO-200, PO-300, and PO-400 oximeters are secretely Contecs CMS50's in disguise, (D+, E and F respectively)..

+ +

This build features recent code that modified the internal "Day" objects, so they can hold sessions from multiple machines.. which is a pretty significant change in how data is stored in memory. +This was done so Oximeter, CPAP, sleep stage, positional, etc.. Session's don't have to be handled individually.. Now for instance, I can compare oximetery and CPAP data in the same object, +leading to much more powerful calculation and graphing possibilities. Nerdy stuff end users won't know about, but you will. ;)

+

You will likely need to REBUILD YOUR CPAP MACHINE DATABASE from the Data menu to get the benefit of the latest goodies. This rebuild will be automatic in the final 0.9.7 public builds (well, they will face a forced reimport unless they are ResMed users, but anyway :/)

+

I'd very much love to hear your comments on the latest changes, some of this is stuff I've been planning for ages.

Sleep Well, and good luck!

JediMark

@@ -16,10 +21,15 @@
New features & bug fixes in v0.9.7
+
  • New Feature: Added toggle-able Dotted lines for each graph for various purposes
  • +
  • New Feature: Added right-click popup menu in Y-Axis and title graph area
  • +
  • Support for importing from CMS50F and CMS50I via cable +
  • Fix duplicate Ti/Te graphs on VPAP Adapt
  • New Graph: Time at Pressure
  • Less ugly code hardwiring and more automatic smarts, plus better channel color and name consistencies underneath.
  • Daily panel (left) Sidebar can be toggled on/off with F9
  • Calendar can now be toggled on/off with f10, your preferences will be kept
  • +
  • Fixed screenshot in non fullscreen on Windows & Linux.. now autohides the calendar and right sidebar.
  • Press Alt-B while selecting in daily view to quickly add a bookmark without having to zoom in
  • New Feature: Can now edit channel information, including names, colors, etc. in preferences
  • Tooltips showing relevenat information when hovering over events on daily charts
  • diff --git a/sleepyhead/scripts/build_number b/sleepyhead/scripts/build_number index ec635144..f599e28b 100644 --- a/sleepyhead/scripts/build_number +++ b/sleepyhead/scripts/build_number @@ -1 +1 @@ -9 +10 diff --git a/sleepyhead/scripts/inc_build.bat b/sleepyhead/scripts/inc_build.bat deleted file mode 100644 index 43a7f526..00000000 --- a/sleepyhead/scripts/inc_build.bat +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -set /p var= build_number -echo const int build_number = %var%; > ../build_number.h diff --git a/sleepyhead/sleepyhead.pro b/sleepyhead/sleepyhead.pro index b256d032..b2969865 100644 --- a/sleepyhead/sleepyhead.pro +++ b/sleepyhead/sleepyhead.pro @@ -91,34 +91,11 @@ win32 { # MingW needs this LIBS += -lz } - CONFIG(release, debug|release) { - # Update build number - build_nr.commands = $$PWD/scripts/inc_build.bat - build_nr.depends = FORCE - QMAKE_EXTRA_TARGETS += build_nr - PRE_TARGETDEPS += build_nr - - HEADERS += build_number.h - } QT += serialport } -unix { - # Update build number - CONFIG(debug, debug|release) { - build_nr.commands = $$PWD/scripts/inc_build.sh debug - } else { - build_nr.commands = $$PWD/scripts/inc_build.sh release - } - build_nr.depends = FORCE - QMAKE_EXTRA_TARGETS += build_nr - PRE_TARGETDEPS += build_nr - - HEADERS += build_number.h -} - #include(3rdparty/quazip-0.5.1/quazip/quazip.pri) #include(SleepLib2/sleeplib.pri) @@ -244,7 +221,9 @@ HEADERS += \ Graphs/MinutesAtPressure.h \ SleepLib/journal.h \ SleepLib/progressdialog.h \ - SleepLib/loader_plugins/cms50f37_loader.h + SleepLib/loader_plugins/cms50f37_loader.h \ + build_number.h + FORMS += \ daily.ui \