Added Line Chart square plot mode

This commit is contained in:
Mark Watkins 2011-06-01 23:08:44 +10:00
parent abb01d9403
commit 02d0ba7ca2
12 changed files with 339 additions and 202 deletions

View File

@ -129,8 +129,11 @@ 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 ) );
HTMLInfo = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
m_mgr.AddPane( HTMLInfo, wxAuiPaneInfo() .Left() .Caption( wxT("Day Summary") ).CloseButton( false ).MaximizeButton( false ).MinimizeButton( false ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( 200,424 ) ).DockFixed( false ).Row( 0 ).Position( 1 ).MinSize( wxSize( 200,200 ) ).Layer( 0 ) );
m_mgr.AddPane( HTMLInfo, wxAuiPaneInfo() .Left() .Caption( wxT("Day Summary") ).CloseButton( false ).MaximizeButton( false ).MinimizeButton( false ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( 208,424 ) ).DockFixed( false ).Row( 0 ).Position( 1 ).MinSize( wxSize( 200,400 ) ).Layer( 0 ) );
ScrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
ScrolledWindow->SetScrollRate( 5, 5 );
@ -144,9 +147,6 @@ DailyPanel::DailyPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, con
ScrolledWindow->SetSizer( fgSizer );
ScrolledWindow->Layout();
fgSizer->Fit( ScrolledWindow );
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.Update();
@ -191,14 +191,14 @@ SummaryPanel::SummaryPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos,
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxHORIZONTAL );
rbAll = new wxRadioButton( m_panel1, wxID_ANY, _("Everything"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
bSizer1->Add( rbAll, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
rbLastMonth = new wxRadioButton( m_panel1, wxID_ANY, _("Last Month"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
bSizer1->Add( rbLastMonth, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
rbLastWeek = new wxRadioButton( m_panel1, wxID_ANY, _("Last Week"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( rbLastWeek, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
rbLastMonth = new wxRadioButton( m_panel1, wxID_ANY, _("Last Month"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( rbLastMonth, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
rbAll = new wxRadioButton( m_panel1, wxID_ANY, _("Everything"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( rbAll, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
rbCustomDate = new wxRadioButton( m_panel1, wxID_ANY, _("Custom"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer1->Add( rbCustomDate, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
@ -209,7 +209,7 @@ SummaryPanel::SummaryPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos,
bSizer1->Add( sdLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
StartDatePicker = new wxDatePickerCtrl( m_panel1, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_SPIN );
StartDatePicker = new wxDatePickerCtrl( m_panel1, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT );
StartDatePicker->Enable( false );
bSizer1->Add( StartDatePicker, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0 );
@ -220,7 +220,7 @@ SummaryPanel::SummaryPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos,
bSizer1->Add( edLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
EndDatePicker = new wxDatePickerCtrl( m_panel1, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_SPIN );
EndDatePicker = new wxDatePickerCtrl( m_panel1, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT );
EndDatePicker->Enable( false );
bSizer1->Add( EndDatePicker, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0 );
@ -232,9 +232,9 @@ SummaryPanel::SummaryPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos,
m_mgr.Update();
// Connect Events
rbAll->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbLastWeek->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbLastMonth->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbLastWeek->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbAll->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbCustomDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
StartDatePicker->Connect( wxEVT_DATE_CHANGED, wxDateEventHandler( SummaryPanel::OnStartDateChanged ), NULL, this );
EndDatePicker->Connect( wxEVT_DATE_CHANGED, wxDateEventHandler( SummaryPanel::OnEndDateChanged ), NULL, this );
@ -243,9 +243,9 @@ SummaryPanel::SummaryPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos,
SummaryPanel::~SummaryPanel()
{
// Disconnect Events
rbAll->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbLastWeek->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbLastMonth->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbLastWeek->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbAll->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
rbCustomDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SummaryPanel::OnRBSelect ), NULL, this );
StartDatePicker->Disconnect( wxEVT_DATE_CHANGED, wxDateEventHandler( SummaryPanel::OnStartDateChanged ), NULL, this );
EndDatePicker->Disconnect( wxEVT_DATE_CHANGED, wxDateEventHandler( SummaryPanel::OnEndDateChanged ), NULL, this );

View File

@ -23,10 +23,10 @@
#include <wx/aui/auibook.h>
#include <wx/frame.h>
#include <wx/aui/aui.h>
#include <wx/calctrl.h>
#include <wx/html/htmlwin.h>
#include <wx/sizer.h>
#include <wx/scrolwin.h>
#include <wx/calctrl.h>
#include <wx/panel.h>
#include <wx/radiobut.h>
#include <wx/stattext.h>
@ -85,10 +85,10 @@ class DailyPanel : public wxPanel
private:
protected:
wxCalendarCtrl* Calendar;
wxHtmlWindow* HTMLInfo;
wxScrolledWindow* ScrolledWindow;
wxFlexGridSizer* fgSizer;
wxCalendarCtrl* Calendar;
// Virtual event handlers, overide them in your derived class
virtual void OnCalendarMonth( wxCalendarEvent& event ) { event.Skip(); }
@ -97,7 +97,7 @@ class DailyPanel : public wxPanel
public:
DailyPanel( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 935,573 ), long style = wxTAB_TRAVERSAL ); wxAuiManager m_mgr;
DailyPanel( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 935,660 ), long style = wxTAB_TRAVERSAL ); wxAuiManager m_mgr;
~DailyPanel();
@ -115,9 +115,9 @@ class SummaryPanel : public wxPanel
wxScrolledWindow* ScrolledWindow;
wxFlexGridSizer* fgSizer;
wxPanel* m_panel1;
wxRadioButton* rbAll;
wxRadioButton* rbLastWeek;
wxRadioButton* rbLastMonth;
wxRadioButton* rbLastWeek;
wxRadioButton* rbAll;
wxRadioButton* rbCustomDate;
wxStaticText* sdLabel;
wxDatePickerCtrl* StartDatePicker;

View File

@ -41,12 +41,12 @@
<Compiler>
<Add option="-march=i686" />
<Add option="-O2" />
<Add option="`i686-pc-mingw32-wx-config --version=2.8 --cflags`" />
<Add option="`i686-pc-mingw32-wx-config --version=2.9 --cflags`" />
<Add option="-std=gnu++0x" />
</Compiler>
<Linker>
<Add option="-s" />
<Add option="`i686-pc-mingw32-wx-config --version=2.8 --libs richtext,aui,xrc,qa,html,adv,core,xml,net,base`" />
<Add option="`i686-pc-mingw32-wx-config --version=2.9 --libs richtext,aui,xrc,qa,html,adv,core,xml,net,base`" />
</Linker>
</Target>
</Build>

View File

@ -7785,12 +7785,12 @@
"wx/progdlg.h"
"wx/dialog.h"
1306802240 source:/home/mark/projects/git/sleepyhead/GUIFrame.cpp
1306858490 source:/home/mark/projects/git/sleepyhead/GUIFrame.cpp
"wx/wxprec.h"
<wx/wx.h>
"GUIFrame.h"
1306797017 /home/mark/projects/git/sleepyhead/GUIFrame.h
1306857828 /home/mark/projects/git/sleepyhead/GUIFrame.h
<wx/intl.h>
<wx/string.h>
<wx/bitmap.h>
@ -7805,10 +7805,10 @@
<wx/aui/auibook.h>
<wx/frame.h>
<wx/aui/aui.h>
<wx/calctrl.h>
<wx/html/htmlwin.h>
<wx/sizer.h>
<wx/scrolwin.h>
<wx/calctrl.h>
<wx/panel.h>
<wx/radiobut.h>
<wx/stattext.h>
@ -7831,8 +7831,9 @@
1305881106 /home/mark/projects/git/sleepyhead/SleepyHeadApp.h
<wx/app.h>
1306806202 /home/mark/projects/git/sleepyhead/SleepyHeadMain.h
1306925254 /home/mark/projects/git/sleepyhead/SleepyHeadMain.h
"SleepyHeadApp.h"
<wx/listbox.h>
"GUIFrame.h"
"sleeplib/machine.h"
"graphs/graph.h"
@ -7871,11 +7872,11 @@
<map>
"tinyxml/tinyxml.h"
1306817262 /home/mark/projects/git/sleepyhead/graphs/graph.h
1306927363 /home/mark/projects/git/sleepyhead/graphs/graph.h
<sleeplib/machine.h>
<list>
1306842369 /home/mark/projects/git/sleepyhead/version.h
1306933584 /home/mark/projects/git/sleepyhead/version.h
1306724655 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h
"machine.h"
@ -7892,7 +7893,7 @@
"preferences.h"
"tinyxml/tinyxml.h"
1306838801 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp
1306933486 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp
"wx_pch.h"
"version.h"
<wx/app.h>
@ -7906,11 +7907,12 @@
<wx/dcmemory.h>
<wx/filedlg.h>
<wx/fs_mem.h>
<wx/aui/aui.h>
"SleepyHeadMain.h"
"sleeplib/profiles.h"
"sleeplib/machine_loader.h"
1306832286 source:/home/mark/projects/git/sleepyhead/graphs/graph.cpp
1306931755 source:/home/mark/projects/git/sleepyhead/graphs/graph.cpp
<wx/settings.h>
<wx/dcbuffer.h>
<wx/log.h>
@ -7958,7 +7960,7 @@
"machine_loader.h"
"tinyxml/tinyxml.h"
1306760452 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp
1306926301 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp
<wx/dir.h>
<wx/filename.h>
<wx/ffile.h>
@ -8114,3 +8116,14 @@
"wx/hashmap.h"
"wx/bitmap.h"
1302101440 /usr/include/wx-2.8/wx/collpane.h
"wx/defs.h"
"wx/control.h"
"wx/gtk/collpane.h"
"wx/generic/collpaneg.h"
1302101441 /usr/include/wx-2.8/wx/gtk/collpane.h
"wx/generic/collpaneg.h"
1302101440 /usr/include/wx-2.8/wx/generic/collpaneg.h

View File

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="Debug" />
<File name="GUIFrame.cpp" open="0" top="0" tabpos="7">
<Cursor position="1774" topLine="0" />
<ActiveTarget name="Release" />
<File name="GUIFrame.cpp" open="0" top="0" tabpos="11">
<Cursor position="8034" topLine="105" />
</File>
<File name="GUIFrame.h" open="0" top="0" tabpos="0">
<Cursor position="3804" topLine="70" />
<File name="GUIFrame.h" open="0" top="0" tabpos="10">
<Cursor position="2555" topLine="27" />
</File>
<File name="SleepyHeadApp.cpp" open="0" top="0" tabpos="9">
<Cursor position="1346" topLine="14" />
</File>
<File name="SleepyHeadMain.cpp" open="1" top="1" tabpos="3">
<Cursor position="1311" topLine="21" />
<Cursor position="17212" topLine="492" />
</File>
<File name="SleepyHeadMain.h" open="1" top="0" tabpos="4">
<Cursor position="1160" topLine="15" />
<Cursor position="1835" topLine="43" />
</File>
<File name="graphs/graph.cpp" open="1" top="0" tabpos="6">
<Cursor position="623" topLine="0" />
<Cursor position="22153" topLine="873" />
</File>
<File name="graphs/graph.h" open="1" top="0" tabpos="5">
<Cursor position="10890" topLine="315" />
<Cursor position="13624" topLine="386" />
</File>
<File name="libs/sleeplib/binary_file.cpp" open="0" top="0" tabpos="11">
<Cursor position="0" topLine="0" />
@ -29,10 +29,10 @@
<Cursor position="0" topLine="0" />
</File>
<File name="libs/sleeplib/machine.cpp" open="1" top="0" tabpos="1">
<Cursor position="8242" topLine="226" />
<Cursor position="89" topLine="0" />
</File>
<File name="libs/sleeplib/machine.h" open="1" top="0" tabpos="2">
<Cursor position="2747" topLine="84" />
<Cursor position="8757" topLine="288" />
</File>
<File name="libs/sleeplib/machine_loader.cpp" open="0" top="0" tabpos="8">
<Cursor position="0" topLine="0" />
@ -52,8 +52,8 @@
<File name="libs/sleeplib/profiles.h" open="1" top="0" tabpos="8">
<Cursor position="628" topLine="5" />
</File>
<File name="libs/sleeplib/prs1_loader.cpp" open="1" top="0" tabpos="9">
<Cursor position="1473" topLine="97" />
<File name="libs/sleeplib/prs1_loader.cpp" open="0" top="0" tabpos="9">
<Cursor position="12801" topLine="357" />
</File>
<File name="libs/sleeplib/prs1_loader.h" open="0" top="0" tabpos="8">
<Cursor position="1115" topLine="0" />

View File

@ -27,7 +27,7 @@
#include <wx/dcmemory.h>
#include <wx/filedlg.h>
#include <wx/fs_mem.h>
#include <wx/aui/aui.h>
#include "SleepyHeadMain.h"
#include "sleeplib/profiles.h"
@ -211,12 +211,12 @@ void SleepyHeadFrame::DoScreenshot( wxCommandEvent &event )
wxRect r=GetRect();
#if defined(__UNIX__) // Borrowed.. this need fixing.
int cx=r.x, cy=r.y;
/*int cx=r.x, cy=r.y;
ClientToScreen(&cx,&cy);
int border_width = cx - r.x;
int title_bar_height = cy - r.y;
r.width += (border_width * 2);
r.height += title_bar_height + border_width;
r.height += title_bar_height + border_width; */
#endif
wxScreenDC sdc;
@ -250,7 +250,7 @@ void SleepyHeadFrame::OnShowSerial(wxCommandEvent& event)
void SleepyHeadFrame::OnAbout(wxCommandEvent &event)
{
wxString msg = wxbuildinfo(long_f);
msg=wxTheApp->GetAppName()+wxT(" v")+wxString(AutoVersion::FULLVERSION_STRING,wxConvUTF8)+wxT("\nAuthors: Mark Watkins / Troy Schultz\nThis is alpha software is guaranteed to break regularly!\nUse at your own risk."); //,AutoVersion::DATE,AutoVersion::MONTH,AutoVersion::YEAR
msg=wxTheApp->GetAppName()+wxT(" v")+wxString(AutoVersion::FULLVERSION_STRING,wxConvUTF8)+wxT("\nAuthors: Mark Watkins / Troy Schultz\nThis is alpha software is guaranteed to break regularly!\nUse at your own risk.\n\nLicense: GPL"); //,AutoVersion::DATE,AutoVersion::MONTH,AutoVersion::YEAR
wxMessageBox(msg, _("Welcome to..."),0,this);
}
@ -322,8 +322,11 @@ Summary::Summary(wxWindow *win,Profile *_profile)
{
AddData(ahidata=new HistoryData(profile));
AddData(pressure=new HistoryCodeData(profile,CPAP_PressureAverage));
AddData(pressure_eap=new HistoryCodeData(profile,BIPAP_EAPAverage));
AddData(pressure_iap=new HistoryCodeData(profile,BIPAP_IAPAverage));
AddData(pressure_min=new HistoryCodeData(profile,CPAP_PressureMinAchieved));
AddData(pressure_max=new HistoryCodeData(profile,CPAP_PressureMaxAchieved));
AddData(pressure_eap=new HistoryCodeData(profile,BIPAP_EAPMax));
AddData(pressure_iap=new HistoryCodeData(profile,BIPAP_IAPMin));
AddData(leak=new HistoryCodeData(profile,CPAP_LeakMedian));
AddData(usage=new UsageHistoryData(profile,UHD_Hours));
@ -341,18 +344,23 @@ Summary::Summary(wxWindow *win,Profile *_profile)
PRESSURE=new gGraphWindow(ScrolledWindow,-1,wxT("Pressure"),wxPoint(0,0), wxSize(400,160), wxNO_BORDER);
PRESSURE->SetMargins(10,15,65,80);
//PRESSURE->AddLayer(new gBarChart(pressure,wxBLUE));
PRESSURE->AddLayer(new gLineChart(pressure,wxDARK_GREEN,6192));
PRESSURE->AddLayer(new gLineChart(pressure_eap,wxRED,6192,false,true));
PRESSURE->AddLayer(new gLineChart(pressure_iap,wxBLUE,6192,false,true));
//PRESSURE->AddLayer(new gLineChart(pressure_eap,wxRED,6192,false,true));
//PRESSURE->AddLayer(new gLineChart(pressure_iap,wxBLUE,6192,false,true));
PRESSURE->AddLayer(new gYAxis(wxBLACK));
PRESSURE->AddLayer(new gXAxis(wxBLACK));
PRESSURE->AddLayer(new gLineChart(pressure_max,wxBLUE,6192,false,true,true));
PRESSURE->AddLayer(new gLineChart(pressure_min,wxRED,6192,false,true,true));
// PRESSURE->AddLayer(new gLineChart(pressure_eap,wxPURPLE,6192,false,true,true));
//PRESSURE->AddLayer(new gLineChart(pressure_iap,wxYELLOW,6192,false,true,true));
PRESSURE->AddLayer(new gLineChart(pressure,wxDARK_GREEN,6192,false,true,true));
fgSizer->Add(PRESSURE,1,wxEXPAND);
LEAK=new gGraphWindow(ScrolledWindow,-1,wxT("Mask Leak"),wxPoint(0,0), wxSize(400,160), wxNO_BORDER);
LEAK->SetMargins(10,15,65,80);
//LEAK->AddLayer(new gBarChart(leak,wxYELLOW));
LEAK->AddLayer(new gLineChart(leak,wxPURPLE,6192));
LEAK->AddLayer(new gXAxis(wxBLACK));
LEAK->AddLayer(new gLineChart(leak,wxPURPLE,6192,false,false,true));
fgSizer->Add(LEAK,1,wxEXPAND);
@ -397,8 +405,10 @@ void Summary::RefreshData()
wxString submodel=_("Unknown Model");
double ahi=ahidata->GetAverage();
double avp=pressure->GetAverage();
// double aeap=pressure_eap->GetAverage();
//double aiap=pressure_iap->GetAverage();
double apmin=pressure_min->GetAverage();
double apmax=pressure_max->GetAverage();
double aeap=pressure_eap->GetAverage();
double aiap=pressure_iap->GetAverage();
double bt=fmod(bedtime->GetAverage(),12.0);
double ua=usage->GetAverage();
double wt=waketime->GetAverage(); //fmod(bt+ua,12.0);
@ -416,10 +426,20 @@ void Summary::RefreshData()
html=html+wxT("<tr><td>&nbsp;</td><td>&nbsp;</td></tr>\n");
html=html+wxT("<tr><td colspan=2 align=left><i>")+_("Indice Averages")+wxT("</i></td></tr>\n");
html=html+wxT("<tr><td><b>")+_("AHI")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2f"),ahi)+wxT("</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Pressure")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),avp)+wxT("</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Mask Leaks")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2f"),leak->GetAverage())+wxT("</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Pressure&nbsp;Avg")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),avp)+wxT("</td></tr>\n");
if (aiap>0) {
html=html+wxT("<tr><td><b>")+_("IPAP&nbsp;Avg")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),aiap)+wxT("</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("EPAP&nbsp;Avg")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),aeap)+wxT("</td></tr>\n");
} else {
if (apmin!=apmax) {
html=html+wxT("<tr><td><b>")+_("Pressure&nbsp;Min")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),apmin)+wxT("</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Pressure&nbsp;Max")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),apmax)+wxT("</td></tr>\n");
}
}
html=html+wxT("<tr><td>&nbsp;</td><td>&nbsp;</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Mask Leaks")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2f"),leak->GetAverage())+wxT("</td></tr>\n");
html=html+wxT("<tr><td>&nbsp;</td><td>&nbsp;</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Bedtime")+wxT("</b></td><td>")+wxString::Format(wxT("%02.0f:%02i"),bt,int(bt*60) % 60)+wxT("</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Waketime")+wxT("</b></td><td>")+wxString::Format(wxT("%02.0f:%02i"),wt,int(wt*60) % 60)+wxT("</td></tr>\n");
html=html+wxT("<tr><td><b>")+_("Hours/Night")+wxT("</b></td><td>")+wxString::Format(wxT("%02.0f:%02i"),ua,int(ua*60)%60)+wxT("</td></tr>\n");
@ -485,9 +505,33 @@ void Summary::OnClose(wxCloseEvent &event)
}
/*
MyListBox::MyListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name)
:wxListBox(parent,id,pos,size,n,choices,style,validator,name)
{
InvalidateBestSize();
Clear();
}
wxSize MyListBox::DoGetBestSize() const
{
wxSize best(200, 50);
// CacheBestSize(best);
return best;
}
*/
Daily::Daily(wxWindow *win,Profile *p)
:DailyPanel(win),profile(p)
{
//SessionList=new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
//SessionList->SetMinSize(wxSize(200,50));
//SessionList->SetMaxSize(wxSize(200,50));
//m_mgr.AddPane(SessionList,wxLEFT,wxT("Sessions"));
AddData(tap_eap=new TAPData(CPAP_EAP));
AddData(tap_iap=new TAPData(CPAP_IAP));
@ -526,16 +570,16 @@ Daily::Daily(wxWindow *win,Profile *p)
AddData(leakdata=new PressureData(CPAP_Leak,0));
LEAK=new gGraphWindow(ScrolledWindow,-1,wxT("Mask Leaks"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER);
LEAK->AddLayer(new gLineChart(leakdata,wxPURPLE,4096,false));
LEAK->AddLayer(new gLineChart(leakdata,wxPURPLE,4096,false,false,true));
LEAK->AddLayer(new gXAxis(wxBLACK));
AddData(pressure_iap=new PressureData(CPAP_IAP));
AddData(pressure_eap=new PressureData(CPAP_EAP));
AddData(prd=new PressureData(CPAP_Pressure));
PRD=new gGraphWindow(ScrolledWindow,-1,wxT("Pressure"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER);
PRD->AddLayer(new gLineChart(prd,wxDARK_GREEN,4096,false));
PRD->AddLayer(new gLineChart(pressure_iap,wxBLUE,4096,false,true));
PRD->AddLayer(new gLineChart(pressure_eap,wxRED,4096,false,true));
PRD->AddLayer(new gLineChart(prd,wxDARK_GREEN,4096,false,false,true));
PRD->AddLayer(new gLineChart(pressure_iap,wxBLUE,4096,false,true,true));
PRD->AddLayer(new gLineChart(pressure_eap,wxRED,4096,false,true,true));
PRD->AddLayer(new gXAxis(wxBLACK));
AddData(frw=new FlowData());
@ -597,10 +641,12 @@ Daily::Daily(wxWindow *win,Profile *p)
fgSizer->Add(TAP_IAP,1,wxEXPAND);
fgSizer->Add(TAP_EAP,1,wxEXPAND);
ResetDate();
}
Daily::~Daily()
{
// delete SessionList;
}
void Daily::OnClose(wxCloseEvent &event)
{
@ -766,26 +812,70 @@ void Daily::RefreshData()
}
html=html+wxT("<tr><td>&nbsp;</td><td>&nbsp;</td></tr>\n");
html=html+wxT("<tr><td colspan=2 align=center><i>")+_("Session Files")+wxT("</i></td></tr>\n");
//SessionList->Clear();
for (auto i=d->begin();i!=d->end();i++) {
//wxString a=wxString::Format(wxT("Session %i"),(*i)->session());
//SessionList->Append(a);
html=html+wxT("<tr><td colspan=2 align=center>")+(*i)->first().Format(wxT("%d-%m-%Y %H:%M:%S"))+wxT(" ")+wxString::Format(wxT("%05i"),(*i)->session())+wxT("</td></tr>\n");
html=html+wxT("<tr><td colspan=2 align=center>")+(*i)->last().Format(wxT("%d-%m-%Y %H:%M:%S"))+wxT(" ")+wxString::Format(wxT("%05i"),(*i)->session())+wxT("</td></tr>\n");
}
//PRS1_SystemLockStatus
//SessionList->SetSelection(0);
html=html+wxT("</table>");
/* for (auto i=s->summary.begin();i!=s->summary.end();i++) {
MachineCode c=(*i).first;
wxString name;
if (DefaultMCShortNames.find(c)!=DefaultMCShortNames.end()) name=DefaultMCShortNames[c];
else name=wxString::Format(wxT("%04i"),(int)c);
html+=name+wxT(" = ")+(*i).second.GetString()+wxT("<br/>\n");
} */
html+=wxT("</body></html>");
HTMLInfo->SetPage(html);
/*
if (d->size()>1) {
if (!SessionList->IsShown()) {
SessionList->Show(true);
SessionList->SetMinSize(wxSize(200,45));
SessionList->SetMaxSize(wxSize(200,45));
m_mgr.AddPane(SessionList,wxLEFT,wxEmptyString);
m_mgr.GetPane(SessionList).MinSize(200,45);
m_mgr.GetPane(SessionList).MaxSize(200,45);
m_mgr.GetPane(SessionList).CaptionVisible(false);
m_mgr.GetPane(Calendar).Position(0);
m_mgr.GetPane(SessionList).Position(1);
m_mgr.GetPane(HTMLInfo).Position(2);
m_mgr.Update();
//Refresh();
}
} else {
if (SessionList->IsShown()) {
m_mgr.DetachPane(SessionList);
SessionList->Hide();
m_mgr.Update();
//Refresh();
}
//m_mgr.Update();
}
*/
} else {
HTMLInfo->SetPage(_("No CPAP Machine Data Available"));
/*if (SessionList->IsShown()) {
m_mgr.DetachPane(SessionList);
SessionList->Hide();
m_mgr.Update();
//Refresh();
}*/
}
}
void Daily::OnSelectSession( wxCommandEvent& event )
{
if (event.IsSelection()) {
int sessid=event.GetSelection();
wxLogMessage(wxT("Selected:")+wxString::Format(wxT("%i"),sessid));
}
}
///usr/local/bin/upx ./bin/Windows/SleepyHead
void Daily::OnCalendarDay( wxCalendarEvent& event )

View File

@ -13,7 +13,7 @@
#include "SleepyHeadApp.h"
#include <wx/listbox.h>
#include "GUIFrame.h"
#include "sleeplib/machine.h"
#include "graphs/graph.h"
@ -33,6 +33,8 @@ public:
// void SetProfile(Profile *p);
HistoryData *ahidata,*pressure,*leak,*usage,*bedtime,*waketime,*pressure_iap,*pressure_eap;
HistoryData *pressure_min,*pressure_max;
gGraphWindow *AHI,*PRESSURE,*LEAK,*USAGE;
wxBitmap Logo;
@ -50,6 +52,14 @@ protected:
};
/*class MyListBox:public wxListBox
{
public:
// DECLARE_DYNAMIC_CLASS(MyListBox)
MyListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("listBox"));
virtual wxSize DoGetBestSize() const;
}; */
class Daily:public DailyPanel
{
public:
@ -62,6 +72,8 @@ protected:
virtual void OnCalendarDay( wxCalendarEvent& event );
virtual void OnCalendarMonth( wxCalendarEvent& event );
virtual void OnClose(wxCloseEvent &event);
virtual void OnSelectSession( wxCommandEvent& event );
void AddData(gPointData *d) { Data.push_back(d); };
void UpdateGraphs(Day *day);
@ -72,6 +84,7 @@ protected:
Profile *profile;
list<gPointData *> Data;
//wxListBox *SessionList;
};
const wxEventType wxEVT_DO_SCREENSHOT = wxNewEventType();

View File

@ -543,10 +543,10 @@
</object>
</object>
<object class="Panel" expanded="1">
<property name="BottomDockable">0</property>
<property name="LeftDockable">0</property>
<property name="RightDockable">0</property>
<property name="TopDockable">0</property>
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_managed">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
@ -583,11 +583,11 @@
<property name="pane_size"></property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="position">0</property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size">935,573</property>
<property name="size">935,660</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@ -628,6 +628,92 @@
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxCalendarCtrl" expanded="1">
<property name="BottomDockable">0</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">0</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<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="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">1</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<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="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</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="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Fixed</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxCAL_MONDAY_FIRST|wxCAL_SEQUENTIAL_MONTH_SELECTION|wxCAL_SHOW_SURROUNDING_WEEKS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCalendar"></event>
<event name="OnCalendarDay"></event>
<event name="OnCalendarMonth">OnCalendarMonth</event>
<event name="OnCalendarSelChanged">OnCalendarDay</event>
<event name="OnCalendarWeekDayClicked"></event>
<event name="OnCalendarYear"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
<object class="wxHtmlWindow" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -657,14 +743,14 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size">200,200</property>
<property name="min_size">200,400</property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">HTMLInfo</property>
<property name="pane_border">1</property>
<property name="pane_position">483,386</property>
<property name="pane_size">200,424</property>
<property name="pane_position">467,397</property>
<property name="pane_size">208,424</property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
@ -805,98 +891,12 @@
<property name="vgap">0</property>
</object>
</object>
<object class="wxCalendarCtrl" expanded="1">
<property name="BottomDockable">0</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">0</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<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="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">1</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<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="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</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"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Fixed</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxCAL_MONDAY_FIRST|wxCAL_SEQUENTIAL_MONTH_SELECTION|wxCAL_SHOW_SURROUNDING_WEEKS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCalendar"></event>
<event name="OnCalendarDay"></event>
<event name="OnCalendarMonth">OnCalendarMonth</event>
<event name="OnCalendarSelChanged">OnCalendarDay</event>
<event name="OnCalendarWeekDayClicked"></event>
<event name="OnCalendarYear"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="Panel" expanded="1">
<property name="BottomDockable">0</property>
<property name="LeftDockable">0</property>
<property name="RightDockable">0</property>
<property name="TopDockable">0</property>
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_managed">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
@ -1267,7 +1267,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Everything</property>
<property name="label">Last Month</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@ -1276,7 +1276,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">rbAll</property>
<property name="name">rbLastMonth</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1443,7 +1443,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Last Month</property>
<property name="label">Everything</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@ -1452,7 +1452,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">rbLastMonth</property>
<property name="name">rbAll</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1726,7 +1726,7 @@
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxDP_SPIN</property>
<property name="style">wxDP_DEFAULT</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@ -1899,7 +1899,7 @@
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxDP_SPIN</property>
<property name="style">wxDP_DEFAULT</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>

View File

@ -1115,8 +1115,8 @@ void gBarChart::Plot(wxDC & dc, gGraphWindow & w)
dc.DrawLine(start_px,start_py+height,start_px+width,start_py+height);
}
gLineChart::gLineChart(gPointData *d,const wxColor * col,int dlsize,bool a,bool _hide_axes)
:gLayer(d),m_accelerate(a),m_drawlist_size(dlsize),m_hide_axes(_hide_axes)
gLineChart::gLineChart(gPointData *d,const wxColor * col,int dlsize,bool _accelerate,bool _hide_axes,bool _square_plot)
:gLayer(d),m_accelerate(_accelerate),m_drawlist_size(dlsize),m_hide_axes(_hide_axes),m_square_plot(_square_plot)
{
m_drawlist=new wxPoint [dlsize];
color.clear();
@ -1240,6 +1240,7 @@ void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
if (i>=sam) i-=sam;
}
if (point[i].x < minx) done=true;
}
px=(point[i].x - minx) * xmult;
@ -1260,6 +1261,14 @@ void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
if (py<m_drawlist[z].x) m_drawlist[z].x=py;
if (py>m_drawlist[z].y) m_drawlist[z].y=py;
} else {
if (m_square_plot && (dp>0)) { // twice as many points needed
m_drawlist[dp].x=start_px+px;
m_drawlist[dp].y=m_drawlist[dp-1].y;
if (++dp>=m_drawlist_size) {
wxLogWarning(wxT("gLineChart: m_drawlist is too small"));
break;
}
}
m_drawlist[dp].x=start_px+px;
m_drawlist[dp].y=start_py+py;
if (++dp>=m_drawlist_size) {
@ -1555,10 +1564,17 @@ void FlowData::Reload(Day *day)
//double t1=MAX(fabs(min_y),fabs(max_y));
//max_y=t1;
//min_y=-t1;
if (max_y>128) {
} else if (max_y>90) {
max_y=120;
min_y=-120;
} else if (max_y>60) {
min_y=-90;
max_y=90;
} else {
min_y=-60;
max_y=60;
}
real_min_x=min_x;
real_min_y=min_y;
@ -1597,14 +1613,14 @@ void PressureData::Reload(Day *day)
}
int t=0;
EventDataType p,lastp=-1;
EventDataType p; //,lastp=-1;
for (auto ev=(*s)->events[code].begin(); ev!=(*s)->events[code].end(); ev++) {
p=(*(*ev))[field];
if (lastp>=0) {
/*if (lastp>=0) {
wxRealPoint r2((*ev)->time().GetMJD(),lastp);
point[vc][t++]=r2;
assert(t<max_points);
}
} */
wxRealPoint r((*ev)->time().GetMJD(),p);
point[vc][t++]=r;
assert(t<max_points);
@ -1616,7 +1632,7 @@ void PressureData::Reload(Day *day)
if (r.y>max_y) max_y=r.y;
}
lastp=p;
//lastp=p;
}
np[vc]=t;
tt+=t;
@ -1838,7 +1854,7 @@ void HistoryData::Reload(Day *day)
int i=0;
bool first=true;
bool done=false;
double y;
double y,lasty=0;
for (int x=real_min_x;x<=real_max_x;x++) {
date.Set(x+2400000.5);
date.ResetTime();
@ -1853,13 +1869,13 @@ void HistoryData::Reload(Day *day)
z++;
}
if (z>1) y /= z;
point[vc][i].x=x;
point[vc][i].y=y;
if (first) {
// max_x=min_x=x;
max_y=min_y=y;
lasty=max_y=min_y=y;
first=false;
}
point[vc][i].x=x;
point[vc][i].y=y;
if (y>max_y) max_y=y;
if (y<min_y) min_y=y;
//if (x<min_x) min_x=x;
@ -1871,6 +1887,7 @@ void HistoryData::Reload(Day *day)
done=true;
}
if (done) break;
lasty=y;
}
np[vc]=i;
vc++;

View File

@ -349,17 +349,19 @@ class gFooBar:public gLayer
class gLineChart:public gLayer
{
public:
gLineChart(gPointData *d=NULL,const wxColor * col=wxBLACK,int dlsize=4096,bool a=false,bool _hide_axes=false);
gLineChart(gPointData *d=NULL,const wxColor * col=wxBLACK,int dlsize=4096,bool accelerate=false,bool _hide_axes=false,bool _square_plot=false);
virtual ~gLineChart();
virtual void Plot(wxDC & dc, gGraphWindow & w);
void SetSquarePlot(bool b) { m_square_plot=b; };
bool GetSquarePlot() { return m_square_plot; };
protected:
bool m_accelerate;
int m_drawlist_size;
wxPoint *m_drawlist;
bool m_hide_axes;
bool m_square_plot;
wxPoint screen[4096]; // max screen pixel width for accelerated plot usage only.
gYAxis * Yaxis;
gFooBar *foobar;

View File

@ -331,7 +331,9 @@ int PRS1Loader::OpenMachine(Machine *m,wxString path,Profile *profile)
}
}
if (sess->summary[CPAP_Mode]==(long)MODE_CPAP) {
sess->summary[CPAP_PressureMax]=sess->summary[CPAP_PressureMin];
}
sess->summary[CPAP_LeakMinimum]=sess->min_event_field(CPAP_Leak,0);
sess->summary[CPAP_LeakMaximum]=sess->max_event_field(CPAP_Leak,0); // should be merged..

View File

@ -4,10 +4,10 @@
namespace AutoVersion{
//Date Version Types
static const char DATE[] = "31";
static const char MONTH[] = "05";
static const char DATE[] = "01";
static const char MONTH[] = "06";
static const char YEAR[] = "2011";
static const char UBUNTU_VERSION_STYLE[] = "11.05";
static const char UBUNTU_VERSION_STYLE[] = "11.06";
//Software Status
static const char STATUS[] = "Alpha";
@ -16,14 +16,14 @@ namespace AutoVersion{
//Standard Version Type
static const long MAJOR = 0;
static const long MINOR = 7;
static const long BUILD = 2512;
static const long REVISION = 8376;
static const long BUILD = 2713;
static const long REVISION = 9489;
//Miscellaneous Version Types
static const long BUILDS_COUNT = 7621;
#define RC_FILEVERSION 0,7,2512,8376
#define RC_FILEVERSION_STRING "0, 7, 2512, 8376\0"
static const char FULLVERSION_STRING[] = "0.7.2512.8376";
static const long BUILDS_COUNT = 8127;
#define RC_FILEVERSION 0,7,2713,9489
#define RC_FILEVERSION_STRING "0, 7, 2713, 9489\0"
static const char FULLVERSION_STRING[] = "0.7.2713.9489";
//These values are to keep track of your versioning state, don't modify them.
static const long BUILD_HISTORY = 62;