diff --git a/SleepyHead.depend b/SleepyHead.depend index 6bc7e735..630b18e9 100644 --- a/SleepyHead.depend +++ b/SleepyHead.depend @@ -7870,9 +7870,9 @@ -1306505346 /home/mark/projects/git/sleepyhead/version.h +1306553009 /home/mark/projects/git/sleepyhead/version.h -1306415077 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h +1306549105 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h "machine.h" "machine_loader.h" "profiles.h" @@ -7901,7 +7901,7 @@ "SleepyHeadMain.h" "sleeplib/profiles.h" -1306502417 source:/home/mark/projects/git/sleepyhead/graphs/graph.cpp +1306553006 source:/home/mark/projects/git/sleepyhead/graphs/graph.cpp @@ -7947,7 +7947,7 @@ "machine_loader.h" "tinyxml/tinyxml.h" -1306489627 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp +1306552903 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp diff --git a/SleepyHead.layout b/SleepyHead.layout index fa0b0e34..67798f41 100644 --- a/SleepyHead.layout +++ b/SleepyHead.layout @@ -1,23 +1,23 @@ - + - - + + - - + + - - + + - - + + @@ -26,7 +26,7 @@ - + @@ -49,8 +49,8 @@ - - + + diff --git a/graphs/graph.cpp b/graphs/graph.cpp index 24d24d6d..badb5aa6 100644 --- a/graphs/graph.cpp +++ b/graphs/graph.cpp @@ -11,7 +11,7 @@ License: LGPL #include "graph.h" #if !wxCHECK_VERSION(2,9,0) -wxColor zwxYELLOW=wxColor(0xcf,0xcf,0x40,0xff); +wxColor zwxYELLOW=wxColor(0xc0,0xc0,0x40,0xff); wxColor *wxYELLOW=&zwxYELLOW; #endif wxColor zwxAQUA=wxColor(0x00,0xff,0xff,0xff); @@ -20,7 +20,7 @@ wxColor zwxPURPLE=wxColor(0xff,0x40,0xff,0xff); wxColor * wxPURPLE=&zwxPURPLE; wxColor zwxGREEN2=wxColor(0x40,0xff,0x40,0x5f); wxColor * wxGREEN2=&zwxGREEN2; -wxColor zwxLIGHT_YELLOW(248,248,188,255); +wxColor zwxLIGHT_YELLOW(228,228,168,255); wxColor *wxLIGHT_YELLOW=&zwxLIGHT_YELLOW; wxColor zwxDARK_GREEN=wxColor(20,128,20,255); wxColor *wxDARK_GREEN=&zwxDARK_GREEN; diff --git a/libs/sleeplib/prs1_loader.cpp b/libs/sleeplib/prs1_loader.cpp index 2dcfc374..c2384709 100644 --- a/libs/sleeplib/prs1_loader.cpp +++ b/libs/sleeplib/prs1_loader.cpp @@ -24,7 +24,8 @@ extern wxProgressDialog *loader_progress; map ModelMap= { {34,wxT("RemStar Pro with C-Flex+")}, - {35,wxT("RemStar Auto with A-Flex")} + {35,wxT("RemStar Auto with A-Flex")}, + {37,wxT("RemStar BIPAP Auto with Bi-Flex")} }; PRS1::PRS1(Profile *p,MachineID id):CPAP(p,id) @@ -43,6 +44,7 @@ PRS1::~PRS1() PRS1Loader::PRS1Loader() { + m_buffer=new unsigned char [max_load_buffer_size]; //allocate once and reuse. } PRS1Loader::~PRS1Loader() @@ -50,6 +52,7 @@ PRS1Loader::~PRS1Loader() for (auto i=PRS1List.begin(); i!=PRS1List.end(); i++) { delete i->second; } + delete [] m_buffer; } Machine *PRS1Loader::CreateMachine(wxString serial,Profile *profile) { @@ -87,7 +90,7 @@ bool PRS1Loader::Open(wxString & path,Profile *profile) wxString newpath; wxString sep=wxFileName::GetPathSeparator(); wxString pseries=wxT("P-Series"); - if (path.Right(pseries.Len()+sep.Len())==pseries) { + if (path.Right(pseries.Len()+sep.Len())==sep+pseries) { newpath=path; } else { newpath=path+sep+pseries; @@ -256,8 +259,8 @@ int PRS1Loader::OpenMachine(Machine *m,wxString path) delete sess; continue; } - const double ignore_thresh=300.0/3600.0;// Ignore useless sessions under 5 minute - if (sess->hours()hours()<=ignore_thresh) { delete sess; continue; } @@ -299,18 +302,20 @@ bool PRS1Loader::OpenSummary(Session *session,wxString filename) int size,sequence,seconds,br; time_t timestamp; unsigned char header[24]; - unsigned char ext; + unsigned char ext,sum; //wxLogMessage(wxT("Opening PRS1 Summary ")+filename); wxFFile f(filename,wxT("rb")); - if (!f.IsOpened()) return false; + if (!f.IsOpened()) + return false; int hl=16; br=f.Read(header,hl); - if (header[0]!=header[5]) return false; + if (header[0]!=header[5]) + return false; sequence=size=timestamp=seconds=ext=0; sequence=(header[10] << 24) | (header[9] << 16) | (header[8] << 8) | header[7]; @@ -318,28 +323,26 @@ bool PRS1Loader::OpenSummary(Session *session,wxString filename) size=(header[2] << 8) | header[1]; ext=header[6]; - if (ext!=1) return false; + if (ext!=1) + return false; //size|=(header[3]<<16) | (header[4]<<24); // the jury is still out on the 32bitness of one. doesn't matter here anyway. size-=(hl+2); - - unsigned char sum=0; + sum=0; for (int i=0; i wavedata; - vector wavesize; - int samples=0; + long samples=0; int duration=0; + char * buffer=(char *)m_buffer; + while (true) { br=f.Read(header,hl); if (brmax_load_buffer_size) { + wxLogError(wxT("max_load_buffer_size is too small in PRS1 Loader")); + if (cnt==0) return false; + break; + } + br=f.Read((char *)&buffer[samples],size); if (brc) min=c; - if (maxc) min=c; + if (maxAddWaveform(w); //wxLogMessage(wxT("Done PRS1 Waveforms ")+filename); diff --git a/libs/sleeplib/prs1_loader.h b/libs/sleeplib/prs1_loader.h index a15275d0..f592ace2 100644 --- a/libs/sleeplib/prs1_loader.h +++ b/libs/sleeplib/prs1_loader.h @@ -22,6 +22,8 @@ public: virtual ~PRS1(); }; +const int max_load_buffer_size=384*1024; + class PRS1Loader : public MachineLoader { public: @@ -41,7 +43,7 @@ protected: bool OpenEvents(Session *session,wxString filename); bool OpenWaveforms(Session *session,wxString filename); bool Parse002(Session *session,unsigned char *buffer,int size,time_t timestamp); - + unsigned char * m_buffer; }; diff --git a/version.h b/version.h index daca088b..2e1eeb0a 100644 --- a/version.h +++ b/version.h @@ -16,14 +16,14 @@ namespace AutoVersion{ //Standard Version Type static const long MAJOR = 0; static const long MINOR = 7; - static const long BUILD = 1377; - static const long REVISION = 1994; + static const long BUILD = 1402; + static const long REVISION = 2124; //Miscellaneous Version Types - static const long BUILDS_COUNT = 5094; - #define RC_FILEVERSION 0,7,1377,1994 - #define RC_FILEVERSION_STRING "0, 7, 1377, 1994\0" - static const char FULLVERSION_STRING[] = "0.7.1377.1994"; + static const long BUILDS_COUNT = 5151; + #define RC_FILEVERSION 0,7,1402,2124 + #define RC_FILEVERSION_STRING "0, 7, 1402, 2124\0" + static const char FULLVERSION_STRING[] = "0.7.1402.2124"; //These values are to keep track of your versioning state, don't modify them. static const long BUILD_HISTORY = 62;