mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Minor graph fixes
This commit is contained in:
parent
67b811d866
commit
77f11d5c4b
@ -7831,7 +7831,7 @@
|
||||
1305881106 /home/mark/projects/git/sleepyhead/SleepyHeadApp.h
|
||||
<wx/app.h>
|
||||
|
||||
1306925254 /home/mark/projects/git/sleepyhead/SleepyHeadMain.h
|
||||
1307058662 /home/mark/projects/git/sleepyhead/SleepyHeadMain.h
|
||||
"SleepyHeadApp.h"
|
||||
<wx/listbox.h>
|
||||
"GUIFrame.h"
|
||||
@ -7872,11 +7872,11 @@
|
||||
<map>
|
||||
"tinyxml/tinyxml.h"
|
||||
|
||||
1307020079 /home/mark/projects/git/sleepyhead/graphs/graph.h
|
||||
1307053716 /home/mark/projects/git/sleepyhead/graphs/graph.h
|
||||
<sleeplib/machine.h>
|
||||
<list>
|
||||
|
||||
1307041425 /home/mark/projects/git/sleepyhead/version.h
|
||||
1307084623 /home/mark/projects/git/sleepyhead/version.h
|
||||
|
||||
1306724655 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h
|
||||
"machine.h"
|
||||
@ -7893,7 +7893,7 @@
|
||||
"preferences.h"
|
||||
"tinyxml/tinyxml.h"
|
||||
|
||||
1307041425 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp
|
||||
1307084513 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp
|
||||
"wx_pch.h"
|
||||
"version.h"
|
||||
<wx/app.h>
|
||||
@ -7912,7 +7912,7 @@
|
||||
"sleeplib/profiles.h"
|
||||
"sleeplib/machine_loader.h"
|
||||
|
||||
1307032239 source:/home/mark/projects/git/sleepyhead/graphs/graph.cpp
|
||||
1307084623 source:/home/mark/projects/git/sleepyhead/graphs/graph.cpp
|
||||
<wx/settings.h>
|
||||
<wx/dcbuffer.h>
|
||||
<wx/log.h>
|
||||
@ -7961,7 +7961,7 @@
|
||||
"machine_loader.h"
|
||||
"tinyxml/tinyxml.h"
|
||||
|
||||
1307041187 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp
|
||||
1307083014 source:/home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.cpp
|
||||
<wx/dir.h>
|
||||
<wx/filename.h>
|
||||
<wx/ffile.h>
|
||||
|
@ -322,41 +322,42 @@ Summary::Summary(wxWindow *win,Profile *_profile)
|
||||
{
|
||||
AddData(ahidata=new HistoryData(profile));
|
||||
AddData(pressure=new HistoryCodeData(profile,CPAP_PressureAverage));
|
||||
AddData(pressure_min=new HistoryCodeData(profile,CPAP_PressureMinAchieved));
|
||||
AddData(pressure_max=new HistoryCodeData(profile,CPAP_PressureMaxAchieved));
|
||||
AddData(pressure_min=new HistoryCodeData(profile,CPAP_PressureMin));
|
||||
AddData(pressure_max=new HistoryCodeData(profile,CPAP_PressureMax));
|
||||
|
||||
AddData(pressure_eap=new HistoryCodeData(profile,BIPAP_EAPMax));
|
||||
AddData(pressure_iap=new HistoryCodeData(profile,BIPAP_IAPMin));
|
||||
AddData(pressure_eap=new HistoryCodeData(profile,BIPAP_EAPAverage));
|
||||
AddData(pressure_iap=new HistoryCodeData(profile,BIPAP_IAPAverage));
|
||||
|
||||
// pressure->ForceMinY(3);
|
||||
// pressure->ForceMaxY(12);
|
||||
AddData(leak=new HistoryCodeData(profile,CPAP_LeakMedian));
|
||||
AddData(usage=new UsageHistoryData(profile,UHD_Hours));
|
||||
AddData(waketime=new UsageHistoryData(profile,UHD_Waketime));
|
||||
AddData(bedtime=new UsageHistoryData(profile,UHD_Bedtime));
|
||||
|
||||
AHI=new gGraphWindow(ScrolledWindow,-1,wxT("AHI"),wxPoint(0,0), wxSize(400,160), wxNO_BORDER);
|
||||
AHI=new gGraphWindow(ScrolledWindow,-1,wxT("AHI"),wxPoint(0,0), wxSize(400,180), wxNO_BORDER);
|
||||
AHI->SetMargins(10,15,65,80);
|
||||
AHI->AddLayer(new gBarChart(ahidata,wxRED));
|
||||
AHI->AddLayer(new gFooBar());
|
||||
// AHI->AddLayer(new gXAxis(NULL,wxBLACK));
|
||||
//AHI->AddLayer(new gLineChart(ahidata,wxRED));
|
||||
fgSizer->Add(AHI,1,wxEXPAND);
|
||||
|
||||
PRESSURE=new gGraphWindow(ScrolledWindow,-1,wxT("Pressure"),wxPoint(0,0), wxSize(400,160), wxNO_BORDER);
|
||||
PRESSURE=new gGraphWindow(ScrolledWindow,-1,wxT("Pressure"),wxPoint(0,0), wxSize(400,180), wxNO_BORDER);
|
||||
PRESSURE->SetMargins(10,15,65,80);
|
||||
//PRESSURE->AddLayer(new gBarChart(pressure,wxBLUE));
|
||||
//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));
|
||||
PRESSURE->AddLayer(prmax=new gLineChart(pressure_max,wxBLUE,6192,false,true,true));
|
||||
PRESSURE->AddLayer(prmin=new gLineChart(pressure_min,wxRED,6192,false,true,true));
|
||||
PRESSURE->AddLayer(eap=new gLineChart(pressure_eap,wxBLUE,6192,false,true,true));
|
||||
PRESSURE->AddLayer(iap=new gLineChart(pressure_iap,wxRED,6192,false,true,true));
|
||||
PRESSURE->AddLayer(pr=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=new gGraphWindow(ScrolledWindow,-1,wxT("Mask Leak"),wxPoint(0,0), wxSize(400,180), wxNO_BORDER);
|
||||
LEAK->SetMargins(10,15,65,80);
|
||||
//LEAK->AddLayer(new gBarChart(leak,wxYELLOW));
|
||||
LEAK->AddLayer(new gXAxis(wxBLACK));
|
||||
@ -364,10 +365,9 @@ Summary::Summary(wxWindow *win,Profile *_profile)
|
||||
fgSizer->Add(LEAK,1,wxEXPAND);
|
||||
|
||||
|
||||
USAGE=new gGraphWindow(ScrolledWindow,-1,wxT("Usage (Hours)"),wxPoint(0,0), wxSize(400,160), wxNO_BORDER);
|
||||
USAGE=new gGraphWindow(ScrolledWindow,-1,wxT("Usage (Hours)"),wxPoint(0,0), wxSize(400,180), wxNO_BORDER);
|
||||
USAGE->SetMargins(10,15,65,80);
|
||||
USAGE->AddLayer(new gBarChart(usage,wxGREEN));
|
||||
USAGE->AddLayer(new gFooBar());
|
||||
//USAGE->AddLayer(new gXAxis(wxBLACK));
|
||||
|
||||
//USAGE->AddLayer(new gLineChart(usage,wxGREEN));
|
||||
@ -376,10 +376,11 @@ Summary::Summary(wxWindow *win,Profile *_profile)
|
||||
// Logo.LoadFile(wxT("./pic.png"));
|
||||
//wxMemoryFSHandler::AddFile(_T("test.png"), Logo, wxBITMAP_TYPE_PNG);
|
||||
// RefreshData();
|
||||
|
||||
dummyday=new Day(NULL);
|
||||
}
|
||||
Summary::~Summary()
|
||||
{
|
||||
delete dummyday;
|
||||
// wxMemoryFSHandler::RemoveFile(_T("test.png"));
|
||||
}
|
||||
void Summary::ResetProfile(Profile *p)
|
||||
@ -401,7 +402,7 @@ void Summary::ResetProfile(Profile *p)
|
||||
void Summary::RefreshData()
|
||||
{
|
||||
for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
|
||||
(*h)->Update();
|
||||
(*h)->Update(dummyday);
|
||||
}
|
||||
|
||||
wxString submodel=_("Unknown Model");
|
||||
@ -432,10 +433,28 @@ void Summary::RefreshData()
|
||||
if (aiap>0) {
|
||||
html=html+wxT("<tr><td><b>")+_("IPAP Avg")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),aiap)+wxT("</td></tr>\n");
|
||||
html=html+wxT("<tr><td><b>")+_("EPAP Avg")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),aeap)+wxT("</td></tr>\n");
|
||||
iap->SetVisible(true);
|
||||
eap->SetVisible(true);
|
||||
prmax->SetVisible(false);
|
||||
prmin->SetVisible(false);
|
||||
pr->SetVisible(false);
|
||||
} else {
|
||||
if (apmin!=apmax) {
|
||||
prmax->SetVisible(true);
|
||||
prmin->SetVisible(true);
|
||||
pr->SetVisible(true);
|
||||
iap->SetVisible(false);
|
||||
eap->SetVisible(false);
|
||||
html=html+wxT("<tr><td><b>")+_("Pressure Min")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),apmin)+wxT("</td></tr>\n");
|
||||
html=html+wxT("<tr><td><b>")+_("Pressure Max")+wxT("</b></td><td>")+wxString::Format(wxT("%0.2fcmH2O"),apmax)+wxT("</td></tr>\n");
|
||||
} else {
|
||||
pr->SetVisible(true);
|
||||
prmax->SetVisible(false);
|
||||
prmin->SetVisible(false);
|
||||
iap->SetVisible(false);
|
||||
eap->SetVisible(false);
|
||||
//prmax->SetVisible(false);
|
||||
//prmin->SetVisible(false);
|
||||
}
|
||||
}
|
||||
html=html+wxT("<tr><td> </td><td> </td></tr>\n");
|
||||
@ -899,12 +918,7 @@ void Daily::UpdateGraphs(Day *day)
|
||||
day->OpenEvents();
|
||||
day->OpenWaveforms();
|
||||
}
|
||||
|
||||
for (list<gPointData *>::iterator g=Data.begin();g!=Data.end();g++) {
|
||||
if (day==NULL) {
|
||||
(*g)->SetMinX(0);
|
||||
(*g)->SetMaxX(0);
|
||||
}
|
||||
(*g)->Update(day);
|
||||
}
|
||||
};
|
||||
|
@ -37,6 +37,8 @@ public:
|
||||
|
||||
gGraphWindow *AHI,*PRESSURE,*LEAK,*USAGE;
|
||||
|
||||
gLayer *prmax,*prmin,*iap,*eap,*pr;
|
||||
|
||||
wxBitmap Logo;
|
||||
|
||||
protected:
|
||||
@ -49,6 +51,7 @@ protected:
|
||||
|
||||
Profile *profile;
|
||||
list<HistoryData *> Data;
|
||||
Day *dummyday;
|
||||
};
|
||||
|
||||
|
||||
|
@ -45,8 +45,11 @@ gGraphData::~gGraphData()
|
||||
void gGraphData::Update(Day *day)
|
||||
{
|
||||
Reload(day);
|
||||
|
||||
for (list<gLayer *>::iterator i=notify_layers.begin();i!=notify_layers.end();i++) {
|
||||
(*i)->DataChanged(this);
|
||||
gGraphData *g=this;
|
||||
if (!day) g=NULL;
|
||||
(*i)->DataChanged(g);
|
||||
}
|
||||
}
|
||||
|
||||
@ -632,8 +635,12 @@ void gGraphWindow::DataChanged(gLayer *layer)
|
||||
// This is possibly evil.. It needs to push one refresh event for all layers
|
||||
|
||||
// Assmption currently is Refresh que does skip
|
||||
MinX(); MinY(); MaxX(); MaxY();
|
||||
RealMinX(); RealMinY(); RealMaxX(); RealMaxY();
|
||||
if (layer) {
|
||||
MinX(); MinY(); MaxX(); MaxY();
|
||||
RealMinX(); RealMinY(); RealMaxX(); RealMaxY();
|
||||
} else {
|
||||
max_x=min_x=0;
|
||||
}
|
||||
|
||||
Refresh(false);
|
||||
}
|
||||
@ -812,6 +819,10 @@ void gYAxis::Plot(wxDC & dc,gGraphWindow &w)
|
||||
//wxString label=wxString::Format(wxT("%i %i"),scrx,scry);
|
||||
//dc.DrawText(label,0,0);
|
||||
|
||||
double miny=w.min_y;
|
||||
double maxy=w.max_y;
|
||||
if (((maxy-miny)==0) && (miny==0)) return;
|
||||
|
||||
int start_px=w.GetLeftMargin();
|
||||
int start_py=w.GetTopMargin();
|
||||
int width=scrx-(w.GetLeftMargin()+w.GetRightMargin());
|
||||
@ -823,8 +834,6 @@ void gYAxis::Plot(wxDC & dc,gGraphWindow &w)
|
||||
dc.GetTextExtent(fd,&x,&y);
|
||||
double max_yticksdiv=(y+15.0)/(height); // y+50 for rotated text
|
||||
double max_yticks=1/max_yticksdiv;
|
||||
double miny=w.min_y;
|
||||
double maxy=w.max_y;
|
||||
double yy=w.max_y-w.min_y;
|
||||
double ymult=height/yy;
|
||||
double major_ytick=max_yticksdiv*yy;
|
||||
@ -894,7 +903,8 @@ void gFooBar::Plot(wxDC & dc, gGraphWindow & w)
|
||||
if (!m_visible) return;
|
||||
|
||||
double xx=w.max_x-w.min_x;
|
||||
if (xx==0) return;
|
||||
if (xx==0)
|
||||
return;
|
||||
|
||||
int scrx = w.GetScrX();
|
||||
int scry = w.GetScrY();
|
||||
@ -1014,9 +1024,12 @@ gBarChart::gBarChart(gPointData *d,const wxColor *col,wxOrientation o)
|
||||
}
|
||||
Xaxis=new gXAxis(wxBLACK);
|
||||
Yaxis=new gYAxis(wxBLACK);
|
||||
foobar=new gFooBar();
|
||||
|
||||
}
|
||||
gBarChart::~gBarChart()
|
||||
{
|
||||
delete foobar;
|
||||
delete Yaxis;
|
||||
delete Xaxis;
|
||||
}
|
||||
@ -1046,6 +1059,7 @@ void gBarChart::Plot(wxDC & dc, gGraphWindow & w)
|
||||
if (days==0) return;
|
||||
|
||||
Yaxis->Plot(dc,w);
|
||||
foobar->Plot(dc,w);
|
||||
|
||||
dc.SetPen( *wxBLACK_PEN );
|
||||
|
||||
@ -1161,10 +1175,8 @@ void gLineChart::Plot(wxDC & dc, gGraphWindow & w)
|
||||
double yy=maxy-miny;
|
||||
double xmult=width/xx;
|
||||
double ymult=height/yy;
|
||||
if (xx<=0)
|
||||
return;
|
||||
if (yy<=0)
|
||||
return;
|
||||
if ((xx<0) || (yy<0)) return;
|
||||
if ((yy==0) && (w.min_y==0)) return;
|
||||
// assert(xx>=0);
|
||||
|
||||
static wxPen pen1(*wxLIGHT_GREY, 1, wxDOT);
|
||||
@ -1660,6 +1672,9 @@ void PressureData::Reload(Day *day)
|
||||
min_y=floor(min_y);
|
||||
max_y=ceil(max_y+1);
|
||||
if (min_y>1) min_y-=1;
|
||||
} else {
|
||||
min_y=max_y=0;
|
||||
min_x=max_x=0;
|
||||
}
|
||||
//}
|
||||
if (force_min_y!=force_max_y) {
|
||||
@ -1903,12 +1918,18 @@ void HistoryData::Reload(Day *day)
|
||||
vc++;
|
||||
min_x=real_min_x;
|
||||
max_x=real_max_x;
|
||||
|
||||
// max_x+=1;
|
||||
//real_min_x=min_x;
|
||||
//real_max_x=max_x;
|
||||
if (force_min_y!=force_max_y) {
|
||||
min_y=force_min_y;
|
||||
max_y=force_max_y;
|
||||
} else {
|
||||
if (!((min_y==max_y) && (min_y==0))) {
|
||||
if (min_y>0) min_y-=1;
|
||||
max_y++;
|
||||
}
|
||||
}
|
||||
real_min_y=min_y;
|
||||
real_max_y=max_y;
|
||||
|
@ -246,8 +246,13 @@ class gLayer
|
||||
virtual gPointData * GetData() { return data; };
|
||||
|
||||
virtual void DataChanged(gGraphData *src) {
|
||||
for (list<gGraphWindow *>::iterator i=m_graph.begin();i!=m_graph.end();i++)
|
||||
(*i)->DataChanged(this);
|
||||
for (list<gGraphWindow *>::iterator i=m_graph.begin();i!=m_graph.end();i++) {
|
||||
if (src) {
|
||||
(*i)->DataChanged(this);
|
||||
} else {
|
||||
(*i)->DataChanged(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
}; // Notify signal sent from gGraphData.. pass on to the graph so it can que a refresh and update stuff.
|
||||
|
||||
@ -423,7 +428,7 @@ class gBarChart:public gLayer
|
||||
|
||||
gXAxis *Xaxis;
|
||||
gYAxis *Yaxis;
|
||||
|
||||
gFooBar *foobar;
|
||||
};
|
||||
|
||||
class FlagData:public gPointData
|
||||
|
@ -328,6 +328,7 @@ int PRS1Loader::OpenMachine(Machine *m,wxString path,Profile *profile)
|
||||
|
||||
}
|
||||
if (sess->summary[CPAP_Mode]==(long)MODE_CPAP) {
|
||||
sess->summary[CPAP_PressureAverage]=sess->summary[CPAP_PressureMin];
|
||||
sess->summary[CPAP_PressureMax]=sess->summary[CPAP_PressureMin];
|
||||
}
|
||||
|
||||
|
12
version.h
12
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 = 2866;
|
||||
static const long REVISION = 10289;
|
||||
static const long BUILD = 2939;
|
||||
static const long REVISION = 10661;
|
||||
|
||||
//Miscellaneous Version Types
|
||||
static const long BUILDS_COUNT = 8490;
|
||||
#define RC_FILEVERSION 0,7,2866,10289
|
||||
#define RC_FILEVERSION_STRING "0, 7, 2866, 10289\0"
|
||||
static const char FULLVERSION_STRING[] = "0.7.2866.10289";
|
||||
static const long BUILDS_COUNT = 8700;
|
||||
#define RC_FILEVERSION 0,7,2939,10661
|
||||
#define RC_FILEVERSION_STRING "0, 7, 2939, 10661\0"
|
||||
static const char FULLVERSION_STRING[] = "0.7.2939.10661";
|
||||
|
||||
//These values are to keep track of your versioning state, don't modify them.
|
||||
static const long BUILD_HISTORY = 62;
|
||||
|
Loading…
Reference in New Issue
Block a user