Merge branch 'master' into translations

This commit is contained in:
ArieKlerk 2020-05-16 17:39:38 +02:00
commit 7fa1985608
7 changed files with 37 additions and 16 deletions

View File

@ -1,6 +1,6 @@
You will need either qtcreator or qttools5-dev-tools and a C++ compiler and linker You will need either qtcreator or qttools5-dev-tools and a C++ compiler and linker
Also, you need the packages qt5-default, libqt5serialport5, libqt5serailport5-dev and libqt5opengl5-dev Also, you need the packages qt5-default, libqt5serialport5, libqt5serialport5-dev and libqt5opengl5-dev
Oscar can be built without its Help module with Qt5.7 SDK (for Debian Stretch, for example) Oscar can be built without its Help module with Qt5.7 SDK (for Debian Stretch, for example)

View File

@ -35,6 +35,8 @@
<li>[fix] Fix occasional failure to save imported Viatom data.</li> <li>[fix] Fix occasional failure to save imported Viatom data.</li>
<li>[fix] Fix a recurring database upgrade prompt.</li> <li>[fix] Fix a recurring database upgrade prompt.</li>
<li>[fix] Fix an occasional crash when importing Resmed data.</li> <li>[fix] Fix an occasional crash when importing Resmed data.</li>
<li>[fix] Add bounds error checking to Resmed input processing.</li>
<li>[fix] Fix STR.edf file backup to avoid loss of settings data.</li>
</ul> </ul>
<p> <p>
<b>Changes and fixes in OSCAR v1.1.0</b> <b>Changes and fixes in OSCAR v1.1.0</b>

View File

