diff --git a/README b/README index 94dfdc36..ebcfdd05 100644 --- a/README +++ b/README @@ -15,6 +15,5 @@ Licence Stuff This software is released under the GNU Public License, at a GPL version of my choosing at a later date. Exceptions: -Incorporates TinyXML.. see their readme for details in ./libs/tinyxml Incorporates QextSerialPort. Insert New BSD license here? (Apparently PD.. need to verify) diff --git a/SleepLib/loader_plugins/resmed_loader.cpp b/SleepLib/loader_plugins/resmed_loader.cpp index bf2fb4a9..e569b10f 100644 --- a/SleepLib/loader_plugins/resmed_loader.cpp +++ b/SleepLib/loader_plugins/resmed_loader.cpp @@ -206,6 +206,9 @@ Machine *ResmedLoader::CreateMachine(QString serial,Profile *profile) m->properties["Serial"]=serial; m->properties["Brand"]="ResMed"; + QString a; + a.sprintf("%i",resmed_data_version); + m->properties["DataVersion"]=a; return m; @@ -465,7 +468,6 @@ bool ResmedLoader::LoadEVE(Session *sess,EDFParser &edf) qDebug() << "Unknown ResMed annotation field: " << t; } } - // qDebug((tt.toString("yyyy-MM-dd HH:mm:ss")+t).toLatin1()); } if (pos>=recs) { qDebug() << "Short EDF EVE file" << edf.filename; @@ -493,7 +495,7 @@ bool ResmedLoader::LoadBRP(Session *sess,EDFParser &edf) if (edf.edfsignals[s]->label=="Flow") code=CPAP_FlowRate; else if (edf.edfsignals[s]->label=="Mask Pres") { code=CPAP_MaskPressure; - // for (int i=0;idata[i]/=50.0; + //for (int i=0;idata[i]/=50.0; } else { qDebug() << "Unknown Signal " << edf.edfsignals[s]->label; continue; @@ -501,8 +503,6 @@ bool ResmedLoader::LoadBRP(Session *sess,EDFParser &edf) Waveform *w=new Waveform(edf.startdate,code,edf.edfsignals[s]->data,recs,duration,edf.edfsignals[s]->digital_minimum,edf.edfsignals[s]->digital_maximum); edf.edfsignals[s]->data=NULL; // so it doesn't get deleted when edf gets trashed. sess->AddWaveform(w); - //t.sprintf("BRP: %li %.2f",recs,duration); - //qDebug((edf.edfsignals[s]->label+" "+t).toLatin1()); } return true; } @@ -542,8 +542,6 @@ bool ResmedLoader::LoadPLD(Session *sess,EDFParser &edf) // Is it save to assume the order does not change here? enum PLDType { MaskPres=0, TherapyPres, ExpPress, Leak, RR, Vt, Mv, SnoreIndex, FFLIndex, U1, U2 }; - //qDebug(edf.edfsignals[MaskPres]->label.toLatin1()); - sess->set_first(edf.startdate); sess->set_last(edf.enddate); qint64 duration=edf.GetNumDataRecords()*edf.GetDuration(); diff --git a/SleepLib/machine_loader.cpp b/SleepLib/machine_loader.cpp index dd0aee6b..1a9cab64 100644 --- a/SleepLib/machine_loader.cpp +++ b/SleepLib/machine_loader.cpp @@ -48,106 +48,10 @@ MachineLoader::~MachineLoader() void MachineLoader::LoadMachineList() { - QString filename=(*profile)["ProfileDirectory"]+"/"+m_classname+"/"+machine_profile_name; - - QFile f(filename); - if (!f.exists()) { - qDebug() << "XML file does not exist" << filename; - return; - } - TiXmlDocument xml(filename.toLatin1()); - if (!xml.LoadFile()) { - qDebug() << "Couldn't read XML file " << filename; - return; - } - TiXmlHandle hDoc(&xml); - TiXmlElement * pElem; - //TiXmlHandle hRoot(0); - pElem=hDoc.FirstChildElement().Element(); - - if (!pElem) { - qDebug("MachineList is empty."); - return; - } - - //hRoot=TiXmlHandle(pElem); - //pElem=hRoot.FirstChild("MachineList").FirstChild().Element(); - - if (pElem->Value()!="MachineList") { - qDebug() << "MachineLoader::LoadMachineList expected a MachineList"; - } - - int mt; - - Machine *mach; - pElem->QueryIntAttribute("type",&mt); - MachineType m_type=(MachineType)mt; - QString m_class=pElem->Attribute("class"); - - TiXmlElement *elem; - elem=pElem->FirstChildElement(); - if (!elem) { - qDebug("Machine is empty."); - return; - } - - int m_id; - for(; elem; elem=elem->NextSiblingElement()) { - QString pKey=elem->Value(); - if (!pKey=="Machine") continue; - - elem->QueryIntAttribute("id",&m_id); - - mach=CreateMachine(m_id); - - TiXmlElement *e=elem->FirstChildElement(); - for (; e; e=e->NextSiblingElement()) { - QString pKey=e->Value(); - mach->properties[pKey]=e->GetText(); - } -// QString filename=(*profile)["ProfileDirectory"]+"/"+m_classname+"/"+mach->hexid(); -// mach->LoadSummaries(filename); - } } void MachineLoader::StoreMachineList() { - QString filename=(*profile)["ProfileDirectory"]+"/"+m_classname+"/"+machine_profile_name; - - TiXmlDocument xml; - TiXmlElement* msg; - TiXmlComment * comment; - TiXmlDeclaration *decl=new TiXmlDeclaration( "1.0", "", "" ); - xml.LinkEndChild(decl); - TiXmlElement *root=new TiXmlElement("MachineList"); - - char *cc=m_class.toLatin1().data(); - root->SetAttribute("type",(int)m_type); - root->SetAttribute("class",cc); - - xml.LinkEndChild(root); - - if (!m_comment.isEmpty()) { - comment = new TiXmlComment(); - comment->SetValue((QString(" ")+m_comment+QString(" ")).toLatin1()); - root->LinkEndChild(comment); - } - - for (int i=0;iSetAttribute("id",m->id()); - - for (map::iterator j=i->second->properties.begin(); j!=i->second->properties.end(); j++) { - TiXmlElement *mp=new TiXmlElement(j->first.toLatin1()); - mp->LinkEndChild(new TiXmlText(j->second.toLatin1())); - me->LinkEndChild(mp); - } - root->LinkEndChild(me); - } - xml.SaveFile(p_filename.toLatin1()); } void MachineLoader::LoadSummary(Machine *m, QString &filename) { diff --git a/SleepLib/session.cpp b/SleepLib/session.cpp index c13db121..8926b0d2 100644 --- a/SleepLib/session.cpp +++ b/SleepLib/session.cpp @@ -217,7 +217,6 @@ void Session::AddEvent(Event * e) s_first=s_last=e->time(); //_first_session=false; } - //qDebug((e->time().toString("yyyy-MM-dd HH:mm:ss")+" %04i %02i").toLatin1(),e->code(),e->fields()); } void Session::AddWaveform(Waveform *w) { @@ -390,7 +389,7 @@ bool Session::StoreSummary(QString filename) bool Session::LoadSummary(QString filename) { if (filename.isEmpty()) return false; - //qDebug(("Loading Summary "+filename).toLatin1()); + //qDebug() << "Loading Summary " << filename; QFile file(filename); if (!file.open(QIODevice::ReadOnly)) {