fix recalculated bucketed data
This commit is contained in:
parent
9d99913282
commit
f790c06b27
1 changed files with 4 additions and 1 deletions
|
@ -237,7 +237,10 @@ class AutosensDataStore {
|
||||||
}
|
}
|
||||||
val newBucketedData = ArrayList<InMemoryGlucoseValue>()
|
val newBucketedData = ArrayList<InMemoryGlucoseValue>()
|
||||||
var currentTime = bgReadings[0].timestamp - bgReadings[0].timestamp % T.mins(5).msecs()
|
var currentTime = bgReadings[0].timestamp - bgReadings[0].timestamp % T.mins(5).msecs()
|
||||||
currentTime = adjustToReferenceTime(currentTime)
|
val adjustedTime = adjustToReferenceTime(currentTime)
|
||||||
|
// after adjusting time may be newer. In this case use T-5min
|
||||||
|
if (adjustedTime > currentTime) currentTime = adjustedTime - T.mins(5).msecs()
|
||||||
|
else currentTime = adjustedTime
|
||||||
aapsLogger.debug("Adjusted time " + dateUtil.dateAndTimeAndSecondsString(currentTime))
|
aapsLogger.debug("Adjusted time " + dateUtil.dateAndTimeAndSecondsString(currentTime))
|
||||||
//log.debug("First reading: " + new Date(currentTime).toLocaleString());
|
//log.debug("First reading: " + new Date(currentTime).toLocaleString());
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
Loading…
Reference in a new issue