From 3d3b7a9a27c11e5d55d96d448ae5c9fdb5d0d527 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Mon, 18 Jul 2011 20:57:34 +1000 Subject: [PATCH] CMS50 Record Reading Fix --- Graphs/gLineOverlay.cpp | 19 ++++++++++++------ oximetry.cpp | 44 ++++++++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/Graphs/gLineOverlay.cpp b/Graphs/gLineOverlay.cpp index 8c29ea9b..d5d2255a 100644 --- a/Graphs/gLineOverlay.cpp +++ b/Graphs/gLineOverlay.cpp @@ -95,12 +95,19 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry) quadarray[quadcnt++]=start_py; } else { if (lo_type==LOT_Dot) { - //pointarray[pointcnt++]=x1; - //pointarray[pointcnt++]=start_py+3; // - vertarray[vertcnt++]=x1; - vertarray[vertcnt++]=start_py+1; - vertarray[vertcnt++]=x1; - vertarray[vertcnt++]=start_py+1+12; + //if (pref["AlwaysShowOverlayBars"].toBool()) { + + if (pref["AlwaysShowOverlayBars"].toBool() || (xx<(3600.0/86400.0))) { + // show the fat dots in the middle + pointarray[pointcnt++]=x1; + pointarray[pointcnt++]=w.y2p(20); + } else { + // thin lines down the bottom + vertarray[vertcnt++]=x1; + vertarray[vertcnt++]=start_py+1; + vertarray[vertcnt++]=x1; + vertarray[vertcnt++]=start_py+1+12; + } } else if (lo_type==LOT_Bar) { int z=start_py+height; if (pref["AlwaysShowOverlayBars"].toBool() || (xx<(3600.0/86400.0))) { diff --git a/oximetry.cpp b/oximetry.cpp index 67a1bebf..e001ffaa 100644 --- a/oximetry.cpp +++ b/oximetry.cpp @@ -32,15 +32,12 @@ Oximetry::Oximetry(QWidget *parent) : AddData(plethy=new WaveData(OXI_Plethy)); AddGraph(PLETHY=new gGraphWindow(gSplitter,tr("Plethysomogram"),(QGLWidget *)NULL)); - PLETHY->AddLayer(new gLineChart(plethy,Qt::black,65536,true,false,false)); AddData(pulse=new EventData(OXI_Pulse)); AddGraph(PULSE=new gGraphWindow(gSplitter,tr("Pulse Rate"),PLETHY)); - PULSE->AddLayer(new gLineChart(pulse,Qt::red,65536,false,false,false)); AddData(spo2=new EventData(OXI_SPO2)); AddGraph(SPO2=new gGraphWindow(gSplitter,tr("SPO2"),PLETHY)); - SPO2->AddLayer(new gLineChart(spo2,Qt::blue,65536,false,false,false)); plethy->SetRealMaxY(128); pulse->SetRealMaxY(130); @@ -63,13 +60,19 @@ Oximetry::Oximetry(QWidget *parent) : Graphs[i]->AddLayer(new gXAxis()); Graphs[i]->AddLayer(new gFooBar()); + gSplitter->addWidget(Graphs[i]); + } + SPO2->AddLayer(new gLineChart(spo2,Qt::blue,65536,false,false,false)); + PULSE->AddLayer(new gLineChart(pulse,Qt::red,65536,false,false,false)); + PLETHY->AddLayer(new gLineChart(plethy,Qt::black,65536,true,false,false)); + + for (unsigned i=0;isetMinimumHeight(150); Graphs[i]->SetSplitter(gSplitter); Graphs[i]->RealMinY(); Graphs[i]->RealMaxY(); Graphs[i]->MinY(); Graphs[i]->MaxY(); - gSplitter->addWidget(Graphs[i]); } on_RefreshPortsButton_clicked(); @@ -335,9 +338,9 @@ extern QProgressBar *qprogress; extern QLabel *qstatus; -void DumpBytes(unsigned char * b,int len) +void DumpBytes(int blocks, unsigned char * b,int len) { - QString a="Bytes "+QString::number(len,16)+": "; + QString a=QString::number(blocks,16)+": Bytes "+QString::number(len,16)+": "; for (int i=0;iread((char *)rb,0x20); - DumpBytes(rb,0x20); + DumpBytes(blocks,rb,res); + done=false; if (blocks==0) { for (int i=0;i