More Channel Rework #2

This commit is contained in:
Mark Watkins 2011-09-18 01:29:46 +10:00
parent 7dadad63c2
commit b47572912e
4 changed files with 4 additions and 361 deletions

View File

@ -539,7 +539,7 @@ qint64 Session::last(ChannelID id)
m_lastchan[id]=max; m_lastchan[id]=max;
return max; return max;
} }
/*bool Session::channelExists(ChannelID id) bool Session::channelExists(ChannelID id)
{ {
if (s_events_loaded) { if (s_events_loaded) {
QHash<ChannelID,QVector<EventList *> >::iterator j=eventlist.find(id); QHash<ChannelID,QVector<EventList *> >::iterator j=eventlist.find(id);
@ -551,7 +551,7 @@ qint64 Session::last(ChannelID id)
return false; return false;
} }
return true; return true;
}*/ }
int Session::count(ChannelID id) int Session::count(ChannelID id)
{ {

View File

@ -118,7 +118,7 @@ public:
EventDataType percentile(ChannelID id,EventDataType percentile); EventDataType percentile(ChannelID id,EventDataType percentile);
bool channelExists(QString name) { return (schema::channel.names.contains(name));} bool channelExists(QString name);// { return (schema::channel.names.contains(name));}
bool IsLoneSession() { return s_lonesession; } bool IsLoneSession() { return s_lonesession; }
void SetLoneSession(bool b) { s_lonesession=b; } void SetLoneSession(bool b) { s_lonesession=b; }

357
daily.cpp
View File

@ -194,363 +194,6 @@ Daily::Daily(QWidget *parent,Profile * _profile,gGraphView * shared, MainWindow
ui->calendar->setWeekdayTextFormat(Qt::Sunday, format); ui->calendar->setWeekdayTextFormat(Qt::Sunday, format);
ui->tabWidget->setCurrentWidget(ui->details); ui->tabWidget->setCurrentWidget(ui->details);
/* scrollArea=new MyScrollArea(ui->graphMainArea,this);
=======
scrollArea=new MyScrollArea(ui->graphMainArea,this);
QPalette p;
p.setColor(QPalette::Window,Qt::white);
scrollArea->setPalette(p);
scrollArea->setBackgroundRole(QPalette::Window);
>>>>>>> 70c348c1e196c10bbd34b1ce73bce9dda7fdbd29
ui->graphLayout->addWidget(scrollArea,1);
ui->graphLayout->setSpacing(0);
ui->graphLayout->setMargin(0);
ui->graphLayout->setContentsMargins(0,0,0,0);
scrollArea->setWidgetResizable(true);
scrollArea->setAutoFillBackground(true);
GraphLayout=new QWidget(scrollArea);
GraphLayout->setAutoFillBackground(true);
GraphLayout->setPalette(p);
GraphLayout->setBackgroundRole(QPalette::Window);
scrollArea->setWidget(GraphLayout);
splitter=new QVBoxLayout(GraphLayout);
GraphLayout->setLayout(splitter);
splitter->setSpacing(0);
splitter->setMargin(0);
splitter->setContentsMargins(0,0,0,0);
//ui->splitter->layout();
//gSplitter(Qt::Vertical,ui->scrollArea);
//splitter->setStyleSheet("QSplitter::handle { background-color: 'light grey'; }");
//splitter->setHandleWidth(3);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
//ui->scrollArea->setWidget(splitter);
//this->connect(ui->scrollArea,
//ui->graphSizer->addWidget(splitter);
//scrollArea->setAutoFillBackground(false);
//splitter->setAutoFillBackground(false);
//splitter->setMinimumHeight(1600);
//splitter->setMinimumWidth(600);
QWidget * parental=GraphLayout;
SF=new gGraphWindow(parental,tr("Event Flags"),shared);
FRW=new gGraphWindow(parental,tr("Flow Rate"),SF);
PRD=new gGraphWindow(parental,tr("Pressure"),SF);
//EXPR=new gGraphWindow(parental,tr("Exp. Pressure"),SF);
THPR=new gGraphWindow(parental,tr("Therapy Pressure"),SF);
LEAK=new gGraphWindow(parental,tr("Leaks"),SF);
MP=new gGraphWindow(parental,tr("Mask Pressure"),SF);
SNORE=new gGraphWindow(parental,tr("Snore"),SF);
FLG=new gGraphWindow(parental,tr("Flow Limitation"),SF);
MV=new gGraphWindow(parental,tr("Minute Ventilation"),SF);
TV=new gGraphWindow(parental,tr("Tidal Volume"),SF);
RR=new gGraphWindow(parental,tr("Respiratory Rate"),SF);
PTB=new gGraphWindow(parental,tr("Patient Trig Breaths"),SF);
RE=new gGraphWindow(parental,tr("Respiratory Event"),SF);
IE=new gGraphWindow(parental,tr("I:E"),SF);
TI=new gGraphWindow(parental,tr("Ti"),SF);
TE=new gGraphWindow(parental,tr("Te"),SF);
//OF=new gGraphWindow(parental,tr("Oxi-Flags"),SF);
INTPULSE=new gGraphWindow(parental,tr("Pulse"),SF); // Integrated Pulse
INTSPO2=new gGraphWindow(parental,tr("SPO2"),SF); // Integrated Pulse
PULSE=new gGraphWindow(parental,tr("Pulse"),SF);
SPO2=new gGraphWindow(parental,tr("SPO2"),SF);
PLETHY=new gGraphWindow(parental,tr("Plethysomogram"),SF);
TAP=new gGraphWindow(NULL,"",(QGLWidget* )NULL);
TAP_EAP=new gGraphWindow(NULL,"",(QGLWidget* )NULL);
TAP_IAP=new gGraphWindow(NULL,"",(QGLWidget* )NULL);
G_AHI=new gGraphWindow(NULL,"",(QGLWidget* )NULL); */
/*QGLFormat fmt;
fmt.setDepth(false);
fmt.setDirectRendering(false);
fmt.setAlpha(true);
fmt.setDoubleBuffer(false);
fmt.setRgba(true);
//fmt.setDefaultFormat(fmt);
offscreen_context=new QGLContext(fmt); */
/*SF->SetLeftMargin(SF->GetLeftMargin()+gYAxis::Margin);
SF->SetBlockZoom(true);
SF->AddLayer(new gXAxis());
SF->setMinimumHeight(min_height);
fg=new gFlagsGroup();
fg->AddLayer((new gFlagsLine(CPAP_CSR,QColor("light green"),"CSR",false,FT_Span)));
fg->AddLayer((new gFlagsLine(CPAP_ClearAirway,QColor("purple"),"CA",true)));
fg->AddLayer((new gFlagsLine(CPAP_Obstructive,QColor("#40c0ff"),"OA",true)));
fg->AddLayer((new gFlagsLine(CPAP_Apnea,QColor("dark green"),"A")));
fg->AddLayer((new gFlagsLine(CPAP_Hypopnea,QColor("blue"),"H",true)));
fg->AddLayer((new gFlagsLine(CPAP_FlowLimit,QColor("black"),"FL")));
fg->AddLayer((new gFlagsLine(CPAP_RERA,QColor("gold"),"RE")));
fg->AddLayer((new gFlagsLine(CPAP_VSnore,QColor("red"),"VS")));
//fg->AddLayer(AddCPAP(new gFlagsLine(flags[8],QColor("dark green"),"U0E")));
//fg->AddLayer(AddCPAP(new gFlagsLine(flags[10],QColor("red"),"VS2"));
SF->AddLayer(AddCPAP(fg));
// SF Foobar must go last
SF->AddLayer(new gFooBar(10,QColor("orange"),QColor("dark grey"),true));
bool square=true;
PRD->AddLayer(new gXAxis());
PRD->AddLayer(new gYAxis());
PRD->AddLayer(AddCPAP(pressure=new gLineChart(CPAP_Pressure,QColor("dark green"),square)));
PRD->AddLayer(AddCPAP(epap=new gLineChart(CPAP_EPAP,Qt::blue,square)));
PRD->AddLayer(AddCPAP(ipap=new gLineChart(CPAP_IPAP,Qt::red,square)));
PRD->setMinimumHeight(min_height);
THPR->AddLayer(new gXAxis());
THPR->AddLayer(new gYAxis());
THPR->AddLayer(AddCPAP(new gLineChart(CPAP_TherapyPressure,QColor("dark green"),square)));
THPR->AddLayer(AddCPAP(new gLineChart(CPAP_ExpiratoryPressure,QColor("dark blue"),square)));
THPR->setMinimumHeight(min_height);
//EXPR->AddLayer(new gXAxis());
//EXPR->AddLayer(new gYAxis());
//EXPR->setMinimumHeight(min_height);
LEAK->AddLayer(new gXAxis());
LEAK->AddLayer(new gYAxis());
//LEAK->AddLayer(new gFooBar());
LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_Leak,QColor("purple"),true)));
LEAK->setMinimumHeight(min_height);
MP->AddLayer(new gYAxis());
MP->AddLayer(new gXAxis());
gLineChart *g=new gLineChart(CPAP_MaskPressure,Qt::blue,false);
AddCPAP(g);
g->ReportEmpty(true);
MP->AddLayer(g);
//MP->AddLayer(AddCPAP(new gLineChart(CPAP_EPAP,Qt::yellow,square)));
//MP->AddLayer(AddCPAP(new gLineChart(CPAP_IPAP,Qt::red,square)));
MP->setMinimumHeight(min_height);
//FRW->AddLayer(new gFooBar());
FRW->AddLayer(new gYAxis());
FRW->AddLayer(new gXAxis());
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_CSR,QColor("light green"),"CSR",FT_Span)));
g=new gLineChart(CPAP_FlowRate,Qt::black,false);
g->ReportEmpty(true);
AddCPAP(g);
FRW->AddLayer(g);
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_CSR,QColor("light green"),"CSR",FT_Span)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Hypopnea,QColor("blue"),"H")));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_PressurePulse,QColor("red"),"PR",FT_Dot)));
//FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Pressure,QColor("white"),"P",FT_Dot)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown0B,QColor("blue"),"0B",FT_Dot)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown10,QColor("orange"),"10",FT_Dot)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown0E,QColor("yellow"),"0E",FT_Dot)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_RERA,QColor("gold"),"RE")));
//FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Unknown0E,QColor("dark green"),"U0E")));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Apnea,QColor("dark green"),"A")));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_VSnore,QColor("red"),"VS")));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_FlowLimit,QColor("black"),"FL")));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Obstructive,QColor("#40c0ff"),"OA")));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_ClearAirway,QColor("purple"),"CA")));
FRW->setMinimumHeight(min_height);
SNORE->AddLayer(new gXAxis());
SNORE->AddLayer(new gYAxis());
SNORE->AddLayer(AddCPAP(new gLineChart(CPAP_Snore,Qt::black,true)));
SNORE->setMinimumHeight(min_height);
FLG->AddLayer(new gXAxis());
FLG->AddLayer(new gYAxis());
FLG->AddLayer(AddCPAP(new gLineChart(CPAP_FlowLimitGraph,Qt::black,true)));
FLG->setMinimumHeight(min_height);
MV->AddLayer(new gXAxis());
MV->AddLayer(new gYAxis());
MV->AddLayer(AddCPAP(new gLineChart(CPAP_MinuteVentilation,QColor(0x20,0x20,0x7f),true)));
MV->setMinimumHeight(min_height);
TV->AddLayer(new gXAxis());
TV->AddLayer(new gYAxis());
TV->AddLayer(AddCPAP(new gLineChart(CPAP_TidalVolume,QColor(0x7f,0x20,0x20),true)));
TV->setMinimumHeight(min_height);
RR->AddLayer(new gXAxis());
RR->AddLayer(new gYAxis());
RR->AddLayer(AddCPAP(new gLineChart(CPAP_RespiratoryRate,Qt::gray,true)));
RR->setMinimumHeight(min_height);
RE->AddLayer(new gXAxis());
RE->AddLayer(new gYAxis());
RE->AddLayer(AddCPAP(new gLineChart(CPAP_RespiratoryEvent,Qt::darkYellow,false)));
RE->setMinimumHeight(min_height);
IE->AddLayer(new gXAxis());
IE->AddLayer(new gYAxis());
IE->AddLayer(AddCPAP(new gLineChart(CPAP_IE,Qt::darkMagenta,false)));
IE->setMinimumHeight(min_height);
TE->AddLayer(new gXAxis());
TE->AddLayer(new gYAxis());
TE->AddLayer(AddCPAP(new gLineChart(CPAP_Te,Qt::darkBlue,false)));
TE->setMinimumHeight(min_height);
TI->AddLayer(new gXAxis());
TI->AddLayer(new gYAxis());
TI->AddLayer(AddCPAP(new gLineChart(CPAP_Ti,Qt::darkRed,false)));
TI->setMinimumHeight(min_height);
PTB->AddLayer(new gXAxis());
PTB->AddLayer(new gYAxis());
PTB->AddLayer(AddCPAP(new gLineChart(CPAP_PatientTriggeredBreaths,Qt::gray,true)));
PTB->setMinimumHeight(min_height);
INTPULSE->AddLayer(new gXAxis());
INTPULSE->AddLayer(new gYAxis());
INTPULSE->AddLayer(AddCPAP(new gLineChart(CPAP_Pulse,Qt::red,true)));
INTPULSE->setMinimumHeight(min_height);
INTSPO2->AddLayer(new gXAxis());
INTSPO2->AddLayer(new gYAxis());
INTSPO2->AddLayer(AddCPAP(new gLineChart(CPAP_SPO2,Qt::blue,true)));
INTSPO2->setMinimumHeight(min_height);
PLETHY->AddLayer(new gXAxis());
PLETHY->AddLayer(new gYAxis());
PLETHY->AddLayer(AddOXI(new gLineChart(OXI_Plethysomogram,Qt::darkCyan,true)));
PLETHY->setMinimumHeight(min_height);
PULSE->AddLayer(new gXAxis());
PULSE->AddLayer(new gYAxis());
PULSE->AddLayer(AddOXI(new gLineChart(OXI_Pulse,Qt::red,true)));
PULSE->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange,Qt::green,"PC",FT_Bar)));
PULSE->setMinimumHeight(min_height);
SPO2->AddLayer(new gXAxis());
SPO2->AddLayer(new gYAxis());
SPO2->AddLayer(AddOXI(new gLineChart(OXI_SPO2,Qt::blue,true)));
SPO2->AddLayer(AddOXI(new gLineOverlayBar(OXI_SPO2Drop,Qt::red,"SC",FT_Bar)));
SPO2->setMinimumHeight(min_height); */
/*fg=new gFlagsGroup();
fg->AddLayer(AddOXI(new gFlagsLine(OXI_PulseChange,QColor("orange"),"PUL",true)));
fg->AddLayer(AddOXI(new gFlagsLine(OXI_SPO2Change,QColor("gray"),"SP",true)));
OF->AddLayer(fg);
OF->AddLayer(new gFooBar(10,QColor("orange"),QColor("dark grey"),true));
OF->SetLeftMargin(SF->GetLeftMargin()+gYAxis::Margin);
OF->SetBlockZoom(true);
OF->AddLayer(new gXAxis());
OF->setMinimumHeight(min_height); */
// SPO2->AddLayer(new gFooBar());
// SPO2->setMinimumHeight(min_height);
// SPO2->LinkZoom(PULSE);
// PULSE->LinkZoom(SPO2);
// SPO2->hide();
// PULSE->hide();
/*gSegmentChart *seg;
TAP_EAP->SetMargins(0,0,0,0);
TAP_EAP->AddLayer(AddCPAP(seg=new gTAPGraph(CPAP_EPAP)));
TAP_EAP->hide();
TAP_EAP->SetGradientBackground(false);
TAP_IAP->SetMargins(0,0,0,0);
TAP_IAP->AddLayer(AddCPAP(seg=new gTAPGraph(CPAP_IPAP)));
TAP_IAP->hide();
TAP_IAP->SetGradientBackground(false);
TAP->SetMargins(0,0,0,0);
TAP->AddLayer(AddCPAP(seg=new gTAPGraph(CPAP_Pressure,GST_CandleStick)));
TAP->hide();
TAP->SetGradientBackground(false);
G_AHI->SetGradientBackground(false);
G_AHI->hide();
splitter->addWidget(NoData);
//int i=splitter->indexOf(NoData);
splitter->setStretchFactor(NoData,1);
gGraphWindow * graphs[]={SF,FRW,MP,RE,MV,TV,PTB,RR,IE,TE,TI,PRD,THPR,LEAK,FLG,SNORE,INTPULSE,INTSPO2};
int ss=sizeof(graphs)/sizeof(gGraphWindow *);
for (int i=0;i<ss;i++) {
AddGraph(graphs[i]);
//int j=splitter->indexOf(graphs[i]);
splitter->setStretchFactor(graphs[i],1);
//splitter->setAlignment(graphs[i],Qt::AlignTop);
for (int j=0;j<ss;j++) {
if (graphs[i]!=graphs[j]) {
graphs[i]->LinkZoom(graphs[j]);
}
}
}
//AddGraph(OF);
AddGraph(PULSE);
AddGraph(SPO2);
AddGraph(PLETHY);
//SPO2->LinkZoom(OF);
//PULSE->LinkZoom(OF);
SPO2->LinkZoom(PULSE);
SPO2->LinkZoom(PLETHY);
PULSE->LinkZoom(SPO2);
PULSE->LinkZoom(PLETHY);
PLETHY->LinkZoom(PULSE);
PLETHY->LinkZoom(SPO2);
//OF->LinkZoom(PULSE);
//OF->LinkZoom(SPO2);
// AddGraph(SPO2);
spacer=new gGraphWindow(scrollArea,"",SF);
spacer->setMinimumHeight(1);
spacer->setMaximumHeight(1);
splitter->addWidget(spacer);
//i=splitter->indexOf(spacer);
//splitter->setStretchFactor(i,1);
//i=splitter->indexOf(FRW);
//splitter->setStretchFactor(i,15);
//splitter->refresh();
//splitter->setChildrenCollapsible(false); // We set this per widget..
//splitter->setCollapsible(splitter->indexOf(SF),false);
//splitter->setStretchFactor(splitter->indexOf(SF),0);
//splitter_sizes=splitter->sizes();
//splitter->layout();
//splitter->update();
if (mainwin) {
show_graph_menu=mainwin->CreateMenu("Graphs");
show_graph_menu->clear();
for (int i=0;i<Graphs.size();i++) {
QAction * action=show_graph_menu->addAction(Graphs[i]->Title(),NULL,NULL,0);
action->setCheckable(true);
action->setChecked(true);
connect(action, SIGNAL(triggered()), this, SLOT(ShowHideGraphs()));
GraphAction.push_back(action);
}
} else show_graph_menu=NULL; */
} }
Daily::~Daily() Daily::~Daily()

View File

@ -36,7 +36,7 @@ One id code per item
<channel id="0x1109" class="data" name="I:E" details="Inspiratory:Expiratory" label="I:E" unit="ratio" color="dark red"/> <channel id="0x1109" class="data" name="I:E" details="Inspiratory:Expiratory" label="I:E" unit="ratio" color="dark red"/>
<channel id="0x110a" class="data" name="Te" details="Te" label="Te" unit="" color="dark green"/> <channel id="0x110a" class="data" name="Te" details="Te" label="Te" unit="" color="dark green"/>
<channel id="0x110b" class="data" name="Ti" details="Ti" label="Ti" unit="" color="dark blue"/> <channel id="0x110b" class="data" name="Ti" details="Ti" label="Ti" unit="" color="dark blue"/>
<channel id="0x110c" class="data" name="Pressure" details="Pressure" label="P" unit="cmH20" color="dark green"/> <channel id="0x110c" class="data" name="Pressure" details="Pressure" label="Pressure" unit="cmH20" color="dark green"/>
<channel id="0x110d" class="data" name="IPAP" details="Inspiratory Pressure" label="IPAP" unit="cmH20" color="orange"/> <channel id="0x110d" class="data" name="IPAP" details="Inspiratory Pressure" label="IPAP" unit="cmH20" color="orange"/>
<channel id="0x110e" class="data" name="EPAP" details="Expiratory Pressure" label="EPAP" unit="cmH20" color="light blue"/> <channel id="0x110e" class="data" name="EPAP" details="Expiratory Pressure" label="EPAP" unit="cmH20" color="light blue"/>
<channel id="0x110f" class="data" name="PS" details="Pressure Support" label="PS" unit="cmH20" color="dark blue"/> <channel id="0x110f" class="data" name="PS" details="Pressure Support" label="PS" unit="cmH20" color="dark blue"/>