Correct leak rate computations on Welcome page

Welcome page was calculating current and 7-day averages using the "normal average" method,
which averaged just the non-zero readings, giving excessively high numbers.
Now computes using "weighted average" resulting in more meaningful numbers.
This commit is contained in:
Guy Scharf 2020-10-31 09:49:02 -07:00
parent 7aed374236
commit 678e0f9241

View File

@ -300,8 +300,8 @@ QString Welcome::GenerateCPAPHTML()
//EventDataType lat = day->timeAboveThreshold(CPAP_Leak, p_profile->cpap->leakRedline())/ 60.0; //EventDataType lat = day->timeAboveThreshold(CPAP_Leak, p_profile->cpap->leakRedline())/ 60.0;
//EventDataType leaks = 1.0/hours * lat; //EventDataType leaks = 1.0/hours * lat;
EventDataType leak = day->avg(CPAP_Leak); EventDataType leak = day->wavg(CPAP_Leak);
EventDataType leakdays = p_profile->calcAvg(CPAP_Leak, MT_CPAP, starttime, endtime); EventDataType leakdays = p_profile->calcWavg(CPAP_Leak, MT_CPAP, starttime, endtime);
if ((leak < leakdays) && ((leakdays - leak) >= 0.1)) { if ((leak < leakdays) && ((leakdays - leak) >= 0.1)) {
comp = under; comp = under;