From ac210e9068168fb231a7adb789b3fa53730721f2 Mon Sep 17 00:00:00 2001 From: kappa44 <6469032-kappa44@users.noreply.gitlab.com> Date: Wed, 20 Oct 2021 11:01:25 +1100 Subject: [PATCH] Fix value display near session boundary with drift --- oscar/SleepLib/day.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/oscar/SleepLib/day.cpp b/oscar/SleepLib/day.cpp index ab26cd48..51a8a8bb 100644 --- a/oscar/SleepLib/day.cpp +++ b/oscar/SleepLib/day.cpp @@ -202,14 +202,12 @@ EventDataType Day::countInsideSpan(ChannelID span, ChannelID code) EventDataType Day::lookupValue(ChannelID code, qint64 time, bool square) { - // Remove drift from CPAP graphs so we get the right value... - qint64 clockdrift = qint64(p_profile->cpap->clockDrift()) * 1000L; for (auto & sess : sessions) { if (sess->enabled()) { - qint64 drift = (sess->type() == MT_CPAP?clockdrift:0); - if ((time-drift > sess->first()) && (time-drift < sess->last())) { + // drift is handled by session first/last/SearchValue + if ((time > sess->first()) && (time < sess->last())) { if (sess->channelExists(code)) { - return sess->SearchValue(code,time-drift,square); + return sess->SearchValue(code,time,square); } } }