mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 19:50:45 +00:00
add debug code - trying to fix 'normal average' problem
This commit is contained in:
parent
552d1aef95
commit
e5bcb16b30
@ -1138,7 +1138,7 @@ void gAHIChart::preCalc()
|
|||||||
|
|
||||||
ahi_wavg = 0;
|
ahi_wavg = 0;
|
||||||
ahi_avg = 0;
|
ahi_avg = 0;
|
||||||
calc_cnt = 0;
|
total_days = 0;
|
||||||
total_hours = 0;
|
total_hours = 0;
|
||||||
min_ahi = 99999;
|
min_ahi = 99999;
|
||||||
max_ahi = -99999;
|
max_ahi = -99999;
|
||||||
@ -1187,13 +1187,15 @@ void gAHIChart::customCalc(Day *day, QVector<SummaryChartSlice> &list)
|
|||||||
ahi_wavg += ahi_cnt;
|
ahi_wavg += ahi_cnt;
|
||||||
ahi_avg += ahi_cnt;
|
ahi_avg += ahi_cnt;
|
||||||
total_hours += hours;
|
total_hours += hours;
|
||||||
calc_cnt++;
|
total_days++;
|
||||||
|
qDebug() << "Leaving gAHIChart::customCalc - ahi_avg: " << ahi_avg << " total_days: " << total_days ;
|
||||||
}
|
}
|
||||||
void gAHIChart::afterDraw(QPainter & /*painter */, gGraph &graph, QRect rect)
|
void gAHIChart::afterDraw(QPainter & /*painter */, gGraph &graph, QRect rect)
|
||||||
{
|
{
|
||||||
if (totaldays == nousedays) return;
|
if (totaldays == nousedays) return;
|
||||||
|
|
||||||
//int size = idx_end - idx_start;
|
//int size = idx_end - idx_start;
|
||||||
|
qDebug() << "Entering gAHIChart::afterDraw - ahi_avg: " << ahi_avg << " total_days: " << total_days ;
|
||||||
|
|
||||||
bool skip = true;
|
bool skip = true;
|
||||||
float med = 0;
|
float med = 0;
|
||||||
@ -1211,8 +1213,8 @@ void gAHIChart::afterDraw(QPainter & /*painter */, gGraph &graph, QRect rect)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: // avg
|
case 2: // avg
|
||||||
if (calc_cnt > 0) {
|
if (total_days > 0) {
|
||||||
med = ahi_avg / calc_cnt;
|
med = ahi_avg / total_days;
|
||||||
skip = false;
|
skip = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -412,7 +412,7 @@ public:
|
|||||||
// layer->total_hours = total_hours;
|
// layer->total_hours = total_hours;
|
||||||
// layer->max_ahi = max_ahi;
|
// layer->max_ahi = max_ahi;
|
||||||
// layer->min_ahi = min_ahi;
|
// layer->min_ahi = min_ahi;
|
||||||
// layer->calc_cnt = calc_cnt;
|
// layer->total_days = total_days;
|
||||||
// layer->ahi_data = ahi_data;
|
// layer->ahi_data = ahi_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -424,7 +424,7 @@ public:
|
|||||||
float max_ahi;
|
float max_ahi;
|
||||||
float min_ahi;
|
float min_ahi;
|
||||||
|
|
||||||
int calc_cnt;
|
int total_days;
|
||||||
QList<float> ahi_data;
|
QList<float> ahi_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -150,9 +150,9 @@ QString Day::calcMiddleLabel(ChannelID code)
|
|||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
return QObject::tr("%1 %2").arg(STR_TR_Median).arg(schema::channel[code].label());
|
return QObject::tr("%1 %2").arg(STR_TR_Median).arg(schema::channel[code].label());
|
||||||
} else if (c == 1) {
|
} else if (c == 1) {
|
||||||
return QObject::tr("%1 %2").arg(STR_TR_Average).arg(schema::channel[code].label());
|
return QObject::tr("%1 %2").arg(STR_TR_WAvg).arg(schema::channel[code].label());
|
||||||
} else {
|
} else {
|
||||||
return QObject::tr("%1 %2").arg(STR_TR_Average).arg(schema::channel[code].label());
|
return QObject::tr("%1 %2").arg(STR_TR_Avg).arg(schema::channel[code].label());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QString Day::calcMaxLabel(ChannelID code)
|
QString Day::calcMaxLabel(ChannelID code)
|
||||||
|
Loading…
Reference in New Issue
Block a user