From 1eaa395972b343fbf71014672caaf7ef9b9a1d9a Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Thu, 3 Mar 2016 18:15:42 +1000 Subject: [PATCH] Don't have to run all the calcs calculating unintentional leaks the new way --- sleepyhead/SleepLib/calcs.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sleepyhead/SleepLib/calcs.cpp b/sleepyhead/SleepLib/calcs.cpp index 57ac1b5b..e4533fec 100644 --- a/sleepyhead/SleepLib/calcs.cpp +++ b/sleepyhead/SleepLib/calcs.cpp @@ -1502,6 +1502,7 @@ void zMaskProfile::updatePressureMin() } } +// Returns what the nominal leak SHOULD be at the given pressure EventDataType zMaskProfile::calcLeak(EventStoreType pressure) { @@ -1529,7 +1530,6 @@ EventDataType zMaskProfile::calcLeak(EventStoreType pressure) } else { leak = (pressure - minP) * (m_factor) + minL; } - // leak = (pressure/10.0 - 4.0) * 1.76 + 20.167; } // Generic Average of Masks from a SpreadSheet... will add two sliders to tweak this between the ranges later @@ -1542,6 +1542,13 @@ void zMaskProfile::updateProfile(Session *session) { scanPressure(session); scanLeaks(session); + + if (p_profile->cpap->customMaskProfile()) { + // new method doesn't require any of this, so bail here. + return; + } + + // Do it the old way updatePressureMin(); // PressureMin contains the baseline for each Pressure