diff --git a/Graphs/gFlagsLine.cpp b/Graphs/gFlagsLine.cpp index f88a0012..d9b345a0 100644 --- a/Graphs/gFlagsLine.cpp +++ b/Graphs/gFlagsLine.cpp @@ -50,13 +50,11 @@ void gFlagsGroup::SetDay(Day * d) bool e=f->isEmpty(); if (!e || f->isAlwaysVisible()) { lvisible.push_back(f); - if (!e) cnt++; + //if (!e) + cnt++; } } - if (cnt==0) - m_empty=true; - else m_empty=false; - //if (lvisible.size()==0) m_empty=false; + m_empty=(cnt==0); m_barh=0; } diff --git a/mainwindow.cpp b/mainwindow.cpp index 8d16389c..369c75c9 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -420,7 +420,7 @@ EventDataType calcAHI(QDate start, QDate end) struct RXChange { - RXChange() { highlight=0; } + RXChange() { highlight=0; machine=NULL; } RXChange(const RXChange & copy) { first=copy.first; last=copy.last; @@ -839,6 +839,7 @@ void MainWindow::on_summaryButton_clicked() prelief=(PRTypes)round(day->settings_wavg(CPAP_PresReliefType)); prelset=round(day->settings_wavg(CPAP_PresReliefSet)); mode=(CPAPMode)round(day->settings_wavg(CPAP_Mode)); + mach=day->machine; if (mode>=MODE_ASV) { min=day->settings_min(CPAP_EPAP); max=day->settings_max(CPAP_IPAPLo); @@ -852,11 +853,8 @@ void MainWindow::on_summaryButton_clicked() } else { min=day->settings_min(CPAP_Pressure); } - if ((mode!=cmode) || (min!=cmin) || (max!=cmax) || (maxhi!=cmaxhi) || (day->machine!=lastmach) || (prelief!=lastpr)) { - if (!lastmach) { // set early. - lastmach=day->machine; - } - if (cmode!=MODE_UNKNOWN) { + if ((mode!=cmode) || (min!=cmin) || (max!=cmax) || (maxhi!=cmaxhi) || (mach!=lastmach) || (prelief!=lastpr)) { + if ((cmode!=MODE_UNKNOWN) && (lastmach!=NULL)) { first=date.addDays(1); int days=PROFILE.countDays(MT_CPAP,first,last); RXChange rx; @@ -892,7 +890,7 @@ void MainWindow::on_summaryButton_clicked() lastpr=prelief; lastprelset=prelset; last=date; - lastmach=day->machine; + lastmach=mach; lastchanged=true; } @@ -901,7 +899,7 @@ void MainWindow::on_summaryButton_clicked() } while (date>=firstcpap); lastchanged=false; - if (!lastchanged) { + if (!lastchanged && (mach!=NULL)) { // last=date.addDays(1); first=firstcpap; int days=PROFILE.countDays(MT_CPAP,first,last); @@ -916,6 +914,7 @@ void MainWindow::on_summaryButton_clicked() rx.maxhi=maxhi; rx.prelief=prelief; rx.prelset=prelset; + rx.machine=mach; if (modecalcPercentile(CPAP_Pressure,0.9,MT_CPAP,first,last); rx.per2=0; @@ -1043,23 +1042,24 @@ void MainWindow::on_summaryButton_clicked() if (cpapmode>=MODE_ASV) { extratxt=QString("%1%2%3%4%5") - .arg(tr("EPAP")).arg(tr("IPAPLo")).arg(tr("IPAPHi")).arg(tr("%1% EPAP").arg(percentile*100.0)).arg(tr("%1% IPAP").arg(percentile*100.0)); + .arg(tr("EPAP")).arg(tr("IPAPLo")).arg(tr("IPAPHi")).arg(tr("PS Min")).arg(tr("PS Max")); } else if (cpapmode>=MODE_BIPAP) { - extratxt=QString("%1%2%3%4") - .arg(tr("EPAP")).arg(tr("IPAP")).arg(tr("%1% EPAP").arg(percentile*100.0)).arg(tr("%1% IPAP").arg(percentile*100.0)); - } else if (cpapmode>MODE_CPAP) { extratxt=QString("%1%2%3") - .arg(tr("Min Pressure")).arg(tr("Max Pressure")).arg(tr("%1% Pressure").arg(percentile*100.0)); + .arg(tr("EPAP")).arg(tr("IPAP")).arg(tr("PS")); + } else if (cpapmode>MODE_CPAP) { + extratxt=QString("%1%2") + .arg(tr("Min Pres.")).arg(tr("Max Pres.")); } else { extratxt=QString("%1") .arg(tr("Pressure")); } QString tooltip; - html+=QString("%1%2%3%4%5%6%7") + html+=QString("%1%2%3%4%5%6%7%8") .arg(tr("First")) .arg(tr("Last")) .arg(tr("Days")) .arg(ahitxt) + .arg(tr("Machine")) .arg(tr("Mode")) .arg(tr("Pr. Rel.")) .arg(extratxt); @@ -1082,35 +1082,43 @@ void MainWindow::on_summaryButton_clicked() if (rx.machine->properties.contains(STR_PROP_Model)) { machstr+=" "+rx.machine->properties[STR_PROP_Model]; } + if (rx.machine->properties.contains(STR_PROP_Serial)) { + machstr+=" ("+rx.machine->properties[STR_PROP_Serial]+")
"; + } - if(cpapmode>=MODE_ASV) { + mode=rx.mode; + if(mode>=MODE_ASV) { extratxt=QString("%1%2%3%4") - .arg(rx.max,0,'f',2).arg(rx.maxhi,0,'f',2).arg(rx.per1,0,'f',2).arg(rx.per2,0,'f',2); - tooltip=tr("%5 %1% EPAP=%2 %3% IPAP %4") + .arg(rx.max,0,'f',2).arg(rx.maxhi,0,'f',2).arg(rx.max-rx.min,0,'f',2).arg(rx.maxhi-rx.min,0,'f',2); + + tooltip=tr("%5 %1% EPAP=%2
%3% IPAP=%4") .arg(percentile*100.0) .arg(rx.per1,0,'f',2) .arg(percentile*100.0) .arg(rx.per2,0,'f',2) .arg(machstr) ; - } else if (cpapmode>=MODE_BIPAP) { - extratxt=QString("%1%2%3").arg(rx.max,0,'f',2).arg(rx.per1,0,'f',2).arg(rx.per2,0,'f',2); - tooltip=tr("%5 %1% EPAP=%2 %3% IPAP %4") + } else if (mode>=MODE_BIPAP) { + extratxt=QString("%1%2") + .arg(rx.max,0,'f',2).arg(rx.max-rx.min,0,'f',2); + tooltip=tr("%5 %1% EPAP=%2
%3% IPAP=%4") .arg(percentile*100.0) .arg(rx.per1,0,'f',2) .arg(percentile*100.0) .arg(rx.per2,0,'f',2) .arg(machstr) ; - } else if (cpapmode>MODE_CPAP) { - extratxt=QString("%1%2").arg(rx.max,0,'f',2).arg(rx.per1,0,'f',2); + } else if (mode>MODE_CPAP) { + extratxt=QString("%1").arg(rx.max,0,'f',2); tooltip=tr("%3 %1% Pressure=%2") .arg(percentile*100.0) .arg(rx.per1,0,'f',2) .arg(machstr) ; } else { - extratxt=""; + if (cpapmode>MODE_CPAP) { + extratxt=" "; + } else extratxt=""; tooltip=QString("%1") .arg(machstr) ; @@ -1120,13 +1128,14 @@ void MainWindow::on_summaryButton_clicked() presrel=schema::channel[CPAP_PresReliefType].option(int(rx.prelief)); presrel+=QString(" x%1").arg(rx.prelset); } else presrel="None"; - html+=QString("%3%4%5%6%7%8%9%10") + html+=QString("%3%4%5%6%7%8%9%10%11") .arg(rx.first.toString(Qt::ISODate)) .arg(rx.last.toString(Qt::ISODate)) .arg(rx.first.toString(Qt::SystemLocaleShortDate)) .arg(rx.last.toString(Qt::SystemLocaleShortDate)) .arg(rx.days) .arg(rx.ahi,0,'f',2) + .arg(rx.machine->GetClass()) .arg(schema::channel[CPAP_Mode].option(int(rx.mode)-1)) .arg(presrel) .arg(rx.min,0,'f',2)