mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
fixed hours() related hang
This commit is contained in:
parent
ba7ce7123d
commit
f0f6232c8a
@ -68,7 +68,9 @@ void gYAxis::Plot(gGraphWindow &w,float scrx,float scry)
|
||||
|
||||
glColor4ub(linecol1.red(),linecol1.green(),linecol1.blue(),linecol1.alpha());
|
||||
glLineWidth(1);
|
||||
|
||||
if (min_ytick>=1000000) {
|
||||
min_ytick=100;
|
||||
}
|
||||
|
||||
for (double i=miny+(min_ytick/2.0); i<maxy; i+=min_ytick) {
|
||||
ty=(i - miny) * ymult;
|
||||
|
@ -373,7 +373,12 @@ void HistoryData::ResetDateRange()
|
||||
}
|
||||
double HistoryData::Calc(Day *day)
|
||||
{
|
||||
return (day->summary_sum(CPAP_Obstructive) + day->summary_sum(CPAP_Hypopnea) + day->summary_sum(CPAP_ClearAirway)) / day->hours();
|
||||
double h=day->hours();
|
||||
double ahi=(day->summary_sum(CPAP_Obstructive) + day->summary_sum(CPAP_Hypopnea) + day->summary_sum(CPAP_ClearAirway)) / h;
|
||||
if (ahi>1000) {
|
||||
ahi=999;
|
||||
}
|
||||
return ahi;
|
||||
}
|
||||
|
||||
void HistoryData::Reload(Day *day)
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
qint64 last() { return d_last; };
|
||||
|
||||
qint64 total_time(); // in milliseconds
|
||||
float hours() { return total_time()/3600000.0; };
|
||||
double hours() { return double(total_time())/3600000.0; };
|
||||
|
||||
Session *operator [](int i) { return sessions[i]; };
|
||||
|
||||
|
@ -554,7 +554,7 @@ void Daily::Load(QDate date)
|
||||
QDateTime date=QDateTime::fromMSecsSinceEpoch(cpap->first());
|
||||
QDateTime date2=QDateTime::fromMSecsSinceEpoch(cpap->last());
|
||||
|
||||
html+="<tr><td align='center'>"+date.toString(Qt::SystemLocaleShortDate)+"</td><td align='center'>"+date.toString("HH:mm")+"</td><td align='center'>"+date2.toString("HH:mm")+"</td><td align='center'>"+a.sprintf("%02i:%02i",tt/3600,tt%60)+"</td></tr>\n";
|
||||
html+="<tr><td align='center'>"+date.date().toString(Qt::SystemLocaleShortDate)+"</td><td align='center'>"+date.toString("HH:mm")+"</td><td align='center'>"+date2.toString("HH:mm")+"</td><td align='center'>"+a.sprintf("%02i:%02i",tt/3600,tt%60)+"</td></tr>\n";
|
||||
html+="<tr><td colspan=4 align=center><hr></td></tr>\n";
|
||||
|
||||
QString cs;
|
||||
|
Loading…
Reference in New Issue
Block a user