mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-08 20:20:44 +00:00
DeVilbiss Intellipap Loader stub
This commit is contained in:
parent
af74a21244
commit
3e64de984e
72
SleepLib/loader_plugins/intellipap_loader.cpp
Normal file
72
SleepLib/loader_plugins/intellipap_loader.cpp
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
SleepLib (DeVilbiss) Intellipap Loader Implementation
|
||||||
|
|
||||||
|
Author: Mark Watkins <jedimark64@users.sourceforge.net>
|
||||||
|
License: GPL
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "intellipap_loader.h"
|
||||||
|
|
||||||
|
Intellipap::Intellipap(Profile *p,MachineID id)
|
||||||
|
:CPAP(p,id)
|
||||||
|
{
|
||||||
|
m_class=intellipap_class_name;
|
||||||
|
properties["Brand"]="DeVilbiss";
|
||||||
|
properties["Model"]="Intellipap";
|
||||||
|
}
|
||||||
|
|
||||||
|
Intellipap::~Intellipap()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
IntellipapLoader::IntellipapLoader()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
IntellipapLoader::~IntellipapLoader()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int IntellipapLoader::Open(QString & path,Profile *profile)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Machine *IntellipapLoader::CreateMachine(QString serial,Profile *profile)
|
||||||
|
{
|
||||||
|
if (!profile)
|
||||||
|
return NULL;
|
||||||
|
qDebug() << "Create Machine " << serial;
|
||||||
|
|
||||||
|
QVector<Machine *> ml=profile->GetMachines(MT_CPAP);
|
||||||
|
bool found=false;
|
||||||
|
QVector<Machine *>::iterator i;
|
||||||
|
for (i=ml.begin(); i!=ml.end(); i++) {
|
||||||
|
if (((*i)->GetClass()==intellipap_class_name) && ((*i)->properties["Serial"]==serial)) {
|
||||||
|
MachList[serial]=*i; //static_cast<CPAP *>(*i);
|
||||||
|
found=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (found) return *i;
|
||||||
|
|
||||||
|
Machine *m=new Intellipap(profile,0);
|
||||||
|
|
||||||
|
MachList[serial]=m;
|
||||||
|
profile->AddMachine(m);
|
||||||
|
|
||||||
|
m->properties["Serial"]=serial;
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool intellipap_initialized=false;
|
||||||
|
void IntellipapLoader::Register()
|
||||||
|
{
|
||||||
|
if (intellipap_initialized) return;
|
||||||
|
qDebug() << "Registering IntellipapLoader";
|
||||||
|
RegisterLoader(new IntellipapLoader());
|
||||||
|
//InitModelMap();
|
||||||
|
intellipap_initialized=true;
|
||||||
|
}
|
54
SleepLib/loader_plugins/intellipap_loader.h
Normal file
54
SleepLib/loader_plugins/intellipap_loader.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#ifndef INTELLIPAP_LOADER_H
|
||||||
|
#define INTELLIPAP_LOADER_H
|
||||||
|
|
||||||
|
#include "SleepLib/machine.h" // Base class: MachineLoader
|
||||||
|
#include "SleepLib/machine_loader.h"
|
||||||
|
#include "SleepLib/profiles.h"
|
||||||
|
|
||||||
|
|
||||||
|
//********************************************************************************************
|
||||||
|
/// IMPORTANT!!!
|
||||||
|
//********************************************************************************************
|
||||||
|
// Please INCREMENT the following value when making changes to this loaders implementation.
|
||||||
|
//
|
||||||
|
const int intellipap_data_version=0;
|
||||||
|
//
|
||||||
|
//********************************************************************************************
|
||||||
|
|
||||||
|
class Intellipap:public CPAP
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Intellipap(Profile *p,MachineID id=0);
|
||||||
|
virtual ~Intellipap();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const int intellipap_load_buffer_size=1024*1024;
|
||||||
|
|
||||||
|
|
||||||
|
const QString intellipap_class_name="Intellipap";
|
||||||
|
|
||||||
|
class IntellipapLoader : public MachineLoader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IntellipapLoader();
|
||||||
|
virtual ~IntellipapLoader();
|
||||||
|
virtual int Open(QString & path,Profile *profile);
|
||||||
|
virtual int Version() { return intellipap_data_version; }
|
||||||
|
virtual const QString & ClassName() { return intellipap_class_name; }
|
||||||
|
Machine *CreateMachine(QString serial,Profile *profile);
|
||||||
|
static void Register();
|
||||||
|
protected:
|
||||||
|
QString last;
|
||||||
|
QHash<QString,Machine *> MachList;
|
||||||
|
/*int OpenMachine(Machine *m,QString path,Profile *profile);
|
||||||
|
bool ParseProperties(Machine *m,QString filename);
|
||||||
|
bool OpenSummary(Session *session,QString filename);
|
||||||
|
bool OpenEvents(Session *session,QString filename);
|
||||||
|
bool OpenWaveforms(Session *session,QString filename);*/
|
||||||
|
|
||||||
|
unsigned char * m_buffer;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // INTELLIPAP_LOADER_H
|
@ -67,7 +67,8 @@ SOURCES += main.cpp\
|
|||||||
profileselect.cpp \
|
profileselect.cpp \
|
||||||
newprofile.cpp \
|
newprofile.cpp \
|
||||||
exportcsv.cpp \
|
exportcsv.cpp \
|
||||||
common_gui.cpp
|
common_gui.cpp \
|
||||||
|
SleepLib/loader_plugins/intellipap_loader.cpp
|
||||||
|
|
||||||
unix:SOURCES += qextserialport/posix_qextserialport.cpp
|
unix:SOURCES += qextserialport/posix_qextserialport.cpp
|
||||||
unix:!macx:SOURCES += qextserialport/qextserialenumerator_unix.cpp
|
unix:!macx:SOURCES += qextserialport/qextserialenumerator_unix.cpp
|
||||||
@ -122,7 +123,8 @@ HEADERS += \
|
|||||||
profileselect.h \
|
profileselect.h \
|
||||||
newprofile.h \
|
newprofile.h \
|
||||||
exportcsv.h \
|
exportcsv.h \
|
||||||
common_gui.h
|
common_gui.h \
|
||||||
|
SleepLib/loader_plugins/intellipap_loader.h
|
||||||
|
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
@ -157,3 +159,5 @@ OTHER_FILES += \
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -234,6 +234,9 @@ This takes extra space, and has been known to cause problems on certain computer
|
|||||||
<property name="numDigits">
|
<property name="numDigits">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="segmentStyle">
|
||||||
|
<enum>QLCDNumber::Flat</enum>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user