mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-19 04:00:45 +00:00
Fix value display near session boundary with drift
This commit is contained in:
parent
ee0520b28e
commit
ac210e9068
@ -202,14 +202,12 @@ EventDataType Day::countInsideSpan(ChannelID span, ChannelID code)
|
|||||||
|
|
||||||
EventDataType Day::lookupValue(ChannelID code, qint64 time, bool square)
|
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) {
|
for (auto & sess : sessions) {
|
||||||
if (sess->enabled()) {
|
if (sess->enabled()) {
|
||||||
qint64 drift = (sess->type() == MT_CPAP?clockdrift:0);
|
// drift is handled by session first/last/SearchValue
|
||||||
if ((time-drift > sess->first()) && (time-drift < sess->last())) {
|
if ((time > sess->first()) && (time < sess->last())) {
|
||||||
if (sess->channelExists(code)) {
|
if (sess->channelExists(code)) {
|
||||||
return sess->SearchValue(code,time-drift,square);
|
return sess->SearchValue(code,time,square);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user