diff --git a/SleepLib/session.cpp b/SleepLib/session.cpp index 7d709bbb..05a1bffc 100644 --- a/SleepLib/session.cpp +++ b/SleepLib/session.cpp @@ -539,7 +539,7 @@ qint64 Session::last(ChannelID id) m_lastchan[id]=max; return max; } -/*bool Session::channelExists(ChannelID id) +bool Session::channelExists(ChannelID id) { if (s_events_loaded) { QHash >::iterator j=eventlist.find(id); @@ -551,7 +551,7 @@ qint64 Session::last(ChannelID id) return false; } return true; -}*/ +} int Session::count(ChannelID id) { diff --git a/SleepLib/session.h b/SleepLib/session.h index 9e389b7a..f81141e1 100644 --- a/SleepLib/session.h +++ b/SleepLib/session.h @@ -118,7 +118,7 @@ public: 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; } void SetLoneSession(bool b) { s_lonesession=b; } diff --git a/daily.cpp b/daily.cpp index c93d4789..504c8986 100644 --- a/daily.cpp +++ b/daily.cpp @@ -194,363 +194,6 @@ Daily::Daily(QWidget *parent,Profile * _profile,gGraphView * shared, MainWindow ui->calendar->setWeekdayTextFormat(Qt::Sunday, format); 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;iindexOf(graphs[i]); - splitter->setStretchFactor(graphs[i],1); - //splitter->setAlignment(graphs[i],Qt::AlignTop); - for (int j=0;jLinkZoom(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;iaddAction(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() diff --git a/docs/channels.xml b/docs/channels.xml index f5b0fede..83dc0b10 100644 --- a/docs/channels.xml +++ b/docs/channels.xml @@ -36,7 +36,7 @@ One id code per item - +