mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Stop ResMed importer crashing on zero record STR.edf files
This commit is contained in:
parent
f07b0ea7b4
commit
fbea37dcb5
@ -2031,6 +2031,12 @@ int ResmedLoader::Open(QString path)
|
|||||||
|
|
||||||
int days = duration / 86400000L; // GetNumDataRecords = this.. Duh!
|
int days = duration / 86400000L; // GetNumDataRecords = this.. Duh!
|
||||||
|
|
||||||
|
if (days<0) {
|
||||||
|
qDebug() << "Error: Negative number of days in STR.edf, aborting import";
|
||||||
|
days=0;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Process STR.edf and find first and last time for each day
|
// Process STR.edf and find first and last time for each day
|
||||||
|
|
||||||
QVector<qint8> dayused;
|
QVector<qint8> dayused;
|
||||||
|
@ -134,7 +134,7 @@ void Report::PrintReport(gGraphView *gv, QString name, QDate date)
|
|||||||
QRectF bounds = painter.boundingRect(QRectF(0, top, virt_width, 0), title,
|
QRectF bounds = painter.boundingRect(QRectF(0, top, virt_width, 0), title,
|
||||||
QTextOption(Qt::AlignHCenter | Qt::AlignTop));
|
QTextOption(Qt::AlignHCenter | Qt::AlignTop));
|
||||||
painter.drawText(bounds, title, QTextOption(Qt::AlignHCenter | Qt::AlignTop));
|
painter.drawText(bounds, title, QTextOption(Qt::AlignHCenter | Qt::AlignTop));
|
||||||
top += bounds.height() + normal_height / 2.0;
|
top += bounds.height() + 90 / 2.0;
|
||||||
painter.setFont(report_font);
|
painter.setFont(report_font);
|
||||||
|
|
||||||
int maxy = 0;
|
int maxy = 0;
|
||||||
|
@ -14,7 +14,7 @@ greaterThan(QT_MAJOR_VERSION,4) {
|
|||||||
|
|
||||||
#SleepyHead requires OpenGL 2.0 support to run smoothly
|
#SleepyHead requires OpenGL 2.0 support to run smoothly
|
||||||
#On platforms where it's not available, it can still be built to work
|
#On platforms where it's not available, it can still be built to work
|
||||||
#provided the BrokenGL file resides in the SleepyHead source root directory
|
#provided the BrokenGL DEFINES flag is passed to qmake (eg, qmake [specs] /path/to/SleepyHeadQT.pro DEFINES+=BrokenGL)
|
||||||
contains(DEFINES, BrokenGL) {
|
contains(DEFINES, BrokenGL) {
|
||||||
message("Building with QWidget gGraphView")
|
message("Building with QWidget gGraphView")
|
||||||
DEFINES += BROKEN_OPENGL_BUILD
|
DEFINES += BROKEN_OPENGL_BUILD
|
||||||
@ -24,6 +24,7 @@ contains(DEFINES, BrokenGL) {
|
|||||||
QT += opengl
|
QT += opengl
|
||||||
|
|
||||||
#The following forces ResMed session locking.. it *may* not be necessary.. I'm still trying to assess this properly.
|
#The following forces ResMed session locking.. it *may* not be necessary.. I'm still trying to assess this properly.
|
||||||
|
#Blah blah.. this isn't connected anymore.. just leaving it until I have the energy to clean it up
|
||||||
DEFINES += LOCK_RESMED_SESSIONS
|
DEFINES += LOCK_RESMED_SESSIONS
|
||||||
|
|
||||||
#CONFIG += c++11
|
#CONFIG += c++11
|
||||||
|
Loading…
Reference in New Issue
Block a user