@ -43,7 +43,9 @@ EDFInfo::~EDFInfo()
{ {
// if ( fileData ) { // if ( fileData ) {
if (fileData.size() > 0) { if (fileData.size() > 0) {
#ifdef EDF_DEBUG
qDebug() << "EDFInfo destructor clearing fileData"; qDebug() << "EDFInfo destructor clearing fileData";
#endif
fileData.clear(); fileData.clear();
} }
// } // }
@ -108,8 +110,10 @@ bool EDFInfo::parseHeader( EDFHeaderRaw *hdrPtr )
edfHdr.version = QString::fromLatin1(hdrPtr->version, 8).toLong(&ok); edfHdr.version = QString::fromLatin1(hdrPtr->version, 8).toLong(&ok);
if (!ok) { if (!ok) {
#ifdef EDF_DEBUG
qWarning() << "EDFInfo::Parse() Bad Version " << filename; qWarning() << "EDFInfo::Parse() Bad Version " << filename;
// sleep(1); // sleep(1);
#endif
fileData.clear(); fileData.clear();
return false; return false;
} }
@ -127,30 +131,38 @@ bool EDFInfo::parseHeader( EDFHeaderRaw *hdrPtr )
edfHdr.num_header_bytes = QString::fromLatin1(hdrPtr->num_header_bytes, 8).toLong(&ok); edfHdr.num_header_bytes = QString::fromLatin1(hdrPtr->num_header_bytes, 8).toLong(&ok);
if (!ok) { if (!ok) {
#ifdef EDF_DEBUG
qWarning() << "EDFInfo::Parse() Bad header byte count " << filename; qWarning() << "EDFInfo::Parse() Bad header byte count " << filename;
// sleep(1); // sleep(1);
#endif
fileData.clear(); fileData.clear();
return false; return false;
} }
edfHdr.reserved44=QString::fromLatin1(hdrPtr->reserved, 44).trimmed(); edfHdr.reserved44=QString::fromLatin1(hdrPtr->reserved, 44).trimmed();
edfHdr.num_data_records = QString::fromLatin1(hdrPtr->num_data_records, 8).toLong(&ok); edfHdr.num_data_records = QString::fromLatin1(hdrPtr->num_data_records, 8).toLong(&ok);
if ( (! ok) || (edfHdr.num_data_records < 1) ) { if ( (! ok) || (edfHdr.num_data_records < 1) ) {
#ifdef EDF_DEBUG
qWarning() << "EDFInfo::Parse() Bad data record count " << filename; qWarning() << "EDFInfo::Parse() Bad data record count " << filename;
// sleep(1); // sleep(1);
#endif
fileData.clear(); fileData.clear();
return false; return false;
} }
edfHdr.duration_Seconds = QString::fromLatin1(hdrPtr->dur_data_records, 8).toDouble(&ok); edfHdr.duration_Seconds = QString::fromLatin1(hdrPtr->dur_data_records, 8).toDouble(&ok);
if (!ok) { if (!ok) {
#ifdef EDF_DEBUG
qWarning() << "EDFInfo::Parse() Bad duration " << filename; qWarning() << "EDFInfo::Parse() Bad duration " << filename;
// sleep(1); // sleep(1);
#endif
fileData.clear(); fileData.clear();
return false; return false;
} }
edfHdr.num_signals = QString::fromLatin1(hdrPtr->num_signals, 4).toLong(&ok); edfHdr.num_signals = QString::fromLatin1(hdrPtr->num_signals, 4).toLong(&ok);
if ( (! ok) || (edfHdr.num_signals < 1) || (edfHdr.num_signals > 256) ) { if ( (! ok) || (edfHdr.num_signals < 1) || (edfHdr.num_signals > 256) ) {
#ifdef EDF_DEBUG
qWarning() << "EDFInfo::Parse() Bad number of signals " << filename; qWarning() << "EDFInfo::Parse() Bad number of signals " << filename;
// sleep(1); // sleep(1);
#endif
fileData.clear(); fileData.clear();
return false; return false;
} }
@ -189,7 +201,7 @@ bool EDFInfo::Parse() {
signalList[sig.label].push_back(&sig); signalList[sig.label].push_back(&sig);
if (eof) { if (eof) {
qWarning() << "EDFInfo::Parse() Early end of file " << filename; qWarning() << "EDFInfo::Parse() Early end of file " << filename;
sleep(1); // sleep(1);
fileData.clear(); fileData.clear();
return false; return false;
} }
@ -280,7 +292,7 @@ EDFHeaderQT * EDFInfo::GetHeader( const QString & name)
QFile fi(name); QFile fi(name);
if (!fi.open(QFile::ReadOnly)) { if (!fi.open(QFile::ReadOnly)) {
qDebug() << "EDFInfo::Open() Couldn't open file " << name; qDebug() << "EDFInfo::Open() Couldn't open file " << name;
sleep(1); // sleep(1);
return nullptr; return nullptr;
} }
// fileData = new QByteArray(); // fileData = new QByteArray();
@ -335,8 +347,10 @@ QVector<Annotation> EDFInfo::ReadAnnotations(const char * data, int charLen)
offset = text.toDouble(&ok); offset = text.toDouble(&ok);
if (!ok) { if (!ok) {
#ifdef EDF_DEBUG
qDebug() << "Faulty offset in annotation record "; qDebug() << "Faulty offset in annotation record ";
// sleep(1); // sleep(1);
#endif
break; break;
} }
@ -356,8 +370,10 @@ QVector<Annotation> EDFInfo::ReadAnnotations(const char * data, int charLen)
duration = text.toDouble(&ok); duration = text.toDouble(&ok);
if (!ok) { if (!ok) {
#ifdef EDF_DEBUG
qDebug() << "Faulty duration in annotation record "; qDebug() << "Faulty duration in annotation record ";
// sleep(1); // sleep(1);
#endif
break; break;
} }
} }
@ -379,8 +395,10 @@ QVector<Annotation> EDFInfo::ReadAnnotations(const char * data, int charLen)
text = QString::fromUtf8(textStart, textLen); text = QString::fromUtf8(textStart, textLen);
annoVec.push_back( Annotation( offset, duration, text) ); annoVec.push_back( Annotation( offset, duration, text) );
if (pos >= charLen) { if (pos >= charLen) {
#ifdef EDF_DEBUG
qDebug() << "Short EDF Annotations record"; qDebug() << "Short EDF Annotations record";
// sleep(1); // sleep(1);
#endif
break; break;
} }
} }

View File

