Better summary only messages

This commit is contained in:
Mark Watkins 2014-07-13 14:39:26 +10:00
parent d0bb6414b6
commit c386d36355
4 changed files with 34 additions and 19 deletions

View File

@ -421,7 +421,7 @@ void initializeStrings()
STR_TR_Sessions = QObject::tr("Sessions"); STR_TR_Sessions = QObject::tr("Sessions");
STR_TR_PrRelief = QObject::tr("Pr. Relief"); // Pressure Relief STR_TR_PrRelief = QObject::tr("Pr. Relief"); // Pressure Relief
STR_TR_NoData = QObject::tr("No Data"); STR_TR_NoData = QObject::tr("No Data Available");
STR_TR_Bookmarks = QObject::tr("Bookmarks"); STR_TR_Bookmarks = QObject::tr("Bookmarks");
STR_TR_SleepyHead = QObject::tr("SleepyHead"); STR_TR_SleepyHead = QObject::tr("SleepyHead");

View File

@ -1345,7 +1345,6 @@ void Daily::Load(QDate date)
updateGraphCombo(); updateGraphCombo();
if (cpap) { if (cpap) {
float hours=cpap->hours(); float hours=cpap->hours();
if (GraphView->isEmpty() && (hours>0)) { if (GraphView->isEmpty() && (hours>0)) {
@ -2259,10 +2258,17 @@ void Daily::updateCube()
ui->toggleGraphs->setChecked(true); ui->toggleGraphs->setChecked(true);
ui->toggleGraphs->blockSignals(false); ui->toggleGraphs->blockSignals(false);
if (ui->graphCombo->count()>0) { if (ui->graphCombo->count() > 0) {
GraphView->setEmptyText(tr("No Graphs On!")); GraphView->setEmptyText(tr("No Graphs On!"));
} else { } else {
GraphView->setEmptyText(STR_TR_NoData); if (!p_profile->GetGoodDay(getDate(), MT_CPAP)
&& !p_profile->GetGoodDay(getDate(), MT_OXIMETER)
&& !p_profile->GetGoodDay(getDate(), MT_SLEEPSTAGE)
&& !p_profile->GetGoodDay(getDate(), MT_POSITION)) {
GraphView->setEmptyText(STR_TR_NoData);
} else {
GraphView->setEmptyText(tr("Summary Only :("));
}
} }
} else { } else {
ui->toggleGraphs->setArrowType(Qt::DownArrow); ui->toggleGraphs->setArrowType(Qt::DownArrow);
@ -2271,6 +2277,7 @@ void Daily::updateCube()
ui->toggleGraphs->setChecked(false); ui->toggleGraphs->setChecked(false);
ui->toggleGraphs->blockSignals(false); ui->toggleGraphs->blockSignals(false);
} }
} }

View File

@ -0,0 +1 @@
ghttp://mobile-phones.smh.com.au/MobilePhones?utm_source=Widget_Fairfax_SMH_CompareAndSave&utm_medium=Widget&utm_campaign=New_BYO_Phone_Prices

View File

@ -1317,47 +1317,54 @@ QString StatisticsRow::value(QDate start, QDate end)
} else { } else {
// //
ChannelID code=channel(); ChannelID code=channel();
EventDataType val = 0;
QString fmt = "%1";
if (code != NoChannel) { if (code != NoChannel) {
switch(calc) { switch(calc) {
case SC_AVG: case SC_AVG:
value = QString("%1").arg(p_profile->calcAvg(code, type, start, end), 0, 'f', decimals); val = p_profile->calcAvg(code, type, start, end);
break; break;
case SC_WAVG: case SC_WAVG:
value = QString("%1").arg(p_profile->calcWavg(code, type, start, end), 0, 'f', decimals); val = p_profile->calcWavg(code, type, start, end);
break; break;
case SC_MEDIAN: case SC_MEDIAN:
value = QString("%1").arg(p_profile->calcPercentile(code, 0.5F, type, start, end), 0, 'f', decimals); val = p_profile->calcPercentile(code, 0.5F, type, start, end);
break; break;
case SC_90P: case SC_90P:
value = QString("%1").arg(p_profile->calcPercentile(code, 0.9F, type, start, end), 0, 'f', decimals); val = p_profile->calcPercentile(code, 0.9F, type, start, end);
break; break;
case SC_MIN: case SC_MIN:
value = QString("%1").arg(p_profile->calcMin(code, type, start, end), 0, 'f', decimals); val = p_profile->calcMin(code, type, start, end);
break; break;
case SC_MAX: case SC_MAX:
value = QString("%1").arg(p_profile->calcMax(code, type, start, end), 0, 'f', decimals); val = p_profile->calcMax(code, type, start, end);
break; break;
case SC_CPH: case SC_CPH:
value = QString("%1").arg(p_profile->calcCount(code, type, start, end) val = p_profile->calcCount(code, type, start, end) / p_profile->calcHours(type, start, end);
/ p_profile->calcHours(type, start, end), 0, 'f', decimals);
break; break;
case SC_SPH: case SC_SPH:
value = QString("%1%").arg(100.0 / p_profile->calcHours(type, start, end) fmt += "%";
* p_profile->calcSum(code, type, start, end) val = 100.0 / p_profile->calcHours(type, start, end) * p_profile->calcSum(code, type, start, end) / 3600.0;
/ 3600.0, 0, 'f', decimals);
break; break;
case SC_ABOVE: case SC_ABOVE:
value = QString("%1%").arg(100.0 / p_profile->calcHours(type, start, end) fmt += "%";
* (p_profile->calcAboveThreshold(code, schema::channel[code].upperThreshold(), type, start, end) / 60.0), 0, 'f', decimals); val = 100.0 / p_profile->calcHours(type, start, end) * (p_profile->calcAboveThreshold(code, schema::channel[code].upperThreshold(), type, start, end) / 60.0);
break; break;
case SC_BELOW: case SC_BELOW:
value = QString("%1%").arg(100.0 / p_profile->calcHours(type, start, end) fmt += "%";
* (p_profile->calcBelowThreshold(code, schema::channel[code].lowerThreshold(), type, start, end) / 60.0), 0, 'f', decimals); val = 100.0 / p_profile->calcHours(type, start, end) * (p_profile->calcBelowThreshold(code, schema::channel[code].lowerThreshold(), type, start, end) / 60.0);
break; break;
default: default:
break; break;
}; };
} }
if ((val == std::numeric_limits<EventDataType>::min()) || (val == std::numeric_limits<EventDataType>::max())) {
value = "Err";
} else {
value = fmt.arg(val, 0, 'f', decimals);
}
} }
return value; return value;