PRS1 Pressure Summary fixes

This commit is contained in:
Mark Watkins 2012-02-02 13:48:44 +10:00
parent f86030e551
commit 9649cb337c
3 changed files with 10 additions and 7 deletions

View File

@ -173,6 +173,7 @@ EventDataType Day::percentile(ChannelID code,EventDataType percentile)
EventDataType lastgain=0, gain=0; EventDataType lastgain=0, gain=0;
// First Calculate count of all events // First Calculate count of all events
bool timeweight; bool timeweight;
for (s=sessions.begin();s!=sessions.end();s++) { for (s=sessions.begin();s!=sessions.end();s++) {
if (!(*s)->enabled()) continue; if (!(*s)->enabled()) continue;

View File

@ -623,7 +623,7 @@ bool PRS1Loader::Parse002v5(qint32 sequence, quint32 timestamp, unsigned char *b
//EventList * PRESSURE=NULL; //EventList * PRESSURE=NULL;
//EventList * PP=NULL; //EventList * PP=NULL;
EventDataType data[10],tmp; EventDataType data[10];//,tmp;
//qint64 start=timestamp; //qint64 start=timestamp;
@ -856,6 +856,9 @@ bool PRS1Loader::Parse002v5(qint32 sequence, quint32 timestamp, unsigned char *b
session->settings[CPAP_IPAPHi]=session->Max(CPAP_IPAPHi); session->settings[CPAP_IPAPHi]=session->Max(CPAP_IPAPHi);
session->settings[CPAP_PSMax]=session->Max(CPAP_IPAPHi) - session->Min(CPAP_EPAP); session->settings[CPAP_PSMax]=session->Max(CPAP_IPAPHi) - session->Min(CPAP_EPAP);
session->settings[CPAP_PSMin]=session->Min(CPAP_IPAPLo) - session->Min(CPAP_EPAP); session->settings[CPAP_PSMin]=session->Min(CPAP_IPAPLo) - session->Min(CPAP_EPAP);
session->m_valuesummary[CPAP_Pressure].clear();
session->m_valuesummary.erase(session->m_valuesummary.find(CPAP_Pressure));
return true; return true;
} }
@ -1069,6 +1072,9 @@ bool PRS1Loader::Parse002(qint32 sequence, quint32 timestamp, unsigned char *buf
session->m_cph.clear(); session->m_cph.clear();
session->m_lastchan.clear(); session->m_lastchan.clear();
session->m_firstchan.clear(); session->m_firstchan.clear();
session->m_valuesummary[CPAP_Pressure].clear();
session->m_valuesummary.erase(session->m_valuesummary.find(CPAP_Pressure));
return true; return true;
} }

View File

@ -686,9 +686,6 @@ void Session::updateCountSummary(ChannelID code)
qint32 len,cnt; qint32 len,cnt;
quint32 * tptr; quint32 * tptr;
EventStoreType * dptr, * eptr; EventStoreType * dptr, * eptr;
if (code==CPAP_MinuteVent) {
int i=5;
}
for (int i=0;i<ev.value().size();i++) { for (int i=0;i<ev.value().size();i++) {
EventList & e=*(ev.value()[i]); EventList & e=*(ev.value()[i]);
start=e.first(); start=e.first();
@ -701,12 +698,11 @@ void Session::updateCountSummary(ChannelID code)
m_gain[code]=e.gain(); m_gain[code]=e.gain();
if (e.type()==EVL_Event) { if (e.type()==EVL_Event) {
lastraw=*dptr; lastraw=*dptr++;
tptr=e.rawTime(); tptr=e.rawTime();
lasttime=start + *tptr; lasttime=start + *tptr++;
// Event version // Event version
for (;dptr < eptr; dptr++) { for (;dptr < eptr; dptr++) {
time=start + *tptr++; time=start + *tptr++;
raw=*dptr; raw=*dptr;