@ -4906,7 +4906,7 @@ void PRS1DataChunk::ParseHumidifierSetting60Series(unsigned char humid1, unsigne
} else if (this->familyVersion == 1) { } else if (this->familyVersion == 1) {
// F5V1 // F5V1
if (tubepresent) { if (tubepresent) {
if (tubetemp == 4) UNEXPECTED_VALUE(tubetemp, "!= 4"); // all tube temperatures seen
if (tubetemp) { if (tubetemp) {
if (tubehumidlevel == 0 || tubehumidlevel > 3) UNEXPECTED_VALUE(tubehumidlevel, "1-3"); if (tubehumidlevel == 0 || tubehumidlevel > 3) UNEXPECTED_VALUE(tubehumidlevel, "1-3");
} }
@ -7108,9 +7108,9 @@ bool PRS1DataChunk::ParseSettingsF0V6(const unsigned char* data, int size)
CHECK_VALUE(len, 1); CHECK_VALUE(len, 1);
CHECK_VALUE(data[pos], 0xFF); CHECK_VALUE(data[pos], 0xFF);
break; break;
case 0x45: // new to 400G, only in last session? case 0x45: // new to 400G and 500G, appears right after 0x35 (humidifier setting)
CHECK_VALUE(len, 1); CHECK_VALUE(len, 1);
CHECK_VALUE(data[pos], 1); CHECK_VALUES(data[pos], 0, 1);
break; break;
default: default:
UNEXPECTED_VALUE(code, "known setting"); UNEXPECTED_VALUE(code, "known setting");

View File

@ -402,7 +402,7 @@ int ResmedLoader::Open(const QString & dirpath)
} else { // passed the tests, stuff it into the map } else { // passed the tests, stuff it into the map
QDate date = stredf->edfHdr.startdate_orig.date(); QDate date = stredf->edfHdr.startdate_orig.date();
long int days = stredf->GetNumDataRecords(); long int days = stredf->GetNumDataRecords();
qDebug() << strpath.section("/",-2,-1) << "starts at" << date << "for" << days; qDebug() << strpath.section("/",-2,-1) << "starts at" << date << "for" << days << "ends" << date.addDays(days-1);
STRmap[date] = STRFile(strpath, days, stredf); STRmap[date] = STRFile(strpath, days, stredf);
} }
} else { } else {
@ -466,7 +466,7 @@ int ResmedLoader::Open(const QString & dirpath)
date = stredf->edfHdr.startdate_orig.date(); date = stredf->edfHdr.startdate_orig.date();
days = stredf->GetNumDataRecords(); days = stredf->GetNumDataRecords();
if (STRmap.contains(date)) { // Keep the longer of the two STR files if (STRmap.contains(date)) { // Keep the longer of the two STR files
qDebug() << filename << "overlaps" << STRmap[date].filename.section("/",-2,-1) << "for" << days; qDebug() << filename << "overlaps" << STRmap[date].filename.section("/",-2,-1) << "for" << days << "ends" << date.addDays(days-1);
if (days <= STRmap[date].days) { if (days <= STRmap[date].days) {
qDebug() << "Skipping" << filename; qDebug() << "Skipping" << filename;
delete stredf; delete stredf;
@ -2541,8 +2541,8 @@ bool ResmedLoader::LoadBRP(Session *sess, const QString & path)
if (max > es.physical_maximum) if (max > es.physical_maximum)
max = es.physical_maximum; max = es.physical_maximum;
sess->setMin(code, min); sess->updateMin(code, min);
sess->setMax(code, max); sess->updateMax(code, max);
sess->setPhysMin(code, es.physical_minimum); sess->setPhysMin(code, es.physical_minimum);
sess->setPhysMax(code, es.physical_maximum); sess->setPhysMax(code, es.physical_maximum);
} }
@ -2800,8 +2800,8 @@ bool ResmedLoader::LoadPLD(Session *sess, const QString & path)
} }
if (a) { if (a) {
sess->setMin(code, a->Min()); sess->updateMin(code, a->Min());
sess->setMax(code, a->Max()); sess->updateMax(code, a->Max());
sess->setPhysMin(code, es.physical_minimum); sess->setPhysMin(code, es.physical_minimum);
sess->setPhysMax(code, es.physical_maximum); sess->setPhysMax(code, es.physical_maximum);
a->setDimension(es.physical_dimension); a->setDimension(es.physical_dimension);
@ -2900,8 +2900,8 @@ void ResmedLoader::ToTimeDelta(Session *sess, ResMedEDFInfo &edf, EDFSignal &es,
if ((tmp >= t_min) && (tmp <= t_max)) if ((tmp >= t_min) && (tmp <= t_max))
el->AddEvent(tt, c); el->AddEvent(tt, c);
sess->setMin(code, min); sess->updateMin(code, min);
sess->setMax(code, max); sess->updateMax(code, max);
sess->setPhysMin(code, es.physical_minimum); sess->setPhysMin(code, es.physical_minimum);
sess->setPhysMax(code, es.physical_maximum); sess->setPhysMax(code, es.physical_maximum);
sess->updateLast(tt); sess->updateLast(tt);

View File

@ -125,7 +125,7 @@ bool Session::OpenEvents()
// qWarning() << "Error Loading Events" << filename; // qWarning() << "Error Loading Events" << filename;
return false; return false;
} }
qDebug() << "Loading" << s_machine->loaderName().toLocal8Bit().data() << "Events:" << filename.toLocal8Bit().data(); // qDebug() << "Loading" << s_machine->loaderName().toLocal8Bit().data() << "Events:" << filename.toLocal8Bit().data();
return s_events_loaded = true; return s_events_loaded = true;
} }

View File

@ -1,4 +1,5 @@
// Update the string below to set OSCAR's version and release status. // Update the string below to set OSCAR's version and release status.
// See https://semver.org/spec/v2.0.0.html for details on format. // See https://semver.org/spec/v2.0.0.html for details on format.
#define VERSION "1.1.1-alpha-0" #define VERSION "1.1.1-rc-1"