Set module of timestamp to 1 minute instead of 5
This commit is contained in:
parent
04e103848c
commit
96bfb857f7
|
@ -222,7 +222,9 @@ class AutosensDataStoreObject : AutosensDataStore {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
val newBucketedData = ArrayList<InMemoryGlucoseValue>()
|
val newBucketedData = ArrayList<InMemoryGlucoseValue>()
|
||||||
var currentTime = bgReadings[0].timestamp - bgReadings[0].timestamp % T.mins(5).msecs()
|
|
||||||
|
// Round time to 1 minute, This sets timestamp a bit in the past, but not much longer that it is noticable
|
||||||
|
var currentTime = bgReadings[0].timestamp - bgReadings[0].timestamp % T.mins(1).msecs()
|
||||||
val adjustedTime = adjustToReferenceTime(currentTime)
|
val adjustedTime = adjustToReferenceTime(currentTime)
|
||||||
// after adjusting time may be newer. In this case use T-5min
|
// after adjusting time may be newer. In this case use T-5min
|
||||||
currentTime = if (adjustedTime > currentTime) adjustedTime - T.mins(5).msecs() else adjustedTime
|
currentTime = if (adjustedTime > currentTime) adjustedTime - T.mins(5).msecs() else adjustedTime
|
||||||
|
|
Loading…
Reference in a new issue