From 678e0f9241c72bb38832b240e47e170ae1209bcc Mon Sep 17 00:00:00 2001 From: Guy Scharf Date: Sat, 31 Oct 2020 09:49:02 -0700 Subject: [PATCH] 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. --- oscar/welcome.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oscar/welcome.cpp b/oscar/welcome.cpp index 77f34e01..4afe85bb 100644 --- a/oscar/welcome.cpp +++ b/oscar/welcome.cpp @@ -300,8 +300,8 @@ QString Welcome::GenerateCPAPHTML() //EventDataType lat = day->timeAboveThreshold(CPAP_Leak, p_profile->cpap->leakRedline())/ 60.0; //EventDataType leaks = 1.0/hours * lat; - EventDataType leak = day->avg(CPAP_Leak); - EventDataType leakdays = p_profile->calcAvg(CPAP_Leak, MT_CPAP, starttime, endtime); + EventDataType leak = day->wavg(CPAP_Leak); + EventDataType leakdays = p_profile->calcWavg(CPAP_Leak, MT_CPAP, starttime, endtime); if ((leak < leakdays) && ((leakdays - leak) >= 0.1)) { comp = under;