mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-17 03:00:46 +00:00
ZEO Loader Stubs
This commit is contained in:
parent
508ec5f261
commit
314be4fbbc
@ -8231,7 +8231,7 @@
|
|||||||
<wx/datectrl.h>
|
<wx/datectrl.h>
|
||||||
<wx/dateevt.h>
|
<wx/dateevt.h>
|
||||||
|
|
||||||
1307273168 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadApp.cpp
|
1307275348 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadApp.cpp
|
||||||
"wx_pch.h"
|
"wx_pch.h"
|
||||||
<iostream>
|
<iostream>
|
||||||
<wx/log.h>
|
<wx/log.h>
|
||||||
@ -8243,6 +8243,7 @@
|
|||||||
"version.h"
|
"version.h"
|
||||||
"sleeplib/prs1_loader.h"
|
"sleeplib/prs1_loader.h"
|
||||||
"sleeplib/loader_plugins/cms50_loader.h"
|
"sleeplib/loader_plugins/cms50_loader.h"
|
||||||
|
"sleeplib/loader_plugins/zeo_loader.h"
|
||||||
"sleeplib/profiles.h"
|
"sleeplib/profiles.h"
|
||||||
|
|
||||||
1307245704 /home/mark/projects/git/sleepyhead/src/SleepyHeadApp.h
|
1307245704 /home/mark/projects/git/sleepyhead/src/SleepyHeadApp.h
|
||||||
@ -8378,7 +8379,7 @@
|
|||||||
"machine_loader.h"
|
"machine_loader.h"
|
||||||
"tinyxml/tinyxml.h"
|
"tinyxml/tinyxml.h"
|
||||||
|
|
||||||
1307245704 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.cpp
|
1307273388 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.cpp
|
||||||
<wx/dir.h>
|
<wx/dir.h>
|
||||||
<wx/filename.h>
|
<wx/filename.h>
|
||||||
<wx/ffile.h>
|
<wx/ffile.h>
|
||||||
@ -8408,10 +8409,14 @@
|
|||||||
"tinyxml.h"
|
"tinyxml.h"
|
||||||
<windows.h>
|
<windows.h>
|
||||||
|
|
||||||
1307273487 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.h
|
1307274777 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.h
|
||||||
"../machine_loader.h"
|
"sleeplib/machine_loader.h"
|
||||||
|
|
||||||
1307273113 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp
|
1307275420 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp
|
||||||
<wx/log.h>
|
<wx/log.h>
|
||||||
"cms50_loader.h"
|
"cms50_loader.h"
|
||||||
|
"sleeplib/machine.h"
|
||||||
|
|
||||||
|
1307275207 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/zeo_loader.h
|
||||||
|
"sleeplib/machine_loader.h"
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "sleeplib/prs1_loader.h"
|
#include "sleeplib/prs1_loader.h"
|
||||||
#include "sleeplib/loader_plugins/cms50_loader.h"
|
#include "sleeplib/loader_plugins/cms50_loader.h"
|
||||||
|
#include "sleeplib/loader_plugins/zeo_loader.h"
|
||||||
|
|
||||||
#include "sleeplib/profiles.h"
|
#include "sleeplib/profiles.h"
|
||||||
|
|
||||||
@ -57,8 +58,11 @@ bool SleepyHeadApp::OnInit()
|
|||||||
//wxDateTime::SetCountry(wxDateTime::USA);
|
//wxDateTime::SetCountry(wxDateTime::USA);
|
||||||
|
|
||||||
SetAppName(_("SleepyHead"));
|
SetAppName(_("SleepyHead"));
|
||||||
|
|
||||||
PRS1Loader::Register();
|
PRS1Loader::Register();
|
||||||
CMS50Loader::Register();
|
CMS50Loader::Register();
|
||||||
|
ZEOLoader::Register();
|
||||||
|
|
||||||
Profiles::Scan();
|
Profiles::Scan();
|
||||||
|
|
||||||
//loader_progress->Show();
|
//loader_progress->Show();
|
||||||
|
@ -7,7 +7,7 @@ License: GPL
|
|||||||
|
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
#include "cms50_loader.h"
|
#include "cms50_loader.h"
|
||||||
#include "../machine.h"
|
#include "sleeplib/machine.h"
|
||||||
|
|
||||||
CMS50Loader::CMS50Loader()
|
CMS50Loader::CMS50Loader()
|
||||||
{
|
{
|
||||||
@ -22,17 +22,22 @@ bool CMS50Loader::Open(wxString & path,Profile *profile)
|
|||||||
{
|
{
|
||||||
// CMS50 folder structure detection stuff here.
|
// CMS50 folder structure detection stuff here.
|
||||||
|
|
||||||
|
// Not sure whether to both supporting SpO2 files here, as the timestamps are utterly useless for overlay purposes.
|
||||||
|
// May just ignore the crap and support my CMS50 logger
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Machine *CreateMachine(Profile *profile)
|
Machine *CMS50Loader::CreateMachine(Profile *profile)
|
||||||
{
|
{
|
||||||
if (!profile) { // shouldn't happen..
|
if (!profile) { // shouldn't happen..
|
||||||
wxLogMessage(wxT("No Profile!"));
|
wxLogError(wxT("No Profile!"));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: This only allows for one CMS50 machine per profile..
|
||||||
|
// Upgrading their oximeter will use this same record..
|
||||||
|
|
||||||
vector<Machine *> ml=profile->GetMachines(MT_OXIMETER);
|
vector<Machine *> ml=profile->GetMachines(MT_OXIMETER);
|
||||||
bool found=false;
|
|
||||||
|
|
||||||
for (vector<Machine *>::iterator i=ml.begin(); i!=ml.end(); i++) {
|
for (vector<Machine *>::iterator i=ml.begin(); i!=ml.end(); i++) {
|
||||||
if ((*i)->GetClass()==wxT("CMS50")) {
|
if ((*i)->GetClass()==wxT("CMS50")) {
|
||||||
@ -41,11 +46,13 @@ Machine *CreateMachine(Profile *profile)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogMessage(wxT("Create CMS50"));
|
wxLogDebug(wxT("Create CMS50 Machine Record"));
|
||||||
|
|
||||||
Machine *m=new Oximeter(profile,0);
|
Machine *m=new Oximeter(profile,0);
|
||||||
m->SetClass(wxT("CMS50"));
|
m->SetClass(wxT("CMS50"));
|
||||||
m->properties[wxT("Brand")]=wxT("Contec");
|
m->properties[wxT("Brand")]=wxT("Contec");
|
||||||
m->properties[wxT("Model")]=wxT("CMS50X");
|
m->properties[wxT("Model")]=wxT("CMS50X");
|
||||||
|
|
||||||
profile->AddMachine(m);
|
profile->AddMachine(m);
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
|
@ -8,7 +8,7 @@ License: GPL
|
|||||||
#ifndef CMS50LOADER_H
|
#ifndef CMS50LOADER_H
|
||||||
#define CMS50LOADER_H
|
#define CMS50LOADER_H
|
||||||
|
|
||||||
#include "../machine_loader.h"
|
#include "sleeplib/machine_loader.h"
|
||||||
|
|
||||||
|
|
||||||
class CMS50Loader : public MachineLoader
|
class CMS50Loader : public MachineLoader
|
||||||
|
70
src/libs/sleeplib/loader_plugins/zeo_loader.cpp
Normal file
70
src/libs/sleeplib/loader_plugins/zeo_loader.cpp
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
SleepLib ZEO Loader Implementation
|
||||||
|
|
||||||
|
Author: Mark Watkins <jedimark64@users.sourceforge.net>
|
||||||
|
License: GPL
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <wx/log.h>
|
||||||
|
#include "zeo_loader.h"
|
||||||
|
#include "sleeplib/machine.h"
|
||||||
|
|
||||||
|
ZEOLoader::ZEOLoader()
|
||||||
|
{
|
||||||
|
//ctor
|
||||||
|
}
|
||||||
|
|
||||||
|
ZEOLoader::~ZEOLoader()
|
||||||
|
{
|
||||||
|
//dtor
|
||||||
|
}
|
||||||
|
bool ZEOLoader::Open(wxString & path,Profile *profile)
|
||||||
|
{
|
||||||
|
// ZEO folder structure detection stuff here.
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Machine *ZEOLoader::CreateMachine(Profile *profile)
|
||||||
|
{
|
||||||
|
if (!profile) { // shouldn't happen..
|
||||||
|
wxLogError(wxT("No Profile!"));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// NOTE: This only allows for one ZEO machine per profile..
|
||||||
|
// Upgrading their ZEO will use this same record..
|
||||||
|
|
||||||
|
vector<Machine *> ml=profile->GetMachines(MT_SLEEPSTAGE);
|
||||||
|
|
||||||
|
for (vector<Machine *>::iterator i=ml.begin(); i!=ml.end(); i++) {
|
||||||
|
if ((*i)->GetClass()==wxT("ZEO")) {
|
||||||
|
return (*i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wxLogDebug(wxT("Create ZEO Machine Record"));
|
||||||
|
|
||||||
|
Machine *m=new SleepStage(profile,0);
|
||||||
|
m->SetClass(wxT("ZEO"));
|
||||||
|
m->properties[wxT("Brand")]=wxT("ZEO");
|
||||||
|
m->properties[wxT("Model")]=wxT("Personal Sleep Coach");
|
||||||
|
|
||||||
|
profile->AddMachine(m);
|
||||||
|
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static bool zeo_initialized=false;
|
||||||
|
|
||||||
|
void ZEOLoader::Register()
|
||||||
|
{
|
||||||
|
if (zeo_initialized) return;
|
||||||
|
wxLogVerbose(wxT("Registering ZEOLoader"));
|
||||||
|
RegisterLoader(new ZEOLoader());
|
||||||
|
//InitModelMap();
|
||||||
|
zeo_initialized=true;
|
||||||
|
}
|
||||||
|
|
28
src/libs/sleeplib/loader_plugins/zeo_loader.h
Normal file
28
src/libs/sleeplib/loader_plugins/zeo_loader.h
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
SleepLib ZEO Loader Header
|
||||||
|
|
||||||
|
Author: Mark Watkins <jedimark64@users.sourceforge.net>
|
||||||
|
License: GPL
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ZEOLOADER_H
|
||||||
|
#define ZEOLOADER_H
|
||||||
|
|
||||||
|
#include "sleeplib/machine_loader.h"
|
||||||
|
|
||||||
|
|
||||||
|
class ZEOLoader : public MachineLoader
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ZEOLoader();
|
||||||
|
virtual ~ZEOLoader();
|
||||||
|
virtual bool Open(wxString & path,Profile *profile);
|
||||||
|
static void Register();
|
||||||
|
|
||||||
|
Machine *CreateMachine(Profile *profile);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ZEOLOADER_H
|
Loading…
Reference in New Issue
Block a user