From 3d3aecf62b40aac4c8cb682b4fa7c909a0e5ec70 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Wed, 8 Jun 2011 17:46:16 +1000 Subject: [PATCH] EPAP and IPAP were mixed up --- Projects/CodeBlocks/SleepyHead.depend | 8 +++---- src/GUIFrame.cpp | 4 ++-- src/SleepyHeadMain.cpp | 34 +++++++++++++-------------- src/WxWizFrame.fbp | 28 +++++++++++----------- src/libs/sleeplib/prs1_loader.cpp | 12 ++++++---- src/version.h | 12 +++++----- 6 files changed, 50 insertions(+), 48 deletions(-) diff --git a/Projects/CodeBlocks/SleepyHead.depend b/Projects/CodeBlocks/SleepyHead.depend index 1724c47a..24f20520 100644 --- a/Projects/CodeBlocks/SleepyHead.depend +++ b/Projects/CodeBlocks/SleepyHead.depend @@ -8201,7 +8201,7 @@ "wx/treebase.h" "wx/hashmap.h" -1307470332 source:/home/mark/projects/git/sleepyhead/src/GUIFrame.cpp +1307516814 source:/home/mark/projects/git/sleepyhead/src/GUIFrame.cpp "wx/wxprec.h" "GUIFrame.h" @@ -8295,7 +8295,7 @@ -1307481356 /home/mark/projects/git/sleepyhead/src/version.h +1307518841 /home/mark/projects/git/sleepyhead/src/version.h 1307418393 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h "machine.h" @@ -8312,7 +8312,7 @@ "preferences.h" "tinyxml/tinyxml.h" -1307481356 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp +1307518564 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp "wx_pch.h" "version.h" @@ -8380,7 +8380,7 @@ "machine_loader.h" "tinyxml/tinyxml.h" -1307479631 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.cpp +1307515453 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.cpp diff --git a/src/GUIFrame.cpp b/src/GUIFrame.cpp index b3890f5d..22ab55e4 100644 --- a/src/GUIFrame.cpp +++ b/src/GUIFrame.cpp @@ -135,7 +135,7 @@ DailyPanel::DailyPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, con m_mgr.SetManagedWindow(this); Calendar = new wxCalendarCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_MONDAY_FIRST|wxCAL_SEQUENTIAL_MONTH_SELECTION|wxCAL_SHOW_SURROUNDING_WEEKS ); - m_mgr.AddPane( Calendar, wxAuiPaneInfo() .Left() .Caption( wxT("Selected Day") ).CloseButton( false ).MaximizeButton( false ).MinimizeButton( false ).PinButton( true ).PaneBorder( false ).Dock().Fixed().BottomDockable( false ).TopDockable( false ) ); + m_mgr.AddPane( Calendar, wxAuiPaneInfo() .Left() .Caption( wxT("Selected Day") ).PaneBorder( false ).Dock().Fixed().BottomDockable( false ).TopDockable( false ) ); ScrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); ScrolledWindow->SetScrollRate( 5, 5 ); @@ -150,7 +150,7 @@ DailyPanel::DailyPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, con ScrolledWindow->Layout(); fgSizer->Fit( ScrolledWindow ); Notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT ); - m_mgr.AddPane( Notebook, wxAuiPaneInfo() .Left() .CaptionVisible( false ).CloseButton( false ).MaximizeButton( false ).MinimizeButton( false ).PinButton( false ).PaneBorder( false ).Dock().Resizable().FloatingSize( wxDefaultSize ).DockFixed( false ).Position( 1 ).MinSize( wxSize( 280,-1 ) ) ); + m_mgr.AddPane( Notebook, wxAuiPaneInfo() .Left() .Caption( wxT("Summary") ).PaneBorder( false ).Dock().Resizable().FloatingSize( wxSize( 280,-1 ) ).DockFixed( false ).Position( 1 ).BestSize( wxSize( 280,-1 ) ) ); diff --git a/src/SleepyHeadMain.cpp b/src/SleepyHeadMain.cpp index 58d870c6..231bd986 100644 --- a/src/SleepyHeadMain.cpp +++ b/src/SleepyHeadMain.cpp @@ -571,14 +571,14 @@ Daily::Daily(wxWindow *win,Profile *p) TAP->SetMargins(0,1,0,1); TAP->AddLayer(new gCandleStick(tap)); - TAP_IAP=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@IPAP - TAP_IAP->SetMargins(0,1,0,1); - TAP_IAP->AddLayer(new gCandleStick(tap_iap)); - TAP_EAP=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@EPAP TAP_EAP->SetMargins(0,1,0,1); TAP_EAP->AddLayer(new gCandleStick(tap_eap)); + TAP_IAP=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@IPAP + TAP_IAP->SetMargins(0,1,0,1); + TAP_IAP->AddLayer(new gCandleStick(tap_iap)); + G_AHI=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Event Breakdown") G_AHI->SetMargins(0,1,0,1); AddCPAPData(g_ahi=new AHIData()); @@ -626,7 +626,7 @@ Daily::Daily(wxWindow *win,Profile *p) AddCPAPData(leakdata=new EventData(CPAP_Leak,0)); //leakdata->ForceMinY(0); //leakdata->ForceMaxY(120); - LEAK=new gGraphWindow(ScrolledWindow,-1,wxT("Mask Leaks"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); + LEAK=new gGraphWindow(ScrolledWindow,-1,wxT("Leaks"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); LEAK->AddLayer(new gLineChart(leakdata,wxPURPLE,4096,false,false,true)); LEAK->AddLayer(new gXAxis(wxBLACK)); @@ -859,8 +859,8 @@ void Daily::RefreshData() if (mode==MODE_BIPAP) { teap_bmp=TAP_EAP->RenderBitmap(w,25); tiap_bmp=TAP_IAP->RenderBitmap(w,25); - wxMemoryFSHandler::AddFile(_T("tiap.png"), *tiap_bmp, wxBITMAP_TYPE_PNG); wxMemoryFSHandler::AddFile(_T("teap.png"), *teap_bmp, wxBITMAP_TYPE_PNG); + wxMemoryFSHandler::AddFile(_T("tiap.png"), *tiap_bmp, wxBITMAP_TYPE_PNG); } pr=(PRTypes)cpap->summary_max(CPAP_PressureReliefType); @@ -907,8 +907,8 @@ void Daily::RefreshData() if (pref.Exists("fruitsalad") && pref["fruitsalad"]) { html=html+wxT(""); html=html+wxT("\n"); - html=html+wxT("\n"); html=html+wxT("\n"); + html=html+wxT("\n"); html=html+wxT("\n"); html=html+wxT("
")+_("AHI")+wxT("")+wxString::Format(wxT("%0.2f"),ahi)+wxT("
")+_("Obstructive")+wxT("")+wxString::Format(wxT("%0.2f"),oai)+wxT("
")+_("Hypopnea")+wxT("")+wxString::Format(wxT("%0.2f"),hi)+wxT("
")+_("Obstructive")+wxT("")+wxString::Format(wxT("%0.2f"),oai)+wxT("
")+_("ClearAirway")+wxT("")+wxString::Format(wxT("%0.2f"),cai)+wxT("
"); html=html+wxT("\n"); @@ -919,8 +919,8 @@ void Daily::RefreshData() } else { html=html+wxT("
")+_("RERA")+wxT("")+wxString::Format(wxT("%0.2f"),rei)+wxT("
"); html=html+wxT("\n"); - html=html+wxT("\n"); html=html+wxT("\n"); + html=html+wxT("\n"); html=html+wxT("\n"); html=html+wxT("
")+_("AHI")+wxT("")+wxString::Format(wxT("%0.2f"),ahi)+wxT("
")+_("Obstructive")+wxT("")+wxString::Format(wxT("%0.2f"),oai)+wxT("
")+_("Hypopnea")+wxT("")+wxString::Format(wxT("%0.2f"),hi)+wxT("
")+_("Obstructive")+wxT("")+wxString::Format(wxT("%0.2f"),oai)+wxT("
")+_("ClearAirway")+wxT("")+wxString::Format(wxT("%0.2f"),cai)+wxT("
"); html=html+wxT("\n"); @@ -947,8 +947,8 @@ void Daily::RefreshData() if (mode==MODE_BIPAP) { - html=html+wxT("\n"); html=html+wxT("\n"); + html=html+wxT("\n"); } else if (mode==MODE_APAP) { html=html+wxT("\n"); } else if (mode==MODE_CPAP) { @@ -965,14 +965,14 @@ void Daily::RefreshData() // html=html+wxT("\n"); } else if (mode==MODE_BIPAP) { - html=html+wxT(""); - html=html+wxT(""); + html=html+wxT(""); + } html=html+wxT("\n"); - html=html+wxT("\n"); html=html+wxT("\n"); html=html+wxT("\n"); + html=html+wxT("\n"); + html=html+wxT("\n"); + } else if (mode==MODE_APAP) { html=html+wxT("\n"); html=html+wxT("\n"); @@ -1066,7 +1066,7 @@ void Daily::RefreshData() } else if (mode==MODE_APAP) { html=html+wxT("\n"); } else if (mode==MODE_BIPAP) { - html=html+wxT("\n"); + html=html+wxT("\n"); } html=html+wxT("\n"); diff --git a/src/WxWizFrame.fbp b/src/WxWizFrame.fbp index 0eeb8f1a..3e8c771f 100644 --- a/src/WxWizFrame.fbp +++ b/src/WxWizFrame.fbp @@ -655,7 +655,7 @@ Selected Day10 - 0 + 110 @@ -670,17 +670,17 @@ 0wxID_ANY - - 0 + -1,-1 + 1 - 0 + 11Calendar0465,709 - 201,163 + -1,-1protected1 @@ -830,12 +830,12 @@ 11 - + 280,-1 - - 0 + Summary + 10 - 0 + 110 @@ -851,18 +851,18 @@ wxID_ANY - 0 + 1 - 280,-1 - 0 + -1,-1 + 11Notebook0 - + 280,-1protected - 0 + 11Resizable diff --git a/src/libs/sleeplib/prs1_loader.cpp b/src/libs/sleeplib/prs1_loader.cpp index 3f4edbd4..616bd1cf 100644 --- a/src/libs/sleeplib/prs1_loader.cpp +++ b/src/libs/sleeplib/prs1_loader.cpp @@ -309,12 +309,14 @@ int PRS1Loader::OpenMachine(Machine *m,wxString path,Profile *profile) sess->summary[CPAP_PressureMinAchieved]=sess->min_event_field(CPAP_IAP,0); sess->summary[CPAP_PressureMaxAchieved]=sess->max_event_field(CPAP_EAP,0); - sess->summary[BIPAP_IAPAverage]=sess->weighted_avg_event_field(CPAP_IAP,0); - sess->summary[BIPAP_IAPMin]=sess->min_event_field(CPAP_IAP,0); - sess->summary[BIPAP_IAPMax]=sess->max_event_field(CPAP_IAP,0); sess->summary[BIPAP_EAPAverage]=sess->weighted_avg_event_field(CPAP_EAP,0); sess->summary[BIPAP_EAPMin]=sess->min_event_field(CPAP_EAP,0); sess->summary[BIPAP_EAPMax]=sess->max_event_field(CPAP_EAP,0); + + sess->summary[BIPAP_IAPAverage]=sess->weighted_avg_event_field(CPAP_IAP,0); + sess->summary[BIPAP_IAPMin]=sess->min_event_field(CPAP_IAP,0); + sess->summary[BIPAP_IAPMax]=sess->max_event_field(CPAP_IAP,0); + } else { sess->summary[CPAP_PressureMedian]=sess->avg_event_field(CPAP_Pressure,0); //sess->summary[CPAP_PressureAverage]=sess->weighted_avg_event_field(CPAP_Pressure,0); @@ -542,8 +544,8 @@ bool PRS1Loader::Parse002(Session *session,unsigned char *buffer,int size,time_t } else if (code==0x03) { data[0]/=10.0; data[1]/=10.0; - session->AddEvent(new Event(t,CPAP_EAP, &data[1], 1)); - session->AddEvent(new Event(t,CPAP_IAP, data, 1)); + session->AddEvent(new Event(t,CPAP_EAP, data, 1)); + session->AddEvent(new Event(t,CPAP_IAP, &data[1], 1)); } else { session->AddEvent(new Event(t,cpapcode, data, 2)); } diff --git a/src/version.h b/src/version.h index 82ce5980..843c80a2 100644 --- a/src/version.h +++ b/src/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 = 3693; - static const long REVISION = 3413; + static const long BUILD = 3700; + static const long REVISION = 3455; //Miscellaneous Version Types - static const long BUILDS_COUNT = 1446; - #define RC_FILEVERSION 0,7,3693,3413 - #define RC_FILEVERSION_STRING "0, 7, 3693, 3413\0" - static const char FULLVERSION_STRING[] = "0.7.3693.3413"; + static const long BUILDS_COUNT = 1484; + #define RC_FILEVERSION 0,7,3700,3455 + #define RC_FILEVERSION_STRING "0, 7, 3700, 3455\0" + static const char FULLVERSION_STRING[] = "0.7.3700.3455"; //These values are to keep track of your versioning state, don't modify them. static const long BUILD_HISTORY = 0;
")+_("RERA")+wxT("")+wxString::Format(wxT("%0.2f"),rei)+wxT("
")+_("90% IPAP ")+wxString::Format(wxT("%.1fcmH2O"),iap90)+wxT("
")+_("90% EPAP ")+wxString::Format(wxT("%.1fcmH2O"),eap90)+wxT("
")+_("90% IPAP ")+wxString::Format(wxT("%.1fcmH2O"),iap90)+wxT("
")+_("90% Pressure ")+wxString::Format(wxT("%.2fcmH2O"),cpap->summary_weighted_avg(CPAP_PressurePercentValue))+wxT("
")+_("90% Pressure")+wxT("")+wxString::Format(wxT("%.1fcmH2O"),p90)+wxT("
IPAP")+wxString::Format(wxT("%.2f"),cpap->summary_min(BIPAP_IAPMin)); - html=html+wxT("")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(BIPAP_IAPAverage)); - html=html+wxT("")+wxString::Format(wxT("%.2f"),cpap->summary_max(BIPAP_IAPMax))+wxT("
EPAP")+wxString::Format(wxT("%.2f"),cpap->summary_min(BIPAP_EAPMin)); html=html+wxT("")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(BIPAP_EAPAverage)); html=html+wxT("")+wxString::Format(wxT("%.2f"),cpap->summary_max(BIPAP_EAPMax))+wxT("
IPAP")+wxString::Format(wxT("%.2f"),cpap->summary_min(BIPAP_IAPMin)); + html=html+wxT("")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(BIPAP_IAPAverage)); + html=html+wxT("")+wxString::Format(wxT("%.2f"),cpap->summary_max(BIPAP_IAPMax))+wxT("
Leak"); //")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(CPAP_LeakAverage)) html=html+wxT("")+wxString::Format(wxT("%.2f"),cpap->summary_min(CPAP_LeakMinimum)); @@ -1040,11 +1040,11 @@ void Daily::RefreshData() if (mode==MODE_BIPAP) { - - html=html+wxT("
")+_("Time@IPAP")+wxT("
")+_("Time@EPAP")+wxT("
")+_("Time@IPAP")+wxT("
")+_("Time@Pressure")+wxT("
")+_("Pressure")+wxT("")+wxString::Format(wxT("%.2fcmH20 Min
"),cpap->summary_min(CPAP_PressureMin))+wxString::Format(wxT("%.2fcmH2O Max"),cpap->summary_max(CPAP_PressureMax))+wxT("
")+_("Pressure")+wxT("")+wxString::Format(wxT("%.2fcmH2O IPAP
"),cpap->summary_min(CPAP_PressureMin))+wxString::Format(wxT("%.2fcmH2O EPAP"),cpap->summary_max(CPAP_PressureMax))+wxT("
")+_("Pressure")+wxT("")+wxString::Format(wxT("%.2fcmH2O EPAP
"),cpap->summary_min(CPAP_PressureMin))+wxString::Format(wxT("%.2fcmH2O IPAP"),cpap->summary_max(CPAP_PressureMax))+wxT("
")+_("Ramp")+wxT("")+wxString::Format(wxT("%.2fcmH2O"),cpap->summary_min(CPAP_RampStartingPressure))+wxString::Format(wxT(" @ %imin"),(int)cpap->summary_max(CPAP_RampTime))+wxT("