F&P Mask Pressure fix (not really Mask Pressure, but verifies FLW import works

This commit is contained in:
Mark Watkins 2013-10-16 15:18:29 +10:00
parent 969feab9c5
commit 37107f93f8

View File

@ -423,11 +423,11 @@ bool FPIconLoader::OpenFLW(Machine * mach,QString filename, Profile * profile)
// F&P Overwrites this file, not appends to it.
flow=new EventList(EVL_Waveform,1.0,0,0,0,rate);
leak=new EventList(EVL_Event,1.0,0,0,0,rate*double(samples_per_block)); // 1 per second
//leak=new EventList(EVL_Event,1.0,0,0,0,rate*double(samples_per_block)); // 1 per second
pressure=new EventList(EVL_Event,0.01,0,0,0,rate*double(samples_per_block)); // 1 per second
flow->setFirst(ti);
leak->setFirst(ti);
//leak->setFirst(ti);
pressure->setFirst(ti);
qint16 pr;
@ -453,10 +453,13 @@ bool FPIconLoader::OpenFLW(Machine * mach,QString filename, Profile * profile)
// The Pressure and lkaj codes are before the end of block marker
p-=3;
pr=p[0] << 8 | p[1];
pr=p[1] << 8 | p[0];
lkaj=p[2];
int i=0;
pressure->AddEvent(ti,pr);
//leak->AddEvent(ti,lkaj);
do {
tmp=buf[1] << 8 | buf[0];
val=(EventDataType(tmp)/100.0)-lkaj;
@ -480,7 +483,7 @@ bool FPIconLoader::OpenFLW(Machine * mach,QString filename, Profile * profile)
sess->setLast(CPAP_FlowRate,ti);
sess->setLast(CPAP_MaskPressure,ti);
sess->eventlist[CPAP_FlowRate].push_back(flow);
sess->eventlist[CPAP_Leak].push_back(leak);
// sess->eventlist[CPAP_Leak].push_back(leak);
sess->eventlist[CPAP_MaskPressure].push_back(pressure);
}
if (newsess)