mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
ResMed S9 Integrated Oximeter support
This commit is contained in:
parent
b9c755970e
commit
9f5317ac18
@ -139,6 +139,7 @@ void gLineChart::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
num_points+=evec[i]->count();
|
num_points+=evec[i]->count();
|
||||||
total_points+=num_points;
|
total_points+=num_points;
|
||||||
|
|
||||||
|
const int num_averages=20; // Max n umber of samples taken from samples per pixel for better min/max values
|
||||||
for (int n=0;n<evec.size();n++) { // for each segment
|
for (int n=0;n<evec.size();n++) { // for each segment
|
||||||
EventList & el=*evec[n];
|
EventList & el=*evec[n];
|
||||||
|
|
||||||
@ -190,7 +191,6 @@ void gLineChart::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
double ZR=ZD/sr;
|
double ZR=ZD/sr;
|
||||||
double ZQ=ZR/XR;
|
double ZQ=ZR/XR;
|
||||||
double ZW=ZR/(width*ZQ);
|
double ZW=ZR/(width*ZQ);
|
||||||
const int num_averages=20; // Max n umber of samples taken from samples per pixel for better min/max values
|
|
||||||
visible_points+=ZR*ZQ;
|
visible_points+=ZR*ZQ;
|
||||||
if (accel && n>0) {
|
if (accel && n>0) {
|
||||||
sam=1;
|
sam=1;
|
||||||
@ -230,8 +230,10 @@ void gLineChart::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
if (minx>x0) {
|
if (minx>x0) {
|
||||||
double j=minx-x0; // == starting min of first sample in this segment
|
double j=minx-x0; // == starting min of first sample in this segment
|
||||||
idx=(j/sr);
|
idx=(j/sr);
|
||||||
|
idx/=(sam*num_averages);
|
||||||
|
idx*=(sam*num_averages);
|
||||||
// Loose the precision
|
// Loose the precision
|
||||||
//idx-=idx % sam;
|
//idx+=sam-(idx % sam);
|
||||||
|
|
||||||
} // else just start from the beginning
|
} // else just start from the beginning
|
||||||
}
|
}
|
||||||
|
@ -625,8 +625,40 @@ EventList * ResmedLoader::ToTimeDelta(Session *sess,EDFParser &edf, EDFSignal &
|
|||||||
}
|
}
|
||||||
bool ResmedLoader::LoadSAD(Session *sess,EDFParser &edf)
|
bool ResmedLoader::LoadSAD(Session *sess,EDFParser &edf)
|
||||||
{
|
{
|
||||||
// Oximeter bull crap.. this oximeter is not reported of highly..
|
QString t;
|
||||||
// nonetheless, the data is easy to access.
|
sess->updateFirst(edf.startdate);
|
||||||
|
qint64 duration=edf.GetNumDataRecords()*edf.GetDuration();
|
||||||
|
sess->updateLast(edf.startdate+duration);
|
||||||
|
|
||||||
|
for (int s=0;s<edf.GetNumSignals();s++) {
|
||||||
|
EDFSignal & es=*edf.edfsignals[s];
|
||||||
|
qDebug() << "SAD:" << es.label << es.digital_maximum << es.digital_minimum << es.physical_maximum << es.physical_minimum;
|
||||||
|
long recs=edf.edfsignals[s]->nr*edf.GetNumDataRecords();
|
||||||
|
ChannelID code;
|
||||||
|
if (edf.edfsignals[s]->label=="Pulse") {
|
||||||
|
code=CPAP_Pulse;
|
||||||
|
} else if (edf.edfsignals[s]->label=="SpO2") {
|
||||||
|
code=CPAP_SPO2;
|
||||||
|
} else {
|
||||||
|
qDebug() << "Unknown SAD.edf Signal " << edf.edfsignals[s]->label;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bool hasdata=false;
|
||||||
|
for (int i=0;i<recs;i++) {
|
||||||
|
if (es.data[i]!=-1) {
|
||||||
|
hasdata=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hasdata) {
|
||||||
|
EventList *a=ToTimeDelta(sess,edf,es, code,recs,duration,0,0);
|
||||||
|
if (a) {
|
||||||
|
sess->setMin(code,a->min());
|
||||||
|
sess->setMax(code,a->max());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ CPAP_CSR, CPAP_VSnore, CPAP_PressurePulse, CPAP_Mode, CPAP_FlowRate, CPAP_MaskPr
|
|||||||
CPAP_EPAP, CPAP_IPAP, CPAP_IPAP_Low, CPAP_IPAP_High, CPAP_PressureSupport, CPAP_Snore, CPAP_Leak,
|
CPAP_EPAP, CPAP_IPAP, CPAP_IPAP_Low, CPAP_IPAP_High, CPAP_PressureSupport, CPAP_Snore, CPAP_Leak,
|
||||||
CPAP_RespiratoryRate, CPAP_TidalVolume, CPAP_MinuteVentilation, CPAP_PatientTriggeredBreaths,
|
CPAP_RespiratoryRate, CPAP_TidalVolume, CPAP_MinuteVentilation, CPAP_PatientTriggeredBreaths,
|
||||||
CPAP_FlowLimitGraph, CPAP_TherapyPressure, CPAP_ExpiratoryPressure, CPAP_AHI, CPAP_BrokenSummary,
|
CPAP_FlowLimitGraph, CPAP_TherapyPressure, CPAP_ExpiratoryPressure, CPAP_AHI, CPAP_BrokenSummary,
|
||||||
CPAP_BrokenWaveform;
|
CPAP_BrokenWaveform, CPAP_Pulse, CPAP_SPO2;
|
||||||
|
|
||||||
ChannelID RMS9_PressureReliefType, RMS9_PressureReliefSetting, RMS9_Empty1, RMS9_Empty2;
|
ChannelID RMS9_PressureReliefType, RMS9_PressureReliefSetting, RMS9_Empty1, RMS9_Empty2;
|
||||||
ChannelID PRS1_PressureMin,PRS1_PressureMax, PRS1_PressureMinAchieved, PRS1_PressureMaxAchieved,
|
ChannelID PRS1_PressureMin,PRS1_PressureMax, PRS1_PressureMinAchieved, PRS1_PressureMaxAchieved,
|
||||||
@ -175,6 +175,9 @@ void InitMapsWithoutAwesomeInitializerLists()
|
|||||||
PRS1_Unknown12=CPAP_CODES.Get(CT_Event,QObject::tr("Unknown 12 Event"),QObject::tr("U12"),"PRS1_U12"),
|
PRS1_Unknown12=CPAP_CODES.Get(CT_Event,QObject::tr("Unknown 12 Event"),QObject::tr("U12"),"PRS1_U12"),
|
||||||
PRS1_VSnore2=CPAP_CODES.Get(CT_Event,QObject::tr("Vibratory Snore (Type 2)"),QObject::tr("VS2"),"VS2");
|
PRS1_VSnore2=CPAP_CODES.Get(CT_Event,QObject::tr("Vibratory Snore (Type 2)"),QObject::tr("VS2"),"VS2");
|
||||||
|
|
||||||
|
// CPAP Integrated oximetery codes..
|
||||||
|
CPAP_Pulse=CPAP_CODES.Get(CT_Event,QObject::tr("Pulse Rate"),QObject::tr("Pulse"),"CPPR");
|
||||||
|
CPAP_SPO2=CPAP_CODES.Get(CT_Event,QObject::tr("SpO2"),QObject::tr("SpO2"),"CPSP");
|
||||||
|
|
||||||
OXI_Pulse=OXI_CODES.Get(CT_Graph,QObject::tr("Pulse Rate"),QObject::tr("PR"),"PR"),
|
OXI_Pulse=OXI_CODES.Get(CT_Graph,QObject::tr("Pulse Rate"),QObject::tr("PR"),"PR"),
|
||||||
OXI_SPO2=OXI_CODES.Get(CT_Graph,QObject::tr("Oxygen Saturation"),QObject::tr("SPO2"),"SPO2"),
|
OXI_SPO2=OXI_CODES.Get(CT_Graph,QObject::tr("Oxygen Saturation"),QObject::tr("SPO2"),"SPO2"),
|
||||||
|
@ -119,7 +119,7 @@ CPAP_CSR, CPAP_VSnore, CPAP_PressurePulse, CPAP_Mode, CPAP_FlowRate, CPAP_MaskPr
|
|||||||
CPAP_EPAP, CPAP_IPAP, CPAP_IPAP_Low, CPAP_IPAP_High, CPAP_PressureSupport, CPAP_Snore, CPAP_Leak,
|
CPAP_EPAP, CPAP_IPAP, CPAP_IPAP_Low, CPAP_IPAP_High, CPAP_PressureSupport, CPAP_Snore, CPAP_Leak,
|
||||||
CPAP_RespiratoryRate, CPAP_TidalVolume, CPAP_MinuteVentilation, CPAP_PatientTriggeredBreaths,
|
CPAP_RespiratoryRate, CPAP_TidalVolume, CPAP_MinuteVentilation, CPAP_PatientTriggeredBreaths,
|
||||||
CPAP_FlowLimitGraph, CPAP_TherapyPressure, CPAP_ExpiratoryPressure, CPAP_AHI, CPAP_BrokenSummary,
|
CPAP_FlowLimitGraph, CPAP_TherapyPressure, CPAP_ExpiratoryPressure, CPAP_AHI, CPAP_BrokenSummary,
|
||||||
CPAP_BrokenWaveform;
|
CPAP_BrokenWaveform, CPAP_Pulse, CPAP_SPO2;
|
||||||
|
|
||||||
extern ChannelID RMS9_PressureReliefType, RMS9_PressureReliefSetting, RMS9_Empty1, RMS9_Empty2;
|
extern ChannelID RMS9_PressureReliefType, RMS9_PressureReliefSetting, RMS9_Empty1, RMS9_Empty2;
|
||||||
extern ChannelID PRS1_PressureMin,PRS1_PressureMax, PRS1_PressureMinAchieved, PRS1_PressureMaxAchieved,
|
extern ChannelID PRS1_PressureMin,PRS1_PressureMax, PRS1_PressureMinAchieved, PRS1_PressureMaxAchieved,
|
||||||
|
18
daily.cpp
18
daily.cpp
@ -96,6 +96,8 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw)
|
|||||||
RR=new gGraphWindow(parental,tr("Respiratory Rate"),SF);
|
RR=new gGraphWindow(parental,tr("Respiratory Rate"),SF);
|
||||||
PTB=new gGraphWindow(parental,tr("Patient Trig Breaths"),SF);
|
PTB=new gGraphWindow(parental,tr("Patient Trig Breaths"),SF);
|
||||||
//OF=new gGraphWindow(parental,tr("Oxi-Flags"),SF);
|
//OF=new gGraphWindow(parental,tr("Oxi-Flags"),SF);
|
||||||
|
INTPULSE=new gGraphWindow(parental,tr("Pulse"),SF); // Integrated Pulse
|
||||||
|
INTSPO2=new gGraphWindow(parental,tr("SPO2"),SF); // Integrated Pulse
|
||||||
PULSE=new gGraphWindow(parental,tr("Pulse"),SF);
|
PULSE=new gGraphWindow(parental,tr("Pulse"),SF);
|
||||||
SPO2=new gGraphWindow(parental,tr("SPO2"),SF);
|
SPO2=new gGraphWindow(parental,tr("SPO2"),SF);
|
||||||
|
|
||||||
@ -214,9 +216,18 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw)
|
|||||||
PTB->AddLayer(AddCPAP(new gLineChart(CPAP_PatientTriggeredBreaths,Qt::gray,true)));
|
PTB->AddLayer(AddCPAP(new gLineChart(CPAP_PatientTriggeredBreaths,Qt::gray,true)));
|
||||||
PTB->setMinimumHeight(min_height);
|
PTB->setMinimumHeight(min_height);
|
||||||
|
|
||||||
|
INTPULSE->AddLayer(new gXAxis());
|
||||||
|
INTPULSE->AddLayer(new gYAxis());
|
||||||
|
INTPULSE->AddLayer(AddCPAP(new gLineChart(CPAP_Pulse,Qt::red,true)));
|
||||||
|
INTPULSE->setMinimumHeight(min_height);
|
||||||
|
|
||||||
|
INTSPO2->AddLayer(new gXAxis());
|
||||||
|
INTSPO2->AddLayer(new gYAxis());
|
||||||
|
INTSPO2->AddLayer(AddCPAP(new gLineChart(CPAP_SPO2,Qt::blue,true)));
|
||||||
|
INTSPO2->setMinimumHeight(min_height);
|
||||||
|
|
||||||
PULSE->AddLayer(new gXAxis());
|
PULSE->AddLayer(new gXAxis());
|
||||||
PULSE->AddLayer(new gYAxis());
|
PULSE->AddLayer(new gYAxis());
|
||||||
// PULSE->AddLayer(new gFooBar());
|
|
||||||
PULSE->AddLayer(AddOXI(new gLineChart(OXI_Pulse,Qt::red,true)));
|
PULSE->AddLayer(AddOXI(new gLineChart(OXI_Pulse,Qt::red,true)));
|
||||||
PULSE->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange,Qt::green,"PC",FT_Bar)));
|
PULSE->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange,Qt::green,"PC",FT_Bar)));
|
||||||
PULSE->setMinimumHeight(min_height);
|
PULSE->setMinimumHeight(min_height);
|
||||||
@ -285,7 +296,7 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw)
|
|||||||
//int i=splitter->indexOf(NoData);
|
//int i=splitter->indexOf(NoData);
|
||||||
splitter->setStretchFactor(NoData,1);
|
splitter->setStretchFactor(NoData,1);
|
||||||
|
|
||||||
gGraphWindow * graphs[]={SF,FRW,MP,MV,TV,PTB,RR,PRD,LEAK,FLG,SNORE};
|
gGraphWindow * graphs[]={SF,FRW,MP,MV,TV,PTB,RR,PRD,LEAK,FLG,SNORE,INTPULSE,INTSPO2};
|
||||||
int ss=sizeof(graphs)/sizeof(gGraphWindow *);
|
int ss=sizeof(graphs)/sizeof(gGraphWindow *);
|
||||||
|
|
||||||
for (int i=0;i<ss;i++) {
|
for (int i=0;i<ss;i++) {
|
||||||
@ -294,8 +305,9 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw)
|
|||||||
splitter->setStretchFactor(graphs[i],1);
|
splitter->setStretchFactor(graphs[i],1);
|
||||||
//splitter->setAlignment(graphs[i],Qt::AlignTop);
|
//splitter->setAlignment(graphs[i],Qt::AlignTop);
|
||||||
for (int j=0;j<ss;j++) {
|
for (int j=0;j<ss;j++) {
|
||||||
if (graphs[i]!=graphs[j])
|
if (graphs[i]!=graphs[j]) {
|
||||||
graphs[i]->LinkZoom(graphs[j]);
|
graphs[i]->LinkZoom(graphs[j]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
daily.h
2
daily.h
@ -81,7 +81,7 @@ private:
|
|||||||
//gPointData *pulse,*spo2,*rr,*mv,*tv,*mp,*flg,*ptb;
|
//gPointData *pulse,*spo2,*rr,*mv,*tv,*mp,*flg,*ptb;
|
||||||
|
|
||||||
gFlagsGroup *fg;
|
gFlagsGroup *fg;
|
||||||
gGraphWindow *PRD,*FRW,*G_AHI,*TAP,*LEAK,*SF,*TAP_EAP,*TAP_IAP,*PULSE,*SPO2,*SNORE,*RR,*MP,*MV,*TV,*FLG,*PTB,*OF;
|
gGraphWindow *PRD,*FRW,*G_AHI,*TAP,*LEAK,*SF,*TAP_EAP,*TAP_IAP,*PULSE,*SPO2,*SNORE,*RR,*MP,*MV,*TV,*FLG,*PTB,*OF,*INTPULSE,*INTSPO2;
|
||||||
|
|
||||||
QList<gLayer *> OXIData;
|
QList<gLayer *> OXIData;
|
||||||
QList<gLayer *> CPAPData;
|
QList<gLayer *> CPAPData;
|
||||||
|
Loading…
Reference in New Issue
Block a user