mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-21 21:20:45 +00:00
Preliminary stuff for getting ready for DreamStation work
This commit is contained in:
parent
cd7806be59
commit
b4ddf457d6
@ -296,12 +296,12 @@ bool PRS1Loader::PeekProperties(MachineInfo & info, QString filename, Machine *
|
|||||||
|
|
||||||
bool skip = false;
|
bool skip = false;
|
||||||
|
|
||||||
if (pair[0].contains("ModelNumber", Qt::CaseInsensitive)) {
|
if (pair[0].contains("ModelNumber", Qt::CaseInsensitive) || pair[0].contains("MN", Qt::CaseInsensitive)) {
|
||||||
QString modelnum = pair[1];
|
QString modelnum = pair[1];
|
||||||
parseModel(info, modelnum);
|
parseModel(info, modelnum);
|
||||||
skip = true;
|
skip = true;
|
||||||
}
|
}
|
||||||
if (pair[0].contains("SerialNumber", Qt::CaseInsensitive)) {
|
if (pair[0].contains("SerialNumber", Qt::CaseInsensitive) || pair[0].contains("SN", Qt::CaseInsensitive)) {
|
||||||
info.serial = pair[1];
|
info.serial = pair[1];
|
||||||
skip = true;
|
skip = true;
|
||||||
}
|
}
|
||||||
@ -535,7 +535,7 @@ int PRS1Loader::OpenMachine(QString path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// A bit of protection against future annoyances..
|
// A bit of protection against future annoyances..
|
||||||
if (((series != 5) && (series != 6)) || (type >= 10)) {
|
if (((series != 5) && (series != 6) && (series != 0)) || (type >= 10)) {
|
||||||
QMessageBox::information(QApplication::activeWindow(),
|
QMessageBox::information(QApplication::activeWindow(),
|
||||||
QObject::tr("Machine Unsupported"),
|
QObject::tr("Machine Unsupported"),
|
||||||
QObject::tr("Sorry, your Philips Respironics CPAP machine (Model %1) is not supported yet.").arg(info.modelnumber) +"\n\n"+
|
QObject::tr("Sorry, your Philips Respironics CPAP machine (Model %1) is not supported yet.").arg(info.modelnumber) +"\n\n"+
|
||||||
@ -2324,6 +2324,8 @@ QList<PRS1DataChunk *> PRS1Loader::ParseFile(QString path)
|
|||||||
blocksize -= headersize;
|
blocksize -= headersize;
|
||||||
|
|
||||||
// Check header checksum
|
// Check header checksum
|
||||||
|
|
||||||
|
if (chunk->fileVersion==2) {
|
||||||
quint8 csum = 0;
|
quint8 csum = 0;
|
||||||
for (int i=0; i < headersize-1; ++i) csum += header[i];
|
for (int i=0; i < headersize-1; ++i) csum += header[i];
|
||||||
if (csum != header[headersize-1]) {
|
if (csum != header[headersize-1]) {
|
||||||
@ -2331,7 +2333,15 @@ QList<PRS1DataChunk *> PRS1Loader::ParseFile(QString path)
|
|||||||
delete chunk;
|
delete chunk;
|
||||||
return CHUNKS;
|
return CHUNKS;
|
||||||
}
|
}
|
||||||
|
} else if (chunk->fileVersion==3) {
|
||||||
|
// DreamStation uses a different Checksum
|
||||||
|
// I don't know what it is yet, it is not CRC16 based.
|
||||||
|
// Skipping the test for now..
|
||||||
|
} else {
|
||||||
|
// uhhhh.. should not of got this far. because this is an unknown or corrupt file format.
|
||||||
|
delete chunk;
|
||||||
|
return CHUNKS;
|
||||||
|
}
|
||||||
// Read data block
|
// Read data block
|
||||||
chunk->m_data = f.read(blocksize);
|
chunk->m_data = f.read(blocksize);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user