mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
PRS1 Humid/Flex Settings Summary Chart
This commit is contained in:
parent
e02477cafd
commit
bfde64fc36
@ -68,7 +68,7 @@ void SummaryChart::SetDay(Day * nullday)
|
|||||||
type=m_type[j];
|
type=m_type[j];
|
||||||
for (int i=0;i<d.value().size();i++) {
|
for (int i=0;i<d.value().size();i++) {
|
||||||
day=d.value()[i];
|
day=d.value()[i];
|
||||||
if (type==ST_HOURS || day->channelExists(code)) { // too many lookups happening here.. stop the crap..
|
if (type==ST_HOURS || day->channelExists(code) || day->settingExists(code)) { // too many lookups happening here.. stop the crap..
|
||||||
m_days[dn]=day;
|
m_days[dn]=day;
|
||||||
switch(m_type[j]) {
|
switch(m_type[j]) {
|
||||||
case ST_AVG: tmp=day->avg(code); break;
|
case ST_AVG: tmp=day->avg(code); break;
|
||||||
@ -81,6 +81,11 @@ void SummaryChart::SetDay(Day * nullday)
|
|||||||
case ST_CPH: tmp=day->cph(code); break;
|
case ST_CPH: tmp=day->cph(code); break;
|
||||||
case ST_SPH: tmp=day->sph(code); break;
|
case ST_SPH: tmp=day->sph(code); break;
|
||||||
case ST_HOURS: tmp=day->hours(); break;
|
case ST_HOURS: tmp=day->hours(); break;
|
||||||
|
case ST_SETMIN: tmp=day->settings_min(code); break;
|
||||||
|
case ST_SETMAX: tmp=day->settings_max(code); break;
|
||||||
|
case ST_SETAVG: tmp=day->settings_avg(code); break;
|
||||||
|
case ST_SETWAVG: tmp=day->settings_wavg(code); break;
|
||||||
|
case ST_SETSUM: tmp=day->settings_sum(code); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
//if (tmp>0) {
|
//if (tmp>0) {
|
||||||
@ -426,6 +431,7 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
|
|||||||
} else
|
} else
|
||||||
val=QString::number(d.value()[0],'f',2);
|
val=QString::number(d.value()[0],'f',2);
|
||||||
z+="\r\n"+m_label+"="+val;
|
z+="\r\n"+m_label+"="+val;
|
||||||
|
//z+="\r\nMode="+QString::number(day->settings_min("FlexSet"),'f',0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
QString a;
|
QString a;
|
||||||
@ -442,7 +448,7 @@ bool SummaryChart::mouseMoveEvent(QMouseEvent *event)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (day && day->channelExists(m_codes[i])) {
|
if (day && (day->channelExists(m_codes[i]) || day->settingExists(m_codes[i]))) {
|
||||||
schema::Channel & chan=schema::channel[m_codes[i]];
|
schema::Channel & chan=schema::channel[m_codes[i]];
|
||||||
val=QString::number(d.value()[i+1],'f',2);
|
val=QString::number(d.value()[i+1],'f',2);
|
||||||
z+="\r\n"+chan.label()+" "+a+"="+val;
|
z+="\r\n"+chan.label()+" "+a+"="+val;
|
||||||
|
@ -332,9 +332,20 @@ int Day::count(ChannelID code)
|
|||||||
}
|
}
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
bool Day::settingExists(ChannelID id)
|
||||||
|
{
|
||||||
|
for (int j=0;j<sessions.size();j++) {
|
||||||
|
QHash<ChannelID,QVariant>::iterator i=sessions[j]->settings.find(id);
|
||||||
|
if (i!=sessions[j]->settings.end()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bool Day::channelExists(ChannelID id)
|
bool Day::channelExists(ChannelID id)
|
||||||
{
|
{
|
||||||
return machine->hasChannel(id);
|
if (machine->hasChannel(id)) return true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
bool Day::channelHasData(ChannelID id)
|
bool Day::channelHasData(ChannelID id)
|
||||||
{
|
{
|
||||||
|
@ -69,6 +69,8 @@ public:
|
|||||||
QVector<Session *> & getSessions() { return sessions; }
|
QVector<Session *> & getSessions() { return sessions; }
|
||||||
bool channelExists(ChannelID id);
|
bool channelExists(ChannelID id);
|
||||||
bool channelHasData(ChannelID id);
|
bool channelHasData(ChannelID id);
|
||||||
|
bool settingExists(ChannelID id);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QVector<Session *> sessions;
|
QVector<Session *> sessions;
|
||||||
qint64 d_first,d_last;
|
qint64 d_first,d_last;
|
||||||
|
@ -400,9 +400,7 @@ int ResmedLoader::Open(QString & path,Profile *profile)
|
|||||||
|
|
||||||
EDFSignal *sig;
|
EDFSignal *sig;
|
||||||
if (mode==0) {
|
if (mode==0) {
|
||||||
sess->settings["PAPMode"]=MODE_CPAP;
|
sess->settings[CPAP_Mode]=MODE_CPAP;
|
||||||
//m->registerChannel(CPAP_EPAP,false);
|
|
||||||
//m->registerChannel("IPAP",false);
|
|
||||||
sig=stredf.lookup["Set Pressure"];
|
sig=stredf.lookup["Set Pressure"];
|
||||||
EventDataType pressure=sig->data[dn]*sig->gain;
|
EventDataType pressure=sig->data[dn]*sig->gain;
|
||||||
sess->settings[CPAP_Pressure]=pressure;
|
sess->settings[CPAP_Pressure]=pressure;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
class Machine;
|
class Machine;
|
||||||
const quint32 magic=0xC73216AB;
|
const quint32 magic=0xC73216AB;
|
||||||
|
|
||||||
enum SummaryType { ST_CNT, ST_SUM, ST_AVG, ST_WAVG, ST_90P, ST_MIN, ST_MAX, ST_CPH, ST_SPH, ST_FIRST, ST_LAST, ST_HOURS };
|
enum SummaryType { ST_CNT, ST_SUM, ST_AVG, ST_WAVG, ST_90P, ST_MIN, ST_MAX, ST_CPH, ST_SPH, ST_FIRST, ST_LAST, ST_HOURS, ST_SETMIN, ST_SETAVG, ST_SETMAX, ST_SETWAVG, ST_SETSUM };
|
||||||
|
|
||||||
class Session
|
class Session
|
||||||
{
|
{
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
{{graph.Usage}}
|
{{graph.Usage}}
|
||||||
{{graph.Leaks}}
|
{{graph.Leaks}}
|
||||||
{{graph.Pressure}}
|
{{graph.Pressure}}
|
||||||
|
{{graph.Settings}}
|
||||||
{{graph.%PB}}
|
{{graph.%PB}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
14
overview.cpp
14
overview.cpp
@ -54,6 +54,7 @@ Overview::Overview(QWidget *parent,Profile * _profile,gGraphView * shared) :
|
|||||||
AHI=new gGraph(GraphView,"AHI",default_height,0);
|
AHI=new gGraph(GraphView,"AHI",default_height,0);
|
||||||
UC=new gGraph(GraphView,"Usage",default_height,0);
|
UC=new gGraph(GraphView,"Usage",default_height,0);
|
||||||
PR=new gGraph(GraphView,"Pressure",default_height,0);
|
PR=new gGraph(GraphView,"Pressure",default_height,0);
|
||||||
|
SET=new gGraph(GraphView,"Settings",default_height,0);
|
||||||
LK=new gGraph(GraphView,"Leaks",default_height,0);
|
LK=new gGraph(GraphView,"Leaks",default_height,0);
|
||||||
|
|
||||||
uc=new SummaryChart(profile,"Hours",GT_BAR);
|
uc=new SummaryChart(profile,"Hours",GT_BAR);
|
||||||
@ -78,6 +79,18 @@ Overview::Overview(QWidget *parent,Profile * _profile,gGraphView * shared) :
|
|||||||
AHI->AddLayer(bc);
|
AHI->AddLayer(bc);
|
||||||
AHI->AddLayer(new gXGrid());
|
AHI->AddLayer(new gXGrid());
|
||||||
|
|
||||||
|
set=new SummaryChart(profile,"",GT_LINE);
|
||||||
|
//set->addSlice("SysOneResistSet",QColor("grey"),ST_SETAVG);
|
||||||
|
set->addSlice("HumidSet",QColor("blue"),ST_SETAVG);
|
||||||
|
set->addSlice("FlexSet",QColor("red"),ST_SETAVG);
|
||||||
|
//set->addSlice("PAPMode",QColor("red"),ST_SETAVG);
|
||||||
|
SET->forceMaxY(6);
|
||||||
|
SET->AddLayer(new gYAxis(),LayerLeft,gYAxis::Margin);
|
||||||
|
gx=new gXAxis();
|
||||||
|
gx->setUtcFix(true);
|
||||||
|
SET->AddLayer(gx,LayerBottom,0,gXAxis::Margin);
|
||||||
|
SET->AddLayer(set);
|
||||||
|
SET->AddLayer(new gXGrid());
|
||||||
|
|
||||||
pr=new SummaryChart(profile,"cmH2O",GT_LINE);
|
pr=new SummaryChart(profile,"cmH2O",GT_LINE);
|
||||||
PR->forceMinY(4.0);
|
PR->forceMinY(4.0);
|
||||||
@ -132,6 +145,7 @@ Overview::Overview(QWidget *parent,Profile * _profile,gGraphView * shared) :
|
|||||||
ui->dateStart->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format);
|
ui->dateStart->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format);
|
||||||
ui->dateEnd->calendarWidget()->setWeekdayTextFormat(Qt::Saturday, format);
|
ui->dateEnd->calendarWidget()->setWeekdayTextFormat(Qt::Saturday, format);
|
||||||
ui->dateEnd->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format);
|
ui->dateEnd->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format);
|
||||||
|
|
||||||
connect(ui->dateStart->calendarWidget(),SIGNAL(currentPageChanged(int,int)),SLOT(on_dateStart_currentPageChanged(int,int)));
|
connect(ui->dateStart->calendarWidget(),SIGNAL(currentPageChanged(int,int)),SLOT(on_dateStart_currentPageChanged(int,int)));
|
||||||
connect(ui->dateEnd->calendarWidget(),SIGNAL(currentPageChanged(int,int)),SLOT(on_dateEnd_currentPageChanged(int,int)));
|
connect(ui->dateEnd->calendarWidget(),SIGNAL(currentPageChanged(int,int)),SLOT(on_dateEnd_currentPageChanged(int,int)));
|
||||||
report=NULL;
|
report=NULL;
|
||||||
|
@ -33,8 +33,8 @@ public:
|
|||||||
//void UpdateGraphs();
|
//void UpdateGraphs();
|
||||||
void ResetGraphLayout();
|
void ResetGraphLayout();
|
||||||
|
|
||||||
gGraph *AHI,*UC,*PR,*LK,*NPB;
|
gGraph *AHI,*UC,*PR,*LK,*NPB,*SET;
|
||||||
SummaryChart *bc,*uc,*pr,*lk,*npb;
|
SummaryChart *bc,*uc,*pr,*lk,*npb,*set;
|
||||||
public slots:
|
public slots:
|
||||||
void on_printButton_clicked();
|
void on_printButton_clicked();
|
||||||
|
|
||||||
|
@ -47,6 +47,9 @@ Report::Report(QWidget *parent, Profile * _profile, gGraphView * shared, Overvie
|
|||||||
graphs["%PB"]=NPB=new gGraph(GraphView,"% in PB",graph_print_height,0);
|
graphs["%PB"]=NPB=new gGraph(GraphView,"% in PB",graph_print_height,0);
|
||||||
NPB->AddLayer(m_overview->npb);
|
NPB->AddLayer(m_overview->npb);
|
||||||
|
|
||||||
|
graphs["Settings"]=SET=new gGraph(GraphView,"Settings",graph_print_height,0);
|
||||||
|
SET->AddLayer(m_overview->set);
|
||||||
|
|
||||||
|
|
||||||
for (QHash<QString,gGraph *>::iterator g=graphs.begin();g!=graphs.end();g++) {
|
for (QHash<QString,gGraph *>::iterator g=graphs.begin();g!=graphs.end();g++) {
|
||||||
gGraph *gr=g.value();
|
gGraph *gr=g.value();
|
||||||
|
4
report.h
4
report.h
@ -36,8 +36,8 @@ private:
|
|||||||
Overview * m_overview;
|
Overview * m_overview;
|
||||||
gGraphView * shared;
|
gGraphView * shared;
|
||||||
gGraphView * GraphView;
|
gGraphView * GraphView;
|
||||||
gGraph *AHI,*UC,*PR,*LK,*NPB;
|
gGraph *AHI,*UC,*PR,*LK,*NPB,*SET;
|
||||||
SummaryChart *bc,*uc,*pr,*lk,*npb;
|
SummaryChart *bc,*uc,*pr,*lk,*npb,*set;
|
||||||
QHash<QString,QVariant> locals;
|
QHash<QString,QVariant> locals;
|
||||||
QHash<QString,gGraph *> graphs;
|
QHash<QString,gGraph *> graphs;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user