Hide Oximetry data from Summary, when no oximetry data available

This commit is contained in:
Mark Watkins 2011-12-24 00:30:49 +10:00
parent 531ed3f97c
commit 77e92d4b16
2 changed files with 67 additions and 69 deletions

View File

@ -684,8 +684,6 @@ void Daily::Load(QDate date)
GraphView->setEmptyText(tr("Brick Machine :("));
isBrick=true;
} else {
}
mode=(CPAPMode)(int)cpap->settings_max(CPAP_Mode);

View File

@ -584,11 +584,10 @@ void MainWindow::on_summaryButton_clicked()
if (oximeters.size()>0) {
QDate lastoxi=p_profile->LastDay(MT_OXIMETER);
QDate firstoxi=p_profile->FirstDay(MT_OXIMETER);
html+=QString("<tr><td colspan=6><b>%1</b></td></tr>").arg(tr("Oximetry Summary"));
int days=PROFILE.countDays(MT_OXIMETER,firstcpap,lastcpap);
if (!days) {
html+=QString("<tr><td colspan=6><b>%1</b></td></tr>").arg(tr("No Oximetry data available."));
} else if (days==1) {
if (days>0) {
html+=QString("<tr><td colspan=6><b>%1</b></td></tr>").arg(tr("Oximetry Summary"));
if (days==1) {
html+=QString("<tr><td colspan=6>%1</td></tr>").arg(QString(tr("%1 day of Oximetry Data, on %2.")).arg(days).arg(firstoxi.toString(Qt::SystemLocaleShortDate)));
} else {
html+=QString("<tr><td colspan=6>%1</td></tr>").arg(QString(tr("%1 days of Oximetry Data, between %2 and %3")).arg(days).arg(firstoxi.toString(Qt::SystemLocaleShortDate)).arg(lastoxi.toString(Qt::SystemLocaleShortDate)));
@ -654,6 +653,7 @@ void MainWindow::on_summaryButton_clicked()
.arg(p_profile->calcMax(OXI_Pulse,MT_OXIMETER,oxi6month,lastoxi),0,'f',3)
.arg(p_profile->calcMax(OXI_Pulse,MT_OXIMETER,oxiyear,lastoxi),0,'f',3);
}
}
html+="</table>";
html+="</div>";