diff --git a/Graphs/gGraphView.h b/Graphs/gGraphView.h index 4a1955f8..6bb9a635 100644 --- a/Graphs/gGraphView.h +++ b/Graphs/gGraphView.h @@ -186,12 +186,12 @@ protected: QVector mgl_buffers; // Default layer mouse handling = Do nothing - virtual bool wheelEvent(QWheelEvent * event) { event=event; return false; } - virtual bool mouseMoveEvent(QMouseEvent * event) { event=event; return false; } - virtual bool mousePressEvent(QMouseEvent * event) { event=event; return false; } - virtual bool mouseReleaseEvent(QMouseEvent * event) { event=event; return false; } - virtual bool mouseDoubleClickEvent(QMouseEvent * event) { event=event; return false; } - virtual bool keyPressEvent(QKeyEvent * event) { event=event; return false; } + virtual bool wheelEvent(QWheelEvent * event) { Q_UNUSED(event); return false; } + virtual bool mouseMoveEvent(QMouseEvent * event) { Q_UNUSED(event); return false; } + virtual bool mousePressEvent(QMouseEvent * event) { Q_UNUSED(event); return false; } + virtual bool mouseReleaseEvent(QMouseEvent * event) { Q_UNUSED(event); return false; } + virtual bool mouseDoubleClickEvent(QMouseEvent * event) { Q_UNUSED(event); return false; } + virtual bool keyPressEvent(QKeyEvent * event) { Q_UNUSED(event); return false; } }; class LayerGroup:public Layer diff --git a/SleepLib/loader_plugins/intellipap_loader.cpp b/SleepLib/loader_plugins/intellipap_loader.cpp index a2da7d94..c90b23a0 100644 --- a/SleepLib/loader_plugins/intellipap_loader.cpp +++ b/SleepLib/loader_plugins/intellipap_loader.cpp @@ -10,6 +10,8 @@ It does not seem to record multiple days, graph data is overwritten each time.. */ +#include + #include "intellipap_loader.h" Intellipap::Intellipap(Profile *p,MachineID id) @@ -38,9 +40,54 @@ IntellipapLoader::~IntellipapLoader() int IntellipapLoader::Open(QString & path,Profile *profile) { + // Check for SL directory + QString newpath; + + QString dirtag="SL"; + if (path.endsWith(QDir::separator()+dirtag)) { + return 0; + //newpath=path; + } else { + newpath=path+QDir::separator()+dirtag; + } + + unsigned char buf[27]; + QString filename=newpath+QDir::separator()+"U"; + QFile f(filename); + if (!f.exists()) return 0; + + QHash Sessions; + + quint32 ts1, ts2, length; + unsigned char cs; + f.open(QFile::ReadOnly); + int cnt=0; + QDateTime epoch(QDate(2000,1,1),QTime(0,0,0),Qt::UTC); + int ep=epoch.toTime_t(); + do { + cnt=f.read((char *)buf,9); + ts1=(buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; + ts2=(buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7]; + Sessions[ts1]=ts2; + QDateTime d1=QDateTime::fromTime_t(ts1+ep); + QDateTime d2=QDateTime::fromTime_t(ts2+ep); + + length=ts2-ts1; + cs=buf[8]; + qDebug() << d1 << d2 << "Length: (" << length << ")"; + } while (cnt>0); + f.close(); + + filename=newpath+QDir::separator()+"L"; + f.setFileName(filename); + if (!f.exists()) return 0; + + f.open(QFile::ReadOnly); + + // Check for DV5MFirm.bin - return 0; + return 1; } Machine *IntellipapLoader::CreateMachine(QString serial,Profile *profile) diff --git a/SleepLib/loader_plugins/prs1_loader.cpp b/SleepLib/loader_plugins/prs1_loader.cpp index 96cda4e5..49801ec6 100644 --- a/SleepLib/loader_plugins/prs1_loader.cpp +++ b/SleepLib/loader_plugins/prs1_loader.cpp @@ -99,10 +99,10 @@ int PRS1Loader::Open(QString & path,Profile *profile) QString newpath,pseries="P-Series"; qDebug() << "PRS1Loader::Open path=" << newpath; - if (path.endsWith("/"+pseries)) { + if (path.endsWith(QDir::separator()+pseries)) { newpath=path; } else { - newpath=path+"/"+pseries; + newpath=path+QDir::separator()+pseries; } QDir dir(newpath); @@ -110,12 +110,10 @@ int PRS1Loader::Open(QString & path,Profile *profile) if ((!dir.exists() || !dir.isReadable())) return 0; - dir.setFilter(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoSymLinks); dir.setSorting(QDir::Name); QFileInfoList flist=dir.entryInfoList(); - QList SerialNumbers; QList::iterator sn; @@ -150,7 +148,7 @@ int PRS1Loader::Open(QString & path,Profile *profile) QString s=*sn; m=CreateMachine(s,profile); try { - if (m) OpenMachine(m,newpath+"/"+(*sn),profile); + if (m) OpenMachine(m,newpath+QDir::separator()+(*sn),profile); } catch(OneTypePerDay e) { profile->DelMachine(m); PRS1List.erase(PRS1List.find(s)); diff --git a/SleepLib/loader_plugins/resmed_loader.cpp b/SleepLib/loader_plugins/resmed_loader.cpp index 46bcacde..d52d9e73 100644 --- a/SleepLib/loader_plugins/resmed_loader.cpp +++ b/SleepLib/loader_plugins/resmed_loader.cpp @@ -231,17 +231,16 @@ long event_cnt=0; int ResmedLoader::Open(QString & path,Profile *profile) { - QString newpath; QString dirtag="DATALOG"; - if (path.endsWith("/"+dirtag)) { + if (path.endsWith(QDir::separator()+dirtag)) { return 0; // id10t user.. //newpath=path; } else { - newpath=path+"/"+dirtag; + newpath=path+QDir::separator()+dirtag; } - QString idfile=path+"/Identification.tgt"; + QString idfile=path+QDir::separator()+"Identification.tgt"; QFile f(idfile); QHash idmap; if (f.open(QIODevice::ReadOnly)) { @@ -259,7 +258,7 @@ int ResmedLoader::Open(QString & path,Profile *profile) } } } - QString strfile=path+"/STR.edf"; + QString strfile=path+QDir::separator()+"STR.edf"; EDFParser stredf(strfile); if (!stredf.Parse()) { diff --git a/mainwindow.cpp b/mainwindow.cpp index 79040f8c..68d45c28 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -227,7 +227,7 @@ void MainWindow::on_action_Import_Data_triggered() else { importLocations.append(line); } - }; + } file.close(); }