From 3ec70b660dbce3b135971da5f569e4bb453adfb7 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Tue, 29 Nov 2011 08:49:43 +1000 Subject: [PATCH] Multi select dialog not working on mac, more oximetry stuff --- SleepLib/calcs.cpp | 57 +++++++++++++++++++++++++++++--------------- daily.cpp | 6 ++++- mainwindow.cpp | 2 +- preferencesdialog.ui | 6 +++++ 4 files changed, 50 insertions(+), 21 deletions(-) diff --git a/SleepLib/calcs.cpp b/SleepLib/calcs.cpp index e859e647..19cc546c 100644 --- a/SleepLib/calcs.cpp +++ b/SleepLib/calcs.cpp @@ -323,7 +323,7 @@ int calcPulseChange(Session *session) tmp=fabs(val2-val); if (tmp > lv) { lastt=time2; - lv=tmp; + //lv=tmp; li=j; } } @@ -361,13 +361,13 @@ int calcSPO2Drop(Session *session) bool ok; qint64 window=PROFILE["SPO2DropDuration"].toDouble(&ok); if (!ok) { - PROFILE["SPO2DropDuration"]=4; - window=4000; + PROFILE["SPO2DropDuration"]=10; + window=10000; } else window*=1000; change=PROFILE["SPO2DropPercentage"].toDouble(&ok); if (!ok) { - PROFILE["SPO2DropPercentage"]=4; - change=4; + PROFILE["SPO2DropPercentage"]=3; + change=3; } EventList *pc=new EventList(EVL_Event); @@ -375,37 +375,56 @@ int calcSPO2Drop(Session *session) EventDataType lv=0; int li=0; + const int ringsize=10; + EventDataType ring[ringsize]; + int rp=0; + for (int e=0;e time+window) break; - val2=el.data(j); - if (val2<=lv) { - lv=val2; + if (val2 <= (val-change)) { lastt=time2; li=j; - //tmp=val-val2; - //if (tmp > change) { -// pc->AddEvent(time2,tmp); - //break; - //} - } + //lv=val2; + } else if (val2 <= lv) { + lv=val2; + //lastt=time2; + //li=j; + } else break; } if (lastt>0) { - qint64 len=(lastt-time)/1000.0; - pc->AddEvent(lastt,len); + qint64 len=(lastt-time); + if (len>=window) { + pc->AddEvent(lastt,len/1000); - i=li; + i=li; + } } } } diff --git a/daily.cpp b/daily.cpp index 06a4bf00..662f2923 100644 --- a/daily.cpp +++ b/daily.cpp @@ -204,8 +204,12 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw) TgMV->AddLayer(AddCPAP(new gLineChart(CPAP_TgMV,Qt::darkCyan,square))); INTPULSE->AddLayer(AddCPAP(new gLineChart(OXI_Pulse,Qt::red,square))); INTSPO2->AddLayer(AddCPAP(new gLineChart(OXI_SPO2,Qt::blue,square))); + + PULSE->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange,QColor("light gray"),"PD",FT_Span))); + SPO2->AddLayer(AddOXI(new gLineOverlayBar(OXI_SPO2Drop,QColor("light blue"),"O2",FT_Span))); + PULSE->AddLayer(AddOXI(new gLineChart(OXI_Pulse,Qt::red,square))); - SPO2->AddLayer(AddOXI(new gLineChart(OXI_SPO2,Qt::blue,square))); + SPO2->AddLayer(AddOXI(new gLineChart(OXI_SPO2,Qt::blue,true))); PLETHY->AddLayer(AddOXI(new gLineChart(OXI_Plethy,Qt::darkBlue,false))); PTB->setForceMaxY(100); diff --git a/mainwindow.cpp b/mainwindow.cpp index c7b2a9e4..5147ef46 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -253,7 +253,7 @@ void MainWindow::on_action_Import_Data_triggered() if (asknew) { QFileDialog w; w.setFileMode(QFileDialog::DirectoryOnly); - w.setOption(QFileDialog::DontUseNativeDialog,false); + w.setOption(QFileDialog::DontUseNativeDialog,true); QListView *l = w.findChild("listView"); if (l) { diff --git a/preferencesdialog.ui b/preferencesdialog.ui index e2a8d6fd..28127c5d 100644 --- a/preferencesdialog.ui +++ b/preferencesdialog.ui @@ -960,6 +960,9 @@ p, li { white-space: pre-wrap; } 0 + + 1.000000000000000 + @@ -983,6 +986,9 @@ p, li { white-space: pre-wrap; } 0 + + 1.000000000000000 +