OSCAR-code/SleepyHeadMain.h

113 lines
3.2 KiB
C
Raw Normal View History

2011-05-26 13:59:21 +00:00
/***************************************************************
* Name: SleepyHeadMain.h
* Purpose: Defines Application Frame
* Author: Mark Watkins (jedimark64@users.sourceforge.net)
* Created: 2011-05-20
* Copyright: Mark Watkins (http://sourceforge.net/projects/sleepyhead/)
* License: GPL
**************************************************************/
#ifndef SLEEPYHEADMAIN_H
#define SLEEPYHEADMAIN_H
#include "SleepyHeadApp.h"
#include "GUIFrame.h"
#include "sleeplib/machine.h"
#include "graphs/graph.h"
//#include "graphs/sleepflagsgraph.h"
//#include "graphs/cpap_wavegraph.h"
//#include "graphs/cpap_pressure.h"
class Summary:public SummaryPanel
{
public:
Summary(wxWindow *win,Profile *_profile);
2011-05-26 13:59:21 +00:00
virtual ~Summary();
void RefreshData();
void ResetProfile(Profile *p);
void AddData(HistoryData *d) { Data.push_back(d); };
// void SetProfile(Profile *p);
HistoryData *ahidata,*pressure,*leak,*usage,*bedtime,*waketime,*pressure_iap,*pressure_eap;
gGraphWindow *AHI,*PRESSURE,*LEAK,*USAGE;
wxBitmap Logo;
protected:
virtual void OnRBSelect( wxCommandEvent& event );
virtual void OnStartDateChanged( wxDateEvent& event );
virtual void OnEndDateChanged( wxDateEvent& event );
virtual void OnClose(wxCloseEvent &event);
void EnableDatePickers(bool b);
Profile *profile;
list<HistoryData *> Data;
2011-05-26 13:59:21 +00:00
};
2011-05-27 09:54:12 +00:00
2011-05-26 13:59:21 +00:00
class Daily:public DailyPanel
{
public:
Daily(wxWindow *win,Profile *p);
2011-05-26 13:59:21 +00:00
virtual ~Daily();
void ResetDate();
void RefreshData();
// void SetProfile(Profile *p);
2011-05-26 13:59:21 +00:00
protected:
virtual void OnCalendarDay( wxCalendarEvent& event );
virtual void OnCalendarMonth( wxCalendarEvent& event );
virtual void OnClose(wxCloseEvent &event);
2011-05-26 13:59:21 +00:00
void AddData(gPointData *d) { Data.push_back(d); };
void UpdateGraphs(Day *day);
2011-05-26 13:59:21 +00:00
bool foobar_datehack;
2011-05-29 07:53:37 +00:00
gPointData *tap,*tap_eap,*tap_iap,*g_ahi,*frw,*prd,*leakdata,*pressure_iap,*pressure_eap;
2011-05-27 10:53:00 +00:00
gPointData *flags[10];
2011-05-29 07:53:37 +00:00
gGraphWindow *PRD,*FRW,*G_AHI,*TAP,*LEAK,*SF,*TAP_EAP,*TAP_IAP;
2011-05-26 13:59:21 +00:00
Profile *profile;
2011-05-26 13:59:21 +00:00
list<gPointData *> Data;
};
2011-05-27 04:13:16 +00:00
const wxEventType wxEVT_DO_SCREENSHOT = wxNewEventType();
2011-05-28 13:02:39 +00:00
const wxEventType wxEVT_MACHINE_SELECTED = wxNewEventType();
const int ProfileMenuID=wxID_HIGHEST;
2011-05-26 13:59:21 +00:00
class SleepyHeadFrame: public GUIFrame
{
public:
SleepyHeadFrame(wxFrame *frame);
~SleepyHeadFrame();
private:
virtual void OnClose(wxCloseEvent& event);
virtual void OnQuit(wxCommandEvent& event);
virtual void OnAbout(wxCommandEvent& event);
2011-05-27 04:13:16 +00:00
virtual void OnScreenshot(wxCommandEvent& event);
2011-05-28 05:38:43 +00:00
virtual void OnFullscreen(wxCommandEvent& event);
2011-05-27 04:13:16 +00:00
virtual void DoScreenshot(wxCommandEvent& event);
2011-05-26 13:59:21 +00:00
virtual void OnImportSD(wxCommandEvent& event);
virtual void OnViewMenuDaily(wxCommandEvent& event);
virtual void OnViewMenuSummary(wxCommandEvent& event);
virtual void OnShowSerial(wxCommandEvent& event);
virtual void OnProfileSelected(wxCommandEvent& event);
2011-05-28 13:02:39 +00:00
virtual void UpdateProfiles();
2011-05-26 13:59:21 +00:00
Summary *summary;
Daily *daily;
Machine *machine;
Profile *profile;
2011-05-28 13:02:39 +00:00
vector<Machine *>cpap_machines;
int current_machine;
2011-05-26 13:59:21 +00:00
};
#endif // SLEEPYHEADMAIN_H