mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-21 21:20:45 +00:00
Add more verbose debug info to prs1 importer.
Signed-off-by: Richard Freeman <rich0@gentoo.org>
This commit is contained in:
parent
a2b4cf1967
commit
8b8b9cb5bd
@ -455,11 +455,15 @@ int PRS1Loader::OpenMachine(Machine *m,QString path,Profile *profile)
|
|||||||
|
|
||||||
bool PRS1Loader::ParseSummary(Machine *mach, qint32 sequence, quint32 timestamp, unsigned char *data, quint16 size, char version)
|
bool PRS1Loader::ParseSummary(Machine *mach, qint32 sequence, quint32 timestamp, unsigned char *data, quint16 size, char version)
|
||||||
{
|
{
|
||||||
if (mach->SessionExists(sequence))
|
if (mach->SessionExists(sequence)) {
|
||||||
|
qDebug() << "sessionexists exit";
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (size<44-16)
|
if (size<44-16) {
|
||||||
|
qDebug() << "size exit";
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Session *session=new Session(mach,sequence);
|
Session *session=new Session(mach,sequence);
|
||||||
session->really_set_first(qint64(timestamp)*1000L);
|
session->really_set_first(qint64(timestamp)*1000L);
|
||||||
@ -532,6 +536,7 @@ bool PRS1Loader::ParseSummary(Machine *mach, qint32 sequence, quint32 timestamp,
|
|||||||
|
|
||||||
duration=data[offset+0x14] | (data[0x15] << 8);
|
duration=data[offset+0x14] | (data[0x15] << 8);
|
||||||
if (!duration) {
|
if (!duration) {
|
||||||
|
qDebug() << "!duration exit";
|
||||||
delete session;
|
delete session;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -586,8 +591,10 @@ bool PRS1Loader::ParseSummary(Machine *mach, qint32 sequence, quint32 timestamp,
|
|||||||
}
|
}
|
||||||
bool PRS1Loader::Parse002v5(qint32 sequence, quint32 timestamp, unsigned char *buffer, quint16 size)
|
bool PRS1Loader::Parse002v5(qint32 sequence, quint32 timestamp, unsigned char *buffer, quint16 size)
|
||||||
{
|
{
|
||||||
if (!new_sessions.contains(sequence))
|
if (!new_sessions.contains(sequence)) {
|
||||||
|
qDebug() << "contains squence exit";
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
Session *session=new_sessions[sequence];
|
Session *session=new_sessions[sequence];
|
||||||
|
|
||||||
ChannelID Codes[]={
|
ChannelID Codes[]={
|
||||||
@ -648,9 +655,9 @@ bool PRS1Loader::Parse002v5(qint32 sequence, quint32 timestamp, unsigned char *b
|
|||||||
code=buffer[pos++];
|
code=buffer[pos++];
|
||||||
if (code>=ncodes) {
|
if (code>=ncodes) {
|
||||||
qDebug() << "Illegal PRS1 code " << hex << int(code) << " appeared at " << hex << startpos;
|
qDebug() << "Illegal PRS1 code " << hex << int(code) << " appeared at " << hex << startpos;
|
||||||
qDebug() << "1: (" << int(lastcode ) << lastpos << ")";
|
qDebug() << "1: (" << int(lastcode ) << hex << lastpos << ")";
|
||||||
qDebug() << "2: (" << int(lastcode2) << lastpos2 <<")";
|
qDebug() << "2: (" << int(lastcode2) << hex << lastpos2 <<")";
|
||||||
qDebug() << "3: (" << int(lastcode3) << lastpos3 <<")";
|
qDebug() << "3: (" << int(lastcode3) << hex << lastpos3 <<")";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (code==0) {
|
if (code==0) {
|
||||||
@ -767,9 +774,11 @@ bool PRS1Loader::Parse002v5(qint32 sequence, quint32 timestamp, unsigned char *b
|
|||||||
//tt-=delta;
|
//tt-=delta;
|
||||||
tt-=qint64(data[1])*1000L;
|
tt-=qint64(data[1])*1000L;
|
||||||
if (!CSR) {
|
if (!CSR) {
|
||||||
if (!(CSR=session->AddEventList(cpapcode,EVL_Event)))
|
if (!(CSR=session->AddEventList(cpapcode,EVL_Event))) {
|
||||||
|
qDebug() << "!CSR addeventlist exit";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
CSR->AddEvent(tt,data[0]);
|
CSR->AddEvent(tt,data[0]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -797,9 +806,11 @@ bool PRS1Loader::Parse002v5(qint32 sequence, quint32 timestamp, unsigned char *b
|
|||||||
SNORE->AddEvent(t,data[2]=buffer[pos++]); // 08=Snore
|
SNORE->AddEvent(t,data[2]=buffer[pos++]); // 08=Snore
|
||||||
if (data[2]>0) {
|
if (data[2]>0) {
|
||||||
if (!VS) {
|
if (!VS) {
|
||||||
if (!(VS=session->AddEventList(CPAP_VSnore,EVL_Event)))
|
if (!(VS=session->AddEventList(CPAP_VSnore,EVL_Event))) {
|
||||||
|
qDebug() << "!VS eventlist exit";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
VS->AddEvent(t,0); //data[2]); // VSnore
|
VS->AddEvent(t,0); //data[2]); // VSnore
|
||||||
}
|
}
|
||||||
EPAP->AddEvent(t,data[1]=buffer[pos++]); // 09=EPAP
|
EPAP->AddEvent(t,data[1]=buffer[pos++]); // 09=EPAP
|
||||||
@ -1152,6 +1163,7 @@ bool PRS1Loader::OpenFile(Machine *mach, QString filename)
|
|||||||
header=&m_buffer[pos];
|
header=&m_buffer[pos];
|
||||||
if (header[0]!=PRS1_MAGIC_NUMBER) {
|
if (header[0]!=PRS1_MAGIC_NUMBER) {
|
||||||
if (chunk==0)
|
if (chunk==0)
|
||||||
|
qDebug() << "Invalid magic number" << filename;
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1219,16 +1231,19 @@ bool PRS1Loader::OpenFile(Machine *mach, QString filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//qDebug() << "Loading" << filename << sequence << timestamp << size;
|
qDebug() << "Loading" << filename << sequence << timestamp << size;
|
||||||
//if (ext==0) ParseCompliance(data,size);
|
//if (ext==0) ParseCompliance(data,size);
|
||||||
if (ext<=1) {
|
if (ext<=1) {
|
||||||
|
qDebug() << "Call Parse Summary";
|
||||||
ParseSummary(mach,sequence,timestamp,data,datasize,version);
|
ParseSummary(mach,sequence,timestamp,data,datasize,version);
|
||||||
} else if (ext==2) {
|
} else if (ext==2) {
|
||||||
if (version==5) {
|
if (version==5) {
|
||||||
|
qDebug() << "Call parse002v5";
|
||||||
if (!Parse002v5(sequence,timestamp,data,datasize)) {
|
if (!Parse002v5(sequence,timestamp,data,datasize)) {
|
||||||
qDebug() << "in file: " << filename;
|
qDebug() << "in file: " << filename;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
qDebug() << "Call parse002";
|
||||||
Parse002(sequence,timestamp,data,datasize);
|
Parse002(sequence,timestamp,data,datasize);
|
||||||
}
|
}
|
||||||
} else if (ext==5) {
|
} else if (ext==5) {
|
||||||
|
Loading…
Reference in New Issue
Block a user