EPAP and IPAP were mixed up

This commit is contained in:
Mark Watkins 2011-06-08 17:46:16 +10:00
parent 8f9290bf6f
commit 3d3aecf62b
6 changed files with 50 additions and 48 deletions

View File

@ -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"
<wx/wx.h>
"GUIFrame.h"
@ -8295,7 +8295,7 @@
<sleeplib/machine.h>
<list>
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"
<wx/app.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
<wx/dir.h>
<wx/filename.h>
<wx/ffile.h>

View File

@ -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 ) ) );

View File

@ -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("<tr><td colspan=2><table cellspacing=0 cellpadding=2 border=0 width='100%'>");
html=html+wxT("<tr><td align='right' bgcolor='#F88017'><b><font color='black'>")+_("AHI")+wxT("</font></b></td><td bgcolor='#F88017'><b><font color='black'>")+wxString::Format(wxT("%0.2f"),ahi)+wxT("</font></b></td></tr>\n");
html=html+wxT("<tr><td align='right' bgcolor='#afbfff'><b>")+_("Obstructive")+wxT("</b></td><td bgcolor='#afbfff'>")+wxString::Format(wxT("%0.2f"),oai)+wxT("</td></tr>\n");
html=html+wxT("<tr><td align='right' bgcolor='#4040ff'><b><font color='white'>")+_("Hypopnea")+wxT("</font></b></td><td bgcolor='#4040ff'><font color='white'>")+wxString::Format(wxT("%0.2f"),hi)+wxT("</font></td></tr>\n");
html=html+wxT("<tr><td align='right' bgcolor='#40afbf'><b>")+_("Obstructive")+wxT("</b></td><td bgcolor='#40afbf'>")+wxString::Format(wxT("%0.2f"),oai)+wxT("</td></tr>\n");
html=html+wxT("<tr><td align='right' bgcolor='#ff80ff'><b>")+_("ClearAirway")+wxT("</b></td><td bgcolor='#ff80ff'>")+wxString::Format(wxT("%0.2f"),cai)+wxT("</td></tr>\n");
html=html+wxT("</table></td><td colspan=2><table cellspacing=0 cellpadding=2 border=0 width='100%'>");
html=html+wxT("<tr><td align='right' bgcolor='#ffff80'><b>")+_("RERA")+wxT("</b></td><td bgcolor='#ffff80'>")+wxString::Format(wxT("%0.2f"),rei)+wxT("</td></tr>\n");
@ -919,8 +919,8 @@ void Daily::RefreshData()
} else {
html=html+wxT("<tr><td colspan=2><table cellspacing=0 cellpadding=2 border=0 width='100%'>");
html=html+wxT("<tr><td align='right'><b><font color='black'>")+_("AHI")+wxT("</font></b></td><td><b><font color='black'>")+wxString::Format(wxT("%0.2f"),ahi)+wxT("</font></b></td></tr>\n");
html=html+wxT("<tr><td align='right'><b>")+_("Obstructive")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2f"),oai)+wxT("</td></tr>\n");
html=html+wxT("<tr><td align='right'><b>")+_("Hypopnea")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2f"),hi)+wxT("</td></tr>\n");
html=html+wxT("<tr><td align='right'><b>")+_("Obstructive")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2f"),oai)+wxT("</td></tr>\n");
html=html+wxT("<tr><td align='right'><b>")+_("ClearAirway")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2f"),cai)+wxT("</td></tr>\n");
html=html+wxT("</table></td><td colspan=2><table cellspacing=0 cellpadding=2 border=0 width='100%'>");
html=html+wxT("<tr><td align='right'><b>")+_("RERA")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2f"),rei)+wxT("</td></tr>\n");
@ -947,8 +947,8 @@ void Daily::RefreshData()
if (mode==MODE_BIPAP) {
html=html+wxT("<tr><td colspan=4 align='center'><i>")+_("90%&nbsp;IPAP ")+wxString::Format(wxT("%.1fcmH2O"),iap90)+wxT("</td></tr>\n");
html=html+wxT("<tr><td colspan=4 align='center'><i>")+_("90%&nbsp;EPAP ")+wxString::Format(wxT("%.1fcmH2O"),eap90)+wxT("</td></tr>\n");
html=html+wxT("<tr><td colspan=4 align='center'><i>")+_("90%&nbsp;IPAP ")+wxString::Format(wxT("%.1fcmH2O"),iap90)+wxT("</td></tr>\n");
} else if (mode==MODE_APAP) {
html=html+wxT("<tr><td colspan=4 align='center'><i>")+_("90%&nbsp;Pressure ")+wxString::Format(wxT("%.2fcmH2O"),cpap->summary_weighted_avg(CPAP_PressurePercentValue))+wxT("</i></td></tr>\n");
} else if (mode==MODE_CPAP) {
@ -965,14 +965,14 @@ void Daily::RefreshData()
// html=html+wxT("<tr><td><b>")+_("90%&nbsp;Pressure")+wxT("</b></td><td>")+wxString::Format(wxT("%.1fcmH2O"),p90)+wxT("</td></tr>\n");
} else if (mode==MODE_BIPAP) {
html=html+wxT("<tr><td>IPAP</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_min(BIPAP_IAPMin));
html=html+wxT("</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(BIPAP_IAPAverage));
html=html+wxT("</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_max(BIPAP_IAPMax))+wxT("</td></tr>");
html=html+wxT("<tr><td>EPAP</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_min(BIPAP_EAPMin));
html=html+wxT("</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(BIPAP_EAPAverage));
html=html+wxT("</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_max(BIPAP_EAPMax))+wxT("</td></tr>");
html=html+wxT("<tr><td>IPAP</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_min(BIPAP_IAPMin));
html=html+wxT("</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(BIPAP_IAPAverage));
html=html+wxT("</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_max(BIPAP_IAPMax))+wxT("</td></tr>");
}
html=html+wxT("<tr><td>Leak"); //</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(CPAP_LeakAverage))
html=html+wxT("</td><td>")+wxString::Format(wxT("%.2f"),cpap->summary_min(CPAP_LeakMinimum));
@ -1040,11 +1040,11 @@ void Daily::RefreshData()
if (mode==MODE_BIPAP) {
html=html+wxT("<tr><td colspan=4 align=center><i>")+_("Time@IPAP")+wxT("</i></td></tr>\n");
html=html+wxT("<tr><td colspan=4 align=center><img src=\"memory:tiap.png\" ></td></tr>\n");
html=html+wxT("<tr><td colspan=4 align=center><i>")+_("Time@EPAP")+wxT("</i></td></tr>\n");
html=html+wxT("<tr><td colspan=4 align=center><img src=\"memory:teap.png\" ></td></tr>\n");
html=html+wxT("<tr><td colspan=4 align=center><i>")+_("Time@IPAP")+wxT("</i></td></tr>\n");
html=html+wxT("<tr><td colspan=4 align=center><img src=\"memory:tiap.png\" ></td></tr>\n");
} else if (mode==MODE_APAP) {
html=html+wxT("<tr><td colspan=4 align=center><i>")+_("Time@Pressure")+wxT("</i></td></tr>\n");
html=html+wxT("<tr><td colspan=4 align=center><img src=\"memory:tap.png\"></td></tr>\n");
@ -1066,7 +1066,7 @@ void Daily::RefreshData()
} else if (mode==MODE_APAP) {
html=html+wxT("<tr><td><b>")+_("Pressure")+wxT("</b></td><td>")+wxString::Format(wxT("%.2fcmH20 Min<br>"),cpap->summary_min(CPAP_PressureMin))+wxString::Format(wxT("%.2fcmH2O Max"),cpap->summary_max(CPAP_PressureMax))+wxT("</td></tr>\n");
} else if (mode==MODE_BIPAP) {
html=html+wxT("<tr><td><b>")+_("Pressure")+wxT("</b></td><td>")+wxString::Format(wxT("%.2fcmH2O IPAP<br>"),cpap->summary_min(CPAP_PressureMin))+wxString::Format(wxT("%.2fcmH2O EPAP"),cpap->summary_max(CPAP_PressureMax))+wxT("</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Pressure")+wxT("</b></td><td>")+wxString::Format(wxT("%.2fcmH2O EPAP<br>"),cpap->summary_min(CPAP_PressureMin))+wxString::Format(wxT("%.2fcmH2O IPAP"),cpap->summary_max(CPAP_PressureMax))+wxT("</td></tr>\n");
}
html=html+wxT("<tr><td><b>")+_("Ramp")+wxT("</b></td><td>")+wxString::Format(wxT("%.2fcmH2O"),cpap->summary_min(CPAP_RampStartingPressure))+wxString::Format(wxT(" @ %imin"),(int)cpap->summary_max(CPAP_RampTime))+wxT("</td></tr>\n");

View File

@ -655,7 +655,7 @@
<property name="caption">Selected Day</property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
@ -670,17 +670,17 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="max_size">-1,-1</property>
<property name="maximize_button">1</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimize_button">1</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">Calendar</property>
<property name="pane_border">0</property>
<property name="pane_position">465,709</property>
<property name="pane_size">201,163</property>
<property name="pane_size">-1,-1</property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
@ -830,12 +830,12 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="best_size">280,-1</property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">0</property>
<property name="caption">Summary</property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
@ -851,18 +851,18 @@
<property name="id">wxID_ANY</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximize_button">1</property>
<property name="maximum_size"></property>
<property name="min_size">280,-1</property>
<property name="minimize_button">0</property>
<property name="min_size">-1,-1</property>
<property name="minimize_button">1</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">Notebook</property>
<property name="pane_border">0</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="pane_size">280,-1</property>
<property name="permission">protected</property>
<property name="pin_button">0</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position">1</property>
<property name="resize">Resizable</property>

View File

@ -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));
}

View File

@ -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;