diff --git a/Projects/CodeBlocks/SleepyHead.depend b/Projects/CodeBlocks/SleepyHead.depend index 93411aee..bc070ec7 100644 --- a/Projects/CodeBlocks/SleepyHead.depend +++ b/Projects/CodeBlocks/SleepyHead.depend @@ -8249,7 +8249,7 @@ 1307418393 /home/mark/projects/git/sleepyhead/src/SleepyHeadApp.h -1307436654 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h +1307442005 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h "SleepyHeadApp.h" @@ -8295,7 +8295,7 @@ -1307440007 /home/mark/projects/git/sleepyhead/src/version.h +1307445805 /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" -1307438186 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp +1307445804 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp "wx_pch.h" "version.h" @@ -8332,7 +8332,7 @@ "sleeplib/profiles.h" "sleeplib/machine_loader.h" -1307439942 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp +1307444087 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp diff --git a/src/SleepyHeadMain.cpp b/src/SleepyHeadMain.cpp index 38d14b5e..52fd8d77 100644 --- a/src/SleepyHeadMain.cpp +++ b/src/SleepyHeadMain.cpp @@ -546,8 +546,9 @@ void Summary::OnClose(wxCloseEvent &event) Daily::Daily(wxWindow *win,Profile *p) :DailyPanel(win),profile(p) { - ahi_bmp=NULL; + tiap_bmp=teap_bmp=tap_bmp=ahi_bmp=NULL; HTMLInfo=new wxHtmlWindow(this); + HTMLInfo->SetBorders(4); EventTree=new wxTreeCtrl(this); this->Connect(wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( Daily::OnEventTreeSelection), NULL, this); @@ -557,20 +558,21 @@ Daily::Daily(wxWindow *win,Profile *p) AddCPAPData(tap_iap=new TAPData(CPAP_IAP)); AddCPAPData(tap=new TAPData(CPAP_Pressure)); - TAP=new gGraphWindow(ScrolledWindow,-1,wxT("Time@Pressure"),wxPoint(0,0), wxSize(600,60), wxNO_BORDER); - TAP->SetMargins(20,15,5,50); + TAP=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@Pressure + //TAP->SetMargins(20,15,5,50); + TAP->SetMargins(0,1,0,1); TAP->AddLayer(new gCandleStick(tap)); - TAP_IAP=new gGraphWindow(ScrolledWindow,-1,wxT("Time@IPAP"),wxPoint(0,0), wxSize(600,60), wxNO_BORDER); - TAP_IAP->SetMargins(20,15,5,50); + 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("Time@EPAP"),wxPoint(0,0), wxSize(600,60), wxNO_BORDER); - TAP_EAP->SetMargins(20,15,5,50); + 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)); - G_AHI=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,60), wxNO_BORDER); //Event Breakdown") - G_AHI->SetMargins(0,2,0,2); + 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()); gCandleStick *l=new gCandleStick(g_ahi); l->AddName(wxT("H")); @@ -682,9 +684,9 @@ Daily::Daily(wxWindow *win,Profile *p) fgSizer->Add(PULSE,1,wxEXPAND); fgSizer->Add(SPO2,1,wxEXPAND); //fgSizer->Add(G_AHI,1,wxEXPAND); - fgSizer->Add(TAP,1,wxEXPAND); - fgSizer->Add(TAP_IAP,1,wxEXPAND); - fgSizer->Add(TAP_EAP,1,wxEXPAND); + //fgSizer->Add(TAP,1,wxEXPAND); + //fgSizer->Add(TAP_IAP,1,wxEXPAND); + //fgSizer->Add(TAP_EAP,1,wxEXPAND); ResetDate(); @@ -695,6 +697,18 @@ Daily::~Daily() wxMemoryFSHandler::RemoveFile(_T("ahi.png")); delete ahi_bmp; } + if (tap_bmp) { + wxMemoryFSHandler::RemoveFile(_T("tap.png")); + delete tap_bmp; + } + if (tiap_bmp) { + wxMemoryFSHandler::RemoveFile(_T("tiap.png")); + delete tiap_bmp; + } + if (teap_bmp) { + wxMemoryFSHandler::RemoveFile(_T("teap.png")); + delete teap_bmp; + } this->Disconnect(wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEventHandler( Daily::OnEventTreeSelection), NULL, this); } @@ -794,9 +808,29 @@ void Daily::RefreshData() wxMemoryFSHandler::RemoveFile(_T("ahi.png")); delete ahi_bmp; } - ahi_bmp=G_AHI->RenderBitmap(180,40); - //delete ahi_bmp; + if (tap_bmp) { + wxMemoryFSHandler::RemoveFile(_T("tap.png")); + delete tap_bmp; + } + if (tiap_bmp) { + wxMemoryFSHandler::RemoveFile(_T("tiap.png")); + delete tiap_bmp; + } + if (teap_bmp) { + wxMemoryFSHandler::RemoveFile(_T("teap.png")); + delete teap_bmp; + } + wxRect r=HTMLInfo->GetRect(); + int w=r.width-25; + ahi_bmp=G_AHI->RenderBitmap(w,25); + tap_bmp=TAP->RenderBitmap(w,25); + teap_bmp=TAP_EAP->RenderBitmap(w,25); + tiap_bmp=TAP_IAP->RenderBitmap(w,25); + wxMemoryFSHandler::AddFile(_T("ahi.png"), *ahi_bmp, wxBITMAP_TYPE_PNG); + wxMemoryFSHandler::AddFile(_T("tap.png"), *tap_bmp, wxBITMAP_TYPE_PNG); + wxMemoryFSHandler::AddFile(_T("tiap.png"), *tiap_bmp, wxBITMAP_TYPE_PNG); + wxMemoryFSHandler::AddFile(_T("teap.png"), *teap_bmp, wxBITMAP_TYPE_PNG); PRTypes pr=(PRTypes)cpap->summary_max(CPAP_PressureReliefType); @@ -831,8 +865,7 @@ void Daily::RefreshData() html=html+wxT("")+_("Wake")+wxT("")+cpap->last().Format(wxT("%H:%M"))+wxT("\n"); html=html+wxT("")+_("Total Time")+wxT("")+cpap->total_time().Format(wxT("%H:%M hours"))+wxT("\n"); html=html+wxT("  \n"); - html=html+wxT("")+_("Event Breakdown")+wxT("\n"); - html=html+wxT("\n"); + html=html+wxT("")+_("Indices")+wxT("\n"); html=html+wxT("")+_("AHI")+wxT("")+wxString::Format(wxT("%0.2f"),ahi)+wxT("\n"); html=html+wxT("")+_("Obstructive")+wxT("")+wxString::Format(wxT("%0.2f"),oai)+wxT("\n"); @@ -843,6 +876,10 @@ void Daily::RefreshData() html=html+wxT("")+_("Vsnore")+wxT("")+wxString::Format(wxT("%0.2f"),vsi)+wxT("\n"); html=html+wxT("")+_("CSR")+wxT("")+wxString::Format(wxT("%0.2f%%"),csr)+wxT("\n"); html=html+wxT("  \n"); + html=html+wxT("")+_("Event Breakdown")+wxT("\n"); + html=html+wxT("\n"); + html=html+wxT("  \n"); + html=html+wxT("")+_("Other Information")+wxT("\n"); html=html+wxT("")+_("Mode")+wxT("")+modestr+wxT("\n"); @@ -867,6 +904,20 @@ void Daily::RefreshData() } html=html+wxT("")+_("Avg Leak")+wxT("")+wxString::Format(wxT("%.2f"),cpap->summary_weighted_avg(CPAP_LeakAverage))+wxT("\n"); + html=html+wxT("  \n"); + + if (mode==MODE_BIPAP) { + html=html+wxT("")+_("Time@IPAP")+wxT("\n"); + html=html+wxT("\n"); + html=html+wxT("")+_("Time@EPAP")+wxT("\n"); + html=html+wxT("\n"); + } else { //if (mode==MODE_APAP) { + html=html+wxT("")+_("Time@Pressure")+wxT("\n"); + html=html+wxT("\n"); + } + + + html=html+wxT("  \n"); if (mode!=MODE_BIPAP) { TAP_EAP->Show(false); @@ -881,7 +932,7 @@ void Daily::RefreshData() PRD->Show(true); G_AHI->Show(true); LEAK->Show(true); - TAP->Show(true); + //TAP->Show(true); SF->Show(true); } else { html+=_("No CPAP data available"); @@ -904,6 +955,7 @@ void Daily::RefreshData() html=html+wxT("")+_("SpO2 Avg")+wxT("")+wxString::Format(wxT("%.1f%%"),oxi->summary_avg(OXI_SPO2Average))+wxT("\n"); html=html+wxT("")+_("SpO2 Min")+wxT("")+wxString::Format(wxT("%.1f%%"),oxi->summary_min(OXI_SPO2Min))+wxT("\n"); html=html+wxT("")+_("SpO2 Max")+wxT("")+wxString::Format(wxT("%.1f%%"),oxi->summary_max(OXI_SPO2Max))+wxT("\n"); + html=html+wxT("  \n"); PULSE->Show(true); SPO2->Show(true); } else { @@ -916,8 +968,6 @@ void Daily::RefreshData() if (cpap) { // fgSizer->Layout(); - html=html+wxT("  \n"); - if (cpap->summary_avg(CPAP_BrokenSummary)==1) { html=html+wxT("")+_("No System Settings Recorded")+wxT("\n"); } else { diff --git a/src/SleepyHeadMain.h b/src/SleepyHeadMain.h index 035a41ce..04d62c7f 100644 --- a/src/SleepyHeadMain.h +++ b/src/SleepyHeadMain.h @@ -83,7 +83,7 @@ protected: wxHtmlWindow *HTMLInfo; wxTreeCtrl *EventTree; - wxBitmap *ahi_bmp; + wxBitmap *ahi_bmp,*tap_bmp,*teap_bmp,*tiap_bmp; }; diff --git a/src/graphs/graph.cpp b/src/graphs/graph.cpp index a2dd6462..825d0dfa 100644 --- a/src/graphs/graph.cpp +++ b/src/graphs/graph.cpp @@ -1002,7 +1002,12 @@ void gCandleStick::Plot(wxDC & dc, gGraphWindow & w) dc.DrawText(w.Title(),start_px,0); double t1,t2; - int barwidth=25; + int barwidth; + if (m_direction==wxVERTICAL) { + barwidth=width; + } else { + barwidth=height; + } int textX, textY; wxString str; @@ -1029,9 +1034,9 @@ void gCandleStick::Plot(wxDC & dc, gGraphWindow & w) if ((int)m_names.size()>i) { str=m_names[i]+wxT(" "); } - str+=wxString::Format(wxT("%0.2f"),data->point[0][i].x); + str+=wxString::Format(wxT("%0.1f"),data->point[0][i].x); dc.GetTextExtent(str, &textX, &textY); - textX+=10; + textX+=5; if (t2>(textX)) { int j=t1+((t2/2)-(textX/2)); if (m_direction==wxVERTICAL) { diff --git a/src/version.h b/src/version.h index eeea1d6b..0f0d0b57 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 = 3413; - static const long REVISION = 1781; + static const long BUILD = 3455; + static const long REVISION = 2026; //Miscellaneous Version Types - static const long BUILDS_COUNT = 709; - #define RC_FILEVERSION 0,7,3413,1781 - #define RC_FILEVERSION_STRING "0, 7, 3413, 1781\0" - static const char FULLVERSION_STRING[] = "0.7.3413.1781"; + static const long BUILDS_COUNT = 827; + #define RC_FILEVERSION 0,7,3455,2026 + #define RC_FILEVERSION_STRING "0, 7, 3455, 2026\0" + static const char FULLVERSION_STRING[] = "0.7.3455.2026"; //These values are to keep track of your versioning state, don't modify them. static const long BUILD_HISTORY = 0;