mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Don't Pull this one.. Swapping computers
This commit is contained in:
parent
40bb6f32af
commit
454934b246
@ -400,12 +400,15 @@ void HistoryData::Reload(Day *day)
|
|||||||
for (vector<Day *>::iterator dd=daylist.begin(); dd!=daylist.end(); dd++) { // average any multiple data sets
|
for (vector<Day *>::iterator dd=daylist.begin(); dd!=daylist.end(); dd++) { // average any multiple data sets
|
||||||
Day *d=(*dd);
|
Day *d=(*dd);
|
||||||
if (d->machine_type()==MT_CPAP) {
|
if (d->machine_type()==MT_CPAP) {
|
||||||
y=Calc(d);
|
y+=Calc(d);
|
||||||
z++;
|
z++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!z) continue;
|
|
||||||
if (z>1) y /= z;
|
if (!z)
|
||||||
|
continue;
|
||||||
|
if (z>1)
|
||||||
|
y /= z;
|
||||||
if (first) {
|
if (first) {
|
||||||
// max_x=min_x=x;
|
// max_x=min_x=x;
|
||||||
lasty=max_y=min_y=y;
|
lasty=max_y=min_y=y;
|
||||||
@ -443,6 +446,7 @@ void HistoryData::Reload(Day *day)
|
|||||||
max_y++;
|
max_y++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// assert(max_y<10000000);
|
||||||
real_min_y=min_y;
|
real_min_y=min_y;
|
||||||
real_max_y=max_y;
|
real_max_y=max_y;
|
||||||
m_ready=true;
|
m_ready=true;
|
||||||
|
@ -357,14 +357,18 @@ bool ResmedLoader::LoadEVE(Session *sess,EDFParser &edf)
|
|||||||
//Event *e;
|
//Event *e;
|
||||||
for (int s=0;s<edf.GetNumSignals();s++) {
|
for (int s=0;s<edf.GetNumSignals();s++) {
|
||||||
recs=edf.edfsignals[s]->nr*edf.GetNumDataRecords()*2;
|
recs=edf.edfsignals[s]->nr*edf.GetNumDataRecords()*2;
|
||||||
totaldur=edf.GetNumDataRecords()*edf.GetDuration();
|
|
||||||
totaldur/=3600.0;
|
|
||||||
if (!sess->first().isValid()) {
|
if (!sess->first().isValid()) {
|
||||||
sess->set_first(edf.startdate);
|
sess->set_first(edf.startdate);
|
||||||
sess->set_last(edf.startdate.addMSecs(totaldur*1000.0));
|
|
||||||
sess->set_hours(totaldur/3600.0);
|
totaldur=edf.GetNumDataRecords()*edf.GetDuration();
|
||||||
|
if (totaldur>0) {
|
||||||
|
sess->set_last(edf.startdate.addMSecs(totaldur*1000.0));
|
||||||
|
sess->set_hours(totaldur/3600.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// totaldur/=3600.0;
|
||||||
//t.sprintf("EVE: %li %.2f",recs,totaldur);
|
//t.sprintf("EVE: %li %.2f",recs,totaldur);
|
||||||
//qDebug() << edf.edfsignals[s]->label << " " << t;
|
//qDebug() << edf.edfsignals[s]->label << " " << t;
|
||||||
data=(char *)edf.edfsignals[s]->data;
|
data=(char *)edf.edfsignals[s]->data;
|
||||||
|
@ -179,7 +179,7 @@ double Session::weighted_avg_event_field(MachineCode mc,int field)
|
|||||||
//double hours=total.GetSeconds().GetLo()/3600.0;
|
//double hours=total.GetSeconds().GetLo()/3600.0;
|
||||||
|
|
||||||
double s0=0,s1=0,s2=0;
|
double s0=0,s1=0,s2=0;
|
||||||
|
if (total==0) return 0;
|
||||||
for (int i=0; i<max_slots; i++) {
|
for (int i=0; i<max_slots; i++) {
|
||||||
if (vtime[i] > 0) {
|
if (vtime[i] > 0) {
|
||||||
s0=(vtime[i]/3600.0);
|
s0=(vtime[i]/3600.0);
|
||||||
@ -188,7 +188,7 @@ double Session::weighted_avg_event_field(MachineCode mc,int field)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (s1/hours())/mult;
|
return (s1/total)/mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::AddEvent(Event * e)
|
void Session::AddEvent(Event * e)
|
||||||
|
@ -66,6 +66,9 @@ public:
|
|||||||
s_last=d;
|
s_last=d;
|
||||||
};
|
};
|
||||||
void set_hours(float h) {
|
void set_hours(float h) {
|
||||||
|
if (h<=0) {
|
||||||
|
h=0.000001;
|
||||||
|
}
|
||||||
s_hours=h;
|
s_hours=h;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
20
overview.cpp
20
overview.cpp
@ -45,7 +45,7 @@ Overview::Overview(QWidget *parent,QGLContext *context) :
|
|||||||
gSplitter->setHandleWidth(3);
|
gSplitter->setHandleWidth(3);
|
||||||
ui->graphLayout->addWidget(gSplitter);
|
ui->graphLayout->addWidget(gSplitter);
|
||||||
|
|
||||||
AHI=new gGraphWindow(ui->SummaryGraphWindow,tr("AHI"),(QGLWidget *)NULL); // Not sure here..
|
AddGraph(AHI=new gGraphWindow(ui->SummaryGraphWindow,tr("AHI"),(QGLWidget *)NULL));
|
||||||
AHI->SetTopMargin(10);
|
AHI->SetTopMargin(10);
|
||||||
AHI->SetBottomMargin(AHI->GetBottomMargin()+gXAxis::Margin+25);
|
AHI->SetBottomMargin(AHI->GetBottomMargin()+gXAxis::Margin+25);
|
||||||
AHI->AddLayer(new gFooBar(7));
|
AHI->AddLayer(new gFooBar(7));
|
||||||
@ -53,7 +53,7 @@ Overview::Overview(QWidget *parent,QGLContext *context) :
|
|||||||
AHI->AddLayer(new gBarChart(ahidata,QColor("red")));
|
AHI->AddLayer(new gBarChart(ahidata,QColor("red")));
|
||||||
AHI->setMinimumHeight(170);
|
AHI->setMinimumHeight(170);
|
||||||
|
|
||||||
PRESSURE=new gGraphWindow(ui->SummaryGraphWindow,tr("Pressure"),AHI);
|
AddGraph(PRESSURE=new gGraphWindow(ui->SummaryGraphWindow,tr("Pressure"),AHI));
|
||||||
//PRESSURE->SetMargins(10,15,65,80);
|
//PRESSURE->SetMargins(10,15,65,80);
|
||||||
PRESSURE->AddLayer(new gYAxis());
|
PRESSURE->AddLayer(new gYAxis());
|
||||||
PRESSURE->AddLayer(new gXAxis());
|
PRESSURE->AddLayer(new gXAxis());
|
||||||
@ -66,7 +66,7 @@ Overview::Overview(QWidget *parent,QGLContext *context) :
|
|||||||
PRESSURE->SetBottomMargin(PRESSURE->GetBottomMargin()+25);
|
PRESSURE->SetBottomMargin(PRESSURE->GetBottomMargin()+25);
|
||||||
PRESSURE->setMinimumHeight(170);
|
PRESSURE->setMinimumHeight(170);
|
||||||
|
|
||||||
LEAK=new gGraphWindow(ui->SummaryGraphWindow,tr("Leak"),AHI);
|
AddGraph(LEAK=new gGraphWindow(ui->SummaryGraphWindow,tr("Leak"),AHI));
|
||||||
//LEAK->SetMargins(10,15,65,80);
|
//LEAK->SetMargins(10,15,65,80);
|
||||||
//LEAK->AddLayer(new gBarChart(leak,wxYELLOW));
|
//LEAK->AddLayer(new gBarChart(leak,wxYELLOW));
|
||||||
LEAK->AddLayer(new gXAxis());
|
LEAK->AddLayer(new gXAxis());
|
||||||
@ -76,7 +76,7 @@ Overview::Overview(QWidget *parent,QGLContext *context) :
|
|||||||
LEAK->SetBottomMargin(LEAK->GetBottomMargin()+25);
|
LEAK->SetBottomMargin(LEAK->GetBottomMargin()+25);
|
||||||
LEAK->setMinimumHeight(170);
|
LEAK->setMinimumHeight(170);
|
||||||
|
|
||||||
USAGE=new gGraphWindow(ui->SummaryGraphWindow,tr("Usage (Hours)"),AHI);
|
AddGraph(USAGE=new gGraphWindow(ui->SummaryGraphWindow,tr("Usage (Hours)"),AHI));
|
||||||
//USAGE->SetMargins(10,15,65,80);
|
//USAGE->SetMargins(10,15,65,80);
|
||||||
USAGE->AddLayer(new gFooBar(7));
|
USAGE->AddLayer(new gFooBar(7));
|
||||||
USAGE->AddLayer(new gYAxis());
|
USAGE->AddLayer(new gYAxis());
|
||||||
@ -114,7 +114,12 @@ Overview::~Overview()
|
|||||||
delete dummyday;
|
delete dummyday;
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
void Overview::RedrawGraphs()
|
||||||
|
{
|
||||||
|
for (list<gGraphWindow *>::iterator g=Graphs.begin();g!=Graphs.end();g++) {
|
||||||
|
(*g)->updateGL();
|
||||||
|
}
|
||||||
|
}
|
||||||
void Overview::ReloadGraphs()
|
void Overview::ReloadGraphs()
|
||||||
{
|
{
|
||||||
for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
|
for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
|
||||||
@ -124,6 +129,7 @@ void Overview::ReloadGraphs()
|
|||||||
}
|
}
|
||||||
on_rbLastWeek_clicked();
|
on_rbLastWeek_clicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Overview::UpdateGraphs()
|
void Overview::UpdateGraphs()
|
||||||
{
|
{
|
||||||
QDate first=ui->drStart->date();
|
QDate first=ui->drStart->date();
|
||||||
@ -131,8 +137,8 @@ void Overview::UpdateGraphs()
|
|||||||
for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
|
for (list<HistoryData *>::iterator h=Data.begin();h!=Data.end();h++) {
|
||||||
//(*h)->Update(dummyday);
|
//(*h)->Update(dummyday);
|
||||||
(*h)->SetDateRange(first,last);
|
(*h)->SetDateRange(first,last);
|
||||||
}
|
}
|
||||||
|
RedrawGraphs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,6 +51,8 @@ private:
|
|||||||
QGLContext *shared_context;
|
QGLContext *shared_context;
|
||||||
|
|
||||||
void AddData(HistoryData *d) { Data.push_back(d); };
|
void AddData(HistoryData *d) { Data.push_back(d); };
|
||||||
|
void AddGraph(gGraphWindow *w) { Graphs.push_back(w); };
|
||||||
|
void RedrawGraphs();
|
||||||
|
|
||||||
HistoryData *ahidata,*pressure,*leak,*usage,*bedtime,*waketime,*pressure_iap,*pressure_eap;
|
HistoryData *ahidata,*pressure,*leak,*usage,*bedtime,*waketime,*pressure_iap,*pressure_eap;
|
||||||
HistoryData *pressure_min,*pressure_max;
|
HistoryData *pressure_min,*pressure_max;
|
||||||
@ -60,6 +62,7 @@ private:
|
|||||||
gLayer *prmax,*prmin,*iap,*eap,*pr;
|
gLayer *prmax,*prmin,*iap,*eap,*pr;
|
||||||
|
|
||||||
list<HistoryData *> Data;
|
list<HistoryData *> Data;
|
||||||
|
list<gGraphWindow *> Graphs;
|
||||||
Day *dummyday;
|
Day *dummyday;
|
||||||
QSplitter *gSplitter;
|
QSplitter *gSplitter;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user