More cms50 stub work

This commit is contained in:
Mark Watkins 2011-06-05 21:51:51 +10:00
parent ef6a590c69
commit 508ec5f261
5 changed files with 55 additions and 5 deletions

View File

@ -8231,7 +8231,7 @@
<wx/datectrl.h> <wx/datectrl.h>
<wx/dateevt.h> <wx/dateevt.h>
1307245852 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadApp.cpp 1307273168 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadApp.cpp
"wx_pch.h" "wx_pch.h"
<iostream> <iostream>
<wx/log.h> <wx/log.h>
@ -8242,6 +8242,7 @@
"SleepyHeadMain.h" "SleepyHeadMain.h"
"version.h" "version.h"
"sleeplib/prs1_loader.h" "sleeplib/prs1_loader.h"
"sleeplib/loader_plugins/cms50_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
@ -8407,3 +8408,10 @@
"tinyxml.h" "tinyxml.h"
<windows.h> <windows.h>
1307273487 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.h
"../machine_loader.h"
1307273113 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/loader_plugins/cms50_loader.cpp
<wx/log.h>
"cms50_loader.h"

View File

@ -27,6 +27,8 @@
#include "version.h" #include "version.h"
#include "sleeplib/prs1_loader.h" #include "sleeplib/prs1_loader.h"
#include "sleeplib/loader_plugins/cms50_loader.h"
#include "sleeplib/profiles.h" #include "sleeplib/profiles.h"
IMPLEMENT_APP(SleepyHeadApp); IMPLEMENT_APP(SleepyHeadApp);
@ -56,6 +58,7 @@ bool SleepyHeadApp::OnInit()
SetAppName(_("SleepyHead")); SetAppName(_("SleepyHead"));
PRS1Loader::Register(); PRS1Loader::Register();
CMS50Loader::Register();
Profiles::Scan(); Profiles::Scan();
//loader_progress->Show(); //loader_progress->Show();

View File

@ -5,7 +5,9 @@ Author: Mark Watkins <jedimark64@users.sourceforge.net>
License: GPL License: GPL
*/ */
#include <wx/log.h>
#include "cms50_loader.h" #include "cms50_loader.h"
#include "../machine.h"
CMS50Loader::CMS50Loader() CMS50Loader::CMS50Loader()
{ {
@ -16,9 +18,43 @@ CMS50Loader::~CMS50Loader()
{ {
//dtor //dtor
} }
bool CMS50Loader::Open(wxString & path,Profile *profile)
{
// CMS50 folder structure detection stuff here.
return false;
}
Machine *CreateMachine(Profile *profile)
{
if (!profile) { // shouldn't happen..
wxLogMessage(wxT("No Profile!"));
return NULL;
}
vector<Machine *> ml=profile->GetMachines(MT_OXIMETER);
bool found=false;
for (vector<Machine *>::iterator i=ml.begin(); i!=ml.end(); i++) {
if ((*i)->GetClass()==wxT("CMS50")) {
return (*i);
break;
}
}
wxLogMessage(wxT("Create CMS50"));
Machine *m=new Oximeter(profile,0);
m->SetClass(wxT("CMS50"));
m->properties[wxT("Brand")]=wxT("Contec");
m->properties[wxT("Model")]=wxT("CMS50X");
profile->AddMachine(m);
return m;
}
bool cms50_initialized=false;
static bool cms50_initialized=false;
void CMS50Loader::Register() void CMS50Loader::Register()
{ {
if (cms50_initialized) return; if (cms50_initialized) return;

View File

@ -8,7 +8,7 @@ License: GPL
#ifndef CMS50LOADER_H #ifndef CMS50LOADER_H
#define CMS50LOADER_H #define CMS50LOADER_H
#include <machine_loader.h> #include "../machine_loader.h"
class CMS50Loader : public MachineLoader class CMS50Loader : public MachineLoader
@ -19,6 +19,8 @@ class CMS50Loader : public MachineLoader
virtual bool Open(wxString & path,Profile *profile); virtual bool Open(wxString & path,Profile *profile);
static void Register(); static void Register();
Machine *CreateMachine(Profile *profile);
protected: protected:
private: private:
}; };

View File

@ -23,6 +23,7 @@ extern wxProgressDialog *loader_progress;
map<int,wxString> ModelMap; map<int,wxString> ModelMap;
// This class technically isn't needed now.. as long as m_class, Brand & Model is set, things should be fine.
PRS1::PRS1(Profile *p,MachineID id):CPAP(p,id) PRS1::PRS1(Profile *p,MachineID id):CPAP(p,id)
{ {
m_class=wxT("PRS1"); m_class=wxT("PRS1");
@ -52,7 +53,7 @@ PRS1Loader::~PRS1Loader()
Machine *PRS1Loader::CreateMachine(wxString serial,Profile *profile) Machine *PRS1Loader::CreateMachine(wxString serial,Profile *profile)
{ {
wxLogMessage(wxT("Create Machine ")+serial); wxLogMessage(wxT("Create Machine ")+serial);
if (!profile) { if (!profile) { // shouldn't happen..
wxLogMessage(wxT("No Profile!")); wxLogMessage(wxT("No Profile!"));
return NULL; return NULL;