diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java index 2f37f541a6..eee40443e2 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java @@ -265,11 +265,11 @@ public class DateTimeUtil { } - public static long getATDWithAddedMinutes(long atd, int minutesDiff) { + public static long getATDWithAddedSeconds(Long atd, int addedSeconds) { GregorianCalendar oldestEntryTime = DateTimeUtil.toGregorianCalendar(atd); - oldestEntryTime.add(Calendar.MINUTE, minutesDiff); + oldestEntryTime.add(Calendar.SECOND, addedSeconds); - return oldestEntryTime.getTimeInMillis(); + return toATechDate(oldestEntryTime.getTimeInMillis()); } @@ -279,7 +279,6 @@ public class DateTimeUtil { return toATechDate(oldestEntryTime); } - public static long getTimeInFutureFromMinutes(long startTime, int minutes) { return startTime + getTimeInMs(minutes); } diff --git a/medtronic/Changelog.txt b/medtronic/Changelog.txt new file mode 100644 index 0000000000..fc0b934b1c --- /dev/null +++ b/medtronic/Changelog.txt @@ -0,0 +1,11 @@ + +V1 - Medtronic initial implementation +... lots of changes + + +V2 - Rewrite into kotlin, new database (for v3.0) +0001 - initial version +0002 - some fixes +0003 - SMB fix (798) +0004 - Zero TBR Duration fix (798), refactoring of TempBasalProcessDTO +0005 - fixes to MedtronicHistoryEntry lateinit problem \ No newline at end of file diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index 7d60dfe90f..5b86577182 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -32,6 +32,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ResetRileyLinkConfigurationTask import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask +import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryTBR import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry @@ -111,7 +112,7 @@ class MedtronicPumpPlugin @Inject constructor( private var isBusy = false override fun onStart() { - aapsLogger.debug(LTag.PUMP, deviceID() + " started.") + aapsLogger.debug(LTag.PUMP, deviceID() + " started. (V2.0005)") serviceConnection = object : ServiceConnection { override fun onServiceDisconnected(name: ComponentName) { aapsLogger.debug(LTag.PUMP, "RileyLinkMedtronicService is disconnected") @@ -468,6 +469,7 @@ class MedtronicPumpPlugin @Inject constructor( } } + @Synchronized override fun isThisProfileSet(profile: Profile): Boolean { aapsLogger.debug(LTag.PUMP, "isThisProfileSet: basalInitalized=" + medtronicPumpStatus.basalProfileStatus) if (!isInitialized) return true @@ -580,6 +582,7 @@ class MedtronicPumpPlugin @Inject constructor( scheduleNextRefresh(MedtronicStatusRefreshType.PumpTime, 0) } + @Synchronized override fun deliverBolus(detailedBolusInfo: DetailedBolusInfo): PumpEnactResult { aapsLogger.info(LTag.PUMP, "MedtronicPumpPlugin::deliverBolus - " + BolusDeliveryType.DeliveryPrepared) setRefreshButtonEnabled(false) @@ -691,6 +694,7 @@ class MedtronicPumpPlugin @Inject constructor( // if enforceNew===true current temp basal is canceled and new TBR set (duration is prolonged), // if false and the same rate is requested enacted=false and success=true is returned and TBR is not changed + @Synchronized override fun setTempBasalAbsolute(absoluteRate: Double, durationInMinutes: Int, profile: Profile, enforceNew: Boolean, tbrType: TemporaryBasalType): PumpEnactResult { setRefreshButtonEnabled(false) if (isPumpNotReachable) { @@ -742,6 +746,7 @@ class MedtronicPumpPlugin @Inject constructor( return PumpEnactResult(injector).success(false).enacted(false) .comment(R.string.medtronic_cmd_cant_cancel_tbr_stop_op) } else { + //cancelTBRWithTemporaryId() aapsLogger.info(LTag.PUMP, logPrefix + "setTempBasalAbsolute - Current TBR cancelled.") } } @@ -760,8 +765,9 @@ class MedtronicPumpPlugin @Inject constructor( medtronicPumpStatus.tempBasalAmount = absoluteRate medtronicPumpStatus.tempBasalLength = durationInMinutes - val tempData = info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryTBR(absoluteRate, true, durationInMinutes, tbrType) + val tempData = PumpDbEntryTBR(absoluteRate, true, durationInMinutes, tbrType) + medtronicPumpStatus.runningTBRWithTemp = tempData pumpSyncStorage.addTemporaryBasalRateWithTempId(tempData, true, this) incrementStatistics(MedtronicConst.Statistics.TBRsSet) @@ -771,6 +777,63 @@ class MedtronicPumpPlugin @Inject constructor( } } + @Deprecated("Not used, TBRs fixed in history, should be removed.") + private fun cancelTBRWithTemporaryId() { + val tbrs : MutableList = pumpSyncStorage.getTBRs() + if (tbrs.size > 0 && medtronicPumpStatus.runningTBRWithTemp!=null) { + aapsLogger.info(LTag.PUMP, logPrefix + "cancelTBRWithTemporaryId - TBR items: ${tbrs.size}") + + var item : PumpDbEntryTBR? = null + + if (tbrs.size==1) { + item = tbrs.get(0); + } else { + for (tbr in tbrs) { + if (tbr.date == medtronicPumpStatus.runningTBRWithTemp!!.date) { + item = tbr + break; + } + } + } + + if (item!=null) { + + aapsLogger.debug(LTag.PUMP, "DD: cancelTBRWithTemporaryId: tempIdEntry=${item}") + + val differenceS = (System.currentTimeMillis() - item.date) / 1000 + + aapsLogger.debug(LTag.PUMP, "syncTemporaryBasalWithTempId " + + "[date=${item.date}, " + + "rate=${item.rate}, " + + "duration=${differenceS} s, " + + "isAbsolute=${!item.isAbsolute}, temporaryId=${item.temporaryId}, " + + "pumpId=NO, pumpType=${medtronicPumpStatus.pumpType}, " + + "pumpSerial=${medtronicPumpStatus.serialNumber}]") + + val result = pumpSync.syncTemporaryBasalWithTempId( + timestamp = item.date, + rate = item.rate, + duration= differenceS * 1000L, + isAbsolute = item.isAbsolute, + temporaryId = item.temporaryId, + type = item.tbrType, + pumpId = null, + pumpType = medtronicPumpStatus.pumpType, + pumpSerial = medtronicPumpStatus.serialNumber) + + aapsLogger.debug(LTag.PUMP, "syncTemporaryBasalWithTempId - Result: $result") + } + + } else { + aapsLogger.info(LTag.PUMP, logPrefix + "cancelTBRWithTemporaryId - TBR items: ${tbrs.size}, runningTBRWithTemp=${medtronicPumpStatus.runningTBRWithTemp}") + } + + if (medtronicPumpStatus.runningTBRWithTemp!=null) { + medtronicPumpStatus.runningTBRWithTemp = null + } + } + + @Synchronized override fun setTempBasalPercent(percent: Int, durationInMinutes: Int, profile: Profile, enforceNew: Boolean, tbrType: TemporaryBasalType): PumpEnactResult { return if (percent == 0) { setTempBasalAbsolute(0.0, durationInMinutes, profile, enforceNew, tbrType) @@ -966,6 +1029,7 @@ class MedtronicPumpPlugin @Inject constructor( } } + @Synchronized override fun cancelTempBasal(enforceNew: Boolean): PumpEnactResult { aapsLogger.info(LTag.PUMP, logPrefix + "cancelTempBasal - started") if (isPumpNotReachable) { @@ -1001,7 +1065,7 @@ class MedtronicPumpPlugin @Inject constructor( aapsLogger.info(LTag.PUMP, logPrefix + "cancelTempBasal - Cancel TBR successful.") val runningTBR = medtronicPumpStatus.runningTBR - + // TODO if (runningTBR != null) { if (medtronicHistoryData.isTBRActive(runningTBR)) { @@ -1026,6 +1090,8 @@ class MedtronicPumpPlugin @Inject constructor( } } + //cancelTBRWithTemporaryId() + PumpEnactResult(injector).success(true).enacted(true) // .isTempCancel(true) } @@ -1043,6 +1109,7 @@ class MedtronicPumpPlugin @Inject constructor( return medtronicPumpStatus.serialNumber } + @Synchronized override fun setNewBasalProfile(profile: Profile): PumpEnactResult { aapsLogger.info(LTag.PUMP, logPrefix + "setNewBasalProfile") diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt index dc38b62601..8776906d95 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt @@ -14,13 +14,13 @@ import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil */ abstract class MedtronicHistoryEntry : MedtronicHistoryEntryInterface { - lateinit var rawData: List + var rawData: List = listOf() protected var sizes = IntArray(3) - lateinit var head: ByteArray - lateinit var datetime: ByteArray - lateinit var body: ByteArray + var head: ByteArray = byteArrayOf() + var datetime: ByteArray = byteArrayOf() + var body: ByteArray = byteArrayOf() var id: Long = 0 @@ -41,7 +41,13 @@ abstract class MedtronicHistoryEntry : MedtronicHistoryEntryInterface { /** * Pump id that will be used with AAPS object (time * 1000 + historyType (max is FF = 255) */ - open var pumpId: Long = 0L + var pumpId: Long = 0L + get() { + if (field == 0L) { + field = generatePumpId() + } + return field + } /** * if history object is already linked to AAPS object (either Treatment, TempBasal or TDD (tdd's @@ -158,7 +164,7 @@ abstract class MedtronicHistoryEntry : MedtronicHistoryEntryInterface { sb.append("]") return sb.toString() } - if (head.size != 0) { + if (head!=null && head.size != 0) { sb.append(", head=") sb.append(ByteUtil.shortHexString(head)) } diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt index 0bc1e8106e..c16bf5c362 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt @@ -92,14 +92,6 @@ class PumpHistoryEntry : MedtronicHistoryEntry() { } } - override var pumpId: Long = 0L - get() { - if (field == 0L) { - field = generatePumpId() - } - return field - } - fun hasBolusChanged(entry: PumpHistoryEntry): Boolean { if (entryType == PumpHistoryEntryType.Bolus) { val thisOne: BolusDTO = this.decodedData["Object"] as BolusDTO diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index 4a23d5e222..edd3de2c35 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -508,25 +508,25 @@ class MedtronicHistoryData @Inject constructor( if (temporaryId != null) { val result = pumpSync.syncBolusWithTempId( - tryToGetByLocalTime(bolus.atechDateTime), - deliveredAmount, - temporaryId, - type, - bolus.pumpId, - medtronicPumpStatus.pumpType, - medtronicPumpStatus.serialNumber) + timestamp = tryToGetByLocalTime(bolus.atechDateTime), + amount = deliveredAmount, + temporaryId = temporaryId, + type = null, + pumpId = bolus.pumpId, + pumpType = medtronicPumpStatus.pumpType, + pumpSerial = medtronicPumpStatus.serialNumber) aapsLogger.debug(LTag.PUMP, String.format(Locale.ENGLISH, "syncBolusWithTempId [date=%d, temporaryId=%d, pumpId=%d, insulin=%.2f, pumpSerial=%s] - Result: %b", bolus.atechDateTime, temporaryId, bolus.pumpId, deliveredAmount, medtronicPumpStatus.serialNumber, result)) } else { val result = pumpSync.syncBolusWithPumpId( - tryToGetByLocalTime(bolus.atechDateTime), - deliveredAmount, - type, - bolus.pumpId, - medtronicPumpStatus.pumpType, - medtronicPumpStatus.serialNumber) + timestamp = tryToGetByLocalTime(bolus.atechDateTime), + amount = deliveredAmount, + type = null, + pumpId = bolus.pumpId, + pumpType = medtronicPumpStatus.pumpType, + pumpSerial = medtronicPumpStatus.serialNumber) aapsLogger.debug(LTag.PUMP, String.format(Locale.ENGLISH, "syncBolusWithPumpId [date=%d, pumpId=%d, insulin=%.2f, pumpSerial=%s] - Result: %b", bolus.atechDateTime, bolus.pumpId, deliveredAmount, @@ -571,62 +571,42 @@ class MedtronicHistoryData @Inject constructor( private fun processTBREntries(entryList: MutableList) { entryList.reverse() val tbr = entryList[0].getDecodedDataEntry("Object") as TempBasalPair - var readOldItem = false - if (tbr.isCancelTBR) { - val oneMoreEntryFromHistory = getOneMoreEntryFromHistory(PumpHistoryEntryType.TempBasalCombined) +// var readOldItem = false + + val oneMoreEntryFromHistory = getOneMoreEntryFromHistory(PumpHistoryEntryType.TempBasalCombined) + + if (tbr.isCancelTBR) { // if we have cancel we need to limit previous TBR with this cancel if (oneMoreEntryFromHistory != null) { entryList.add(0, oneMoreEntryFromHistory) - readOldItem = true } else { entryList.removeAt(0) } + } else { + if (oneMoreEntryFromHistory != null) { + val tbrPrev = oneMoreEntryFromHistory.getDecodedDataEntry("Object") as TempBasalPair + if (tbrPrev.isZeroTBR) { // if we had Zere TBR in last previous TBR, then we need to limit it, so we need to process it too + entryList.add(0, oneMoreEntryFromHistory) + } + } } val tbrRecords = pumpSyncStorage.getTBRs() - aapsLogger.debug(LTag.PUMP, String.format(Locale.ENGLISH, ProcessHistoryRecord.TBR.description + " List (before filter): %s, FromDb=%s", gson.toJson(entryList), - tbrRecords)) - var processDTO: TempBasalProcessDTO? = null - val processList: MutableList = mutableListOf() - for (treatment in entryList) { - val tbr2 = treatment.getDecodedDataEntry("Object") as TempBasalPair - if (tbr2.isCancelTBR) { - if (processDTO != null) { - processDTO.itemTwo = treatment - processDTO.cancelPresent = true - if (readOldItem) { - processDTO.processOperation = TempBasalProcessDTO.Operation.Edit - readOldItem = false - } - } else { - aapsLogger.warn(LTag.PUMP, "processDTO was null - shouldn't happen, ignoring item. ItemTwo=$treatment") - } - } else { - if (processDTO != null) { - processList.add(processDTO) - } - processDTO = TempBasalProcessDTO( - itemOne = treatment, - processOperation = TempBasalProcessDTO.Operation.Add, - aapsLogger = aapsLogger, - objectType = TempBasalProcessDTO.ObjectType.TemporaryBasal - ) - } - } - if (processDTO != null) { - processList.add(processDTO) - } + + val processList: MutableList = createTBRProcessList(entryList); + if (processList.isNotEmpty()) { for (tempBasalProcessDTO in processList) { - aapsLogger.debug(LTag.PUMP, "DD: tempBasalProcessDTO.itemOne: " + gson.toJson(tempBasalProcessDTO.itemOne)) - aapsLogger.debug(LTag.PUMP, "DD: tempBasalProcessDTO.itemTwo: " + (if (tempBasalProcessDTO.itemTwo == null) "null" else gson.toJson(tempBasalProcessDTO.itemTwo!!))) + aapsLogger.debug(LTag.PUMP, "DD: tempBasalProcessDTO: " + tempBasalProcessDTO.toTreatmentString()) + //aapsLogger.debug(LTag.PUMP, "DD: tempBasalProcessDTO.itemOne: " + gson.toJson(tempBasalProcessDTO.itemOne)) + //aapsLogger.debug(LTag.PUMP, "DD: tempBasalProcessDTO.itemTwo: " + (if (tempBasalProcessDTO.itemTwo == null) "null" else gson.toJson(tempBasalProcessDTO.itemTwo!!))) @Suppress("Unchecked_Cast") val entryWithTempId = findDbEntry(tempBasalProcessDTO.itemOne, tbrRecords as MutableList) as PumpDbEntryTBR? aapsLogger.debug(LTag.PUMP, "DD: entryWithTempId: " + (entryWithTempId?.toString() ?: "null")) - val tbrEntry = tempBasalProcessDTO.itemOneTbr //.getDecodedDataEntry("Object") as TempBasalPair + val tbrEntry = tempBasalProcessDTO.itemOneTbr aapsLogger.debug(LTag.PUMP, String.format("DD: tbrEntry=%s, tempBasalProcessDTO=%s", gson.toJson(tbrEntry), gson.toJson(tempBasalProcessDTO))) @@ -649,7 +629,7 @@ class MedtronicHistoryData @Inject constructor( tryToGetByLocalTime(tempBasalProcessDTO.atechDateTime), tbrEntry.insulinRate, tempBasalProcessDTO.durationAsSeconds * 1000L, - !tbrEntry.isPercent, + isAbsolute = !tbrEntry.isPercent, entryWithTempId.temporaryId, PumpSync.TemporaryBasalType.NORMAL, tempBasalProcessDTO.pumpId, @@ -705,10 +685,10 @@ class MedtronicHistoryData @Inject constructor( date = tryToGetByLocalTime(tempBasalProcessDTO.atechDateTime), pumpType = medtronicPumpStatus.pumpType, serialNumber = medtronicPumpStatus.serialNumber, - entry = PumpDbEntryTBR(rate = tbrEntry.insulinRate, - isAbsolute = !tbrEntry.isPercent, - durationInSeconds = tempBasalProcessDTO.durationAsSeconds, - tbrType = PumpSync.TemporaryBasalType.NORMAL), + rate = tbrEntry.insulinRate, + isAbsolute = !tbrEntry.isPercent, + durationInSeconds = tempBasalProcessDTO.durationAsSeconds, + tbrType = PumpSync.TemporaryBasalType.NORMAL, pumpId = tempBasalProcessDTO.pumpId) } } @@ -720,6 +700,56 @@ class MedtronicHistoryData @Inject constructor( } // collection } + fun createTBRProcessList(entryList: MutableList) : MutableList { + + aapsLogger.debug(LTag.PUMP, "${ProcessHistoryRecord.TBR.description} List (before filter): ${gson.toJson(entryList)}") + + var processDTO: TempBasalProcessDTO? = null + val processList: MutableList = mutableListOf() + for (treatment in entryList) { + val tbr2 = treatment.getDecodedDataEntry("Object") as TempBasalPair + if (tbr2.isCancelTBR) { + if (processDTO != null) { + processDTO.itemTwo = treatment + } else { + aapsLogger.warn(LTag.PUMP, "processDTO was null - shouldn't happen, ignoring item. ItemTwo=$treatment") + } + } else { + if (processDTO != null) { + processList.add(processDTO) + } + processDTO = TempBasalProcessDTO( + itemOne = treatment, + aapsLogger = aapsLogger, + objectType = TempBasalProcessDTO.ObjectType.TemporaryBasal + ) + } + } + if (processDTO != null) { + processList.add(processDTO) + } + + var previousItem: TempBasalProcessDTO? = null + + // fix for Zero TBRs + for (tempBasalProcessDTO in processList) { + if (previousItem!=null) { + + var pheEnd = PumpHistoryEntry() + pheEnd.atechDateTime = DateTimeUtil.getATDWithAddedSeconds(tempBasalProcessDTO.itemOne.atechDateTime, -2) + pheEnd.addDecodedData("Object", TempBasalPair(0.0, false, 0)) + + previousItem.itemTwo = pheEnd + + previousItem = null + } + if (tempBasalProcessDTO.itemOneTbr!!.isZeroTBR) { + previousItem = tempBasalProcessDTO + } + } + + return processList + } fun isTBRActive(dbEntry: PumpDbEntryTBR): Boolean { @@ -881,7 +911,6 @@ class MedtronicHistoryData @Inject constructor( while (i < filtered2Items.size) { val tbrProcess = TempBasalProcessDTO( itemOne = filtered2Items[i], - processOperation = TempBasalProcessDTO.Operation.Add, aapsLogger = aapsLogger, objectType = TempBasalProcessDTO.ObjectType.Suspend) @@ -959,7 +988,6 @@ class MedtronicHistoryData @Inject constructor( if (items.size > 0) { val tbrProcess = TempBasalProcessDTO( itemOne = items[items.size - 1], - processOperation = TempBasalProcessDTO.Operation.Add, aapsLogger = aapsLogger, objectType = TempBasalProcessDTO.ObjectType.Suspend) @@ -975,7 +1003,6 @@ class MedtronicHistoryData @Inject constructor( if (items.size > 0) { val tbrProcess = TempBasalProcessDTO( itemOne = items[0], - processOperation = TempBasalProcessDTO.Operation.Add, aapsLogger = aapsLogger, objectType = TempBasalProcessDTO.ObjectType.Suspend) diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt index fcc7e71996..3c48934552 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt @@ -91,6 +91,9 @@ class TempBasalPair : TempBasalPair { val isCancelTBR: Boolean get() = MedtronicUtil.isSame(insulinRate, 0.0) && durationMinutes == 0 + val isZeroTBR: Boolean + get() = MedtronicUtil.isSame(insulinRate, 0.0) && durationMinutes != 0 + val description: String get() { if (isCancelTBR) { diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt index a0ce5241de..b4b3b6cefb 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt @@ -4,9 +4,9 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry +import java.lang.StringBuilder class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, - var processOperation: Operation = Operation.None, var aapsLogger: AAPSLogger, var objectType: ObjectType = ObjectType.TemporaryBasal) { @@ -21,8 +21,6 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, var itemOneTbr: TempBasalPair? = null var itemTwoTbr: TempBasalPair? = null - var cancelPresent: Boolean = false - val atechDateTime: Long get() = itemOne.atechDateTime @@ -31,26 +29,26 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, val durationAsSeconds: Int get() { - aapsLogger.debug(LTag.PUMP, "durationAsSeconds: [objectType=$objectType]") + //aapsLogger.debug(LTag.PUMP, "durationAsSeconds: [objectType=$objectType]") if (objectType == ObjectType.TemporaryBasal) { if (itemTwo == null) { if (itemOneTbr != null) { - aapsLogger.debug("TemporaryBasalPair - itemOneSingle: $itemOneTbr") + //aapsLogger.debug("TemporaryBasalPair - itemOneSingle: $itemOneTbr") return itemOneTbr!!.durationMinutes * 60 } else { - aapsLogger.error("Couldn't find TempBasalPair in entry: $itemOne") + //aapsLogger.error("Couldn't find TempBasalPair in entry: $itemOne") return 0 } } else { - aapsLogger.debug(LTag.PUMP, "Found 2 items for duration: itemOne=$itemOne, itemTwo=$itemTwo") + //aapsLogger.debug(LTag.PUMP, "Found 2 items for duration: itemOne=$itemOne, itemTwo=$itemTwo") val secondsDiff = DateTimeUtil.getATechDateDiferenceAsSeconds(itemOne.atechDateTime, itemTwo!!.atechDateTime) - aapsLogger.debug(LTag.PUMP, "Difference in seconds: $secondsDiff") + //aapsLogger.debug(LTag.PUMP, "Difference in seconds: $secondsDiff") return secondsDiff } } else { - aapsLogger.debug(LTag.PUMP, "Found 2 items for duration (in SuspendMode): itemOne=$itemOne, itemTwo=$itemTwo") + //aapsLogger.debug(LTag.PUMP, "Found 2 items for duration (in SuspendMode): itemOne=$itemOne, itemTwo=$itemTwo") val secondsDiff = DateTimeUtil.getATechDateDiferenceAsSeconds(itemOne.atechDateTime, itemTwo!!.atechDateTime) - aapsLogger.debug(LTag.PUMP, "Difference in seconds: $secondsDiff") + //aapsLogger.debug(LTag.PUMP, "Difference in seconds: $secondsDiff") return secondsDiff } } @@ -61,8 +59,31 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, } } + fun toTreatmentString(): String { + val stringBuilder = StringBuilder() + + stringBuilder.append(itemOne.DT) + + if (itemTwo!=null) { + stringBuilder.append(" - ") + stringBuilder.append(itemTwo!!.DT) + } + + var dur = durationAsSeconds + + stringBuilder.append(" " + durationAsSeconds + " s (" + durationAsSeconds/60 + ")") + + if (itemTwoTbr!=null) { + stringBuilder.append(" " + itemOneTbr!!.insulinRate + " / " + itemTwoTbr!!.insulinRate) + } else { + stringBuilder.append(" " + itemOneTbr!!.insulinRate) + } + + return stringBuilder.toString() + } + override fun toString(): String { - return "ItemOne: $itemOne, ItemTwo: $itemTwo, Duration: $durationAsSeconds, Operation: $processOperation, ObjectType: $objectType" + return "ItemOne: $itemOne, ItemTwo: $itemTwo, Duration: $durationAsSeconds, ObjectType: $objectType" } enum class Operation { diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt index 05da8df050..0351a4c391 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt @@ -34,6 +34,7 @@ class MedtronicPumpStatus @Inject constructor(private val rh: ResourceHelper, var maxBolus: Double? = null var maxBasal: Double? = null var runningTBR: PumpDbEntryTBR? = null + var runningTBRWithTemp: PumpDbEntryTBR? = null // statuses var pumpDeviceState = PumpDeviceState.NeverContacted diff --git a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt new file mode 100644 index 0000000000..4f9fef20c1 --- /dev/null +++ b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt @@ -0,0 +1,91 @@ +package info.nightscout.androidaps.plugins.pump.medtronic.data + +import java.lang.reflect.Type +import com.google.gson.reflect.TypeToken +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import com.google.gson.internal.LinkedTreeMap +import dagger.android.AndroidInjector +import dagger.android.HasAndroidInjector +import info.nightscout.androidaps.TestBase +import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.androidaps.logging.AAPSLogger +import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry +import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalPair +import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus +import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.androidaps.utils.sharedPreferences.SP +import org.hamcrest.Matchers.notNullValue +import org.junit.Assert.* + +import org.junit.Test +import org.mockito.Mock +import java.io.File +import java.net.URL + +class MedtronicHistoryDataUTest : TestBase() { + + @Mock lateinit var activePlugin: ActivePlugin + @Mock lateinit var medtronicUtil: MedtronicUtil + @Mock lateinit var medtronicPumpHistoryDecoder: MedtronicPumpHistoryDecoder + @Mock lateinit var medtronicPumpStatus: MedtronicPumpStatus + @Mock lateinit var pumpSync: PumpSync + @Mock lateinit var pumpSyncStorage: PumpSyncStorage + @Mock lateinit var sp: SP + + + private val packetInjector = HasAndroidInjector { + AndroidInjector { + + } + } + + + + @Test + fun createTBRProcessList() { + + var unitToTest = MedtronicHistoryData(packetInjector, aapsLogger, sp, activePlugin, + medtronicUtil, medtronicPumpHistoryDecoder, + medtronicPumpStatus, + pumpSync, + pumpSyncStorage) + + + val gson = Gson() + + val fileText = ClassLoader.getSystemResource("tbr_data.json").readText() + + val listType: Type = object : TypeToken?>() {}.getType() + val yourClassList: MutableList = gson.fromJson(fileText, listType) + + for (pumpHistoryEntry in yourClassList) { + val stringObject = pumpHistoryEntry.decodedData["Object"] as LinkedTreeMap + + val rate : Double = stringObject.get("insulinRate") as Double + val durationMinutes: Double = stringObject.get("durationMinutes") as Double + val durationMinutesInt : Int = durationMinutes.toInt() + + var tmbPair = TempBasalPair(rate, false, durationMinutesInt) + + pumpHistoryEntry.decodedData.remove("Object") + pumpHistoryEntry.addDecodedData("Object", tmbPair) + } + + System.out.println("TBR Pre-Process List: " + gson.toJson(yourClassList)) + + val createTBRProcessList = unitToTest.createTBRProcessList(yourClassList) + + System.out.println("TBR Process List: " + createTBRProcessList.size) + + for (tempBasalProcessDTO in createTBRProcessList) { + System.out.println(tempBasalProcessDTO.toTreatmentString()) + } + + } + + +} \ No newline at end of file diff --git a/medtronic/src/test/resources/tbr_data.json b/medtronic/src/test/resources/tbr_data.json new file mode 100644 index 0000000000..7e2aa44b84 --- /dev/null +++ b/medtronic/src/test/resources/tbr_data.json @@ -0,0 +1,1761 @@ +[{ + "entryType": "TempBasalCombined", + "DT": "31.10.2021 01:35:08", + "atechDateTime": 20211031013508, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 01:39:47", + "atechDateTime": 20211031013947, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 01:39:49", + "atechDateTime": 20211031013949, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.1500000000000001, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 01:49:41", + "atechDateTime": 20211031014941, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 01:49:43", + "atechDateTime": 20211031014943, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.8, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 01:54:59", + "atechDateTime": 20211031015459, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 01:55:05", + "atechDateTime": 20211031015505, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 01:59:43", + "atechDateTime": 20211031015943, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:04:45", + "atechDateTime": 20211031020445, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.55, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:09:47", + "atechDateTime": 20211031020947, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:09:48", + "atechDateTime": 20211031020948, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.35000000000000003, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:14:56", + "atechDateTime": 20211031021456, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:14:57", + "atechDateTime": 20211031021457, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.3000000000000003, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:25:16", + "atechDateTime": 20211031022516, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:25:18", + "atechDateTime": 20211031022518, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.85, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:29:50", + "atechDateTime": 20211031022950, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:29:51", + "atechDateTime": 20211031022951, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.25, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:34:45", + "atechDateTime": 20211031023445, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:34:47", + "atechDateTime": 20211031023447, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.0500000000000003, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:45:16", + "atechDateTime": 20211031024516, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:45:18", + "atechDateTime": 20211031024518, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.75, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:50:16", + "atechDateTime": 20211031025016, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:50:18", + "atechDateTime": 20211031025018, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:54:45", + "atechDateTime": 20211031025445, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:54:46", + "atechDateTime": 20211031025446, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.75, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 02:59:47", + "atechDateTime": 20211031025947, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:05:16", + "atechDateTime": 20211031030516, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.85, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:10:07", + "atechDateTime": 20211031031007, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:10:08", + "atechDateTime": 20211031031008, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.05, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:15:11", + "atechDateTime": 20211031031511, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:15:13", + "atechDateTime": 20211031031513, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:35:16", + "atechDateTime": 20211031033516, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:35:18", + "atechDateTime": 20211031033518, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 3.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:49:50", + "atechDateTime": 20211031034950, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:49:52", + "atechDateTime": 20211031034952, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.35000000000000003, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:55:07", + "atechDateTime": 20211031035507, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 03:55:08", + "atechDateTime": 20211031035508, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.9000000000000004, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:00:16", + "atechDateTime": 20211031040016, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:04:45", + "atechDateTime": 20211031040445, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.2, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:09:47", + "atechDateTime": 20211031040947, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:09:49", + "atechDateTime": 20211031040949, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:14:44", + "atechDateTime": 20211031041444, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.7000000000000002, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:24:42", + "atechDateTime": 20211031042442, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:24:43", + "atechDateTime": 20211031042443, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.05, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:30:16", + "atechDateTime": 20211031043016, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:30:18", + "atechDateTime": 20211031043018, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.2, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:34:45", + "atechDateTime": 20211031043445, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:34:47", + "atechDateTime": 20211031043447, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.35, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:44:43", + "atechDateTime": 20211031044443, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:44:44", + "atechDateTime": 20211031044444, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.85, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:49:41", + "atechDateTime": 20211031044941, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:49:43", + "atechDateTime": 20211031044943, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.35, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:54:44", + "atechDateTime": 20211031045444, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:54:45", + "atechDateTime": 20211031045445, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.8, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 04:59:51", + "atechDateTime": 20211031045951, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:04:44", + "atechDateTime": 20211031050444, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.35, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:09:46", + "atechDateTime": 20211031050946, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:09:47", + "atechDateTime": 20211031050947, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 3.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:15:16", + "atechDateTime": 20211031051516, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:15:18", + "atechDateTime": 20211031051518, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.5, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:20:07", + "atechDateTime": 20211031052007, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:20:08", + "atechDateTime": 20211031052008, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:34:44", + "atechDateTime": 20211031053444, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.6, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:39:46", + "atechDateTime": 20211031053946, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:39:47", + "atechDateTime": 20211031053947, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:49:48", + "atechDateTime": 20211031054948, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:49:49", + "atechDateTime": 20211031054949, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.4000000000000004, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 05:59:45", + "atechDateTime": 20211031055945, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:05:43", + "atechDateTime": 20211031060543, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:10:14", + "atechDateTime": 20211031061014, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:10:15", + "atechDateTime": 20211031061015, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.25, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:35:13", + "atechDateTime": 20211031063513, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:35:15", + "atechDateTime": 20211031063515, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.35, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:50:13", + "atechDateTime": 20211031065013, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:50:14", + "atechDateTime": 20211031065014, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.15000000000000002, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:51:08", + "atechDateTime": 20211031065108, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:51:10", + "atechDateTime": 20211031065110, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.9000000000000001, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:54:45", + "atechDateTime": 20211031065445, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 06:54:47", + "atechDateTime": 20211031065447, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:00:15", + "atechDateTime": 20211031070015, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:04:46", + "atechDateTime": 20211031070446, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.35, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:14:56", + "atechDateTime": 20211031071456, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:14:58", + "atechDateTime": 20211031071458, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.35000000000000003, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:19:53", + "atechDateTime": 20211031071953, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:19:55", + "atechDateTime": 20211031071955, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:25:20", + "atechDateTime": 20211031072520, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:25:22", + "atechDateTime": 20211031072522, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:39:46", + "atechDateTime": 20211031073946, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:44:44", + "atechDateTime": 20211031074444, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:44:46", + "atechDateTime": 20211031074446, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 3.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:55:14", + "atechDateTime": 20211031075514, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 07:55:16", + "atechDateTime": 20211031075516, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:00:17", + "atechDateTime": 20211031080017, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:04:46", + "atechDateTime": 20211031080446, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.1, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:14:48", + "atechDateTime": 20211031081448, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:14:50", + "atechDateTime": 20211031081450, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.55, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:29:46", + "atechDateTime": 20211031082946, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:29:48", + "atechDateTime": 20211031082948, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.4000000000000004, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:40:27", + "atechDateTime": 20211031084027, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:40:28", + "atechDateTime": 20211031084028, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.8, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:49:46", + "atechDateTime": 20211031084946, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:49:48", + "atechDateTime": 20211031084948, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.85, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:56:11", + "atechDateTime": 20211031085611, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:56:13", + "atechDateTime": 20211031085613, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.35, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 08:56:26", + "atechDateTime": 20211031085626, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:00:49", + "atechDateTime": 20211031090049, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 3.6, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:04:43", + "atechDateTime": 20211031090443, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:04:44", + "atechDateTime": 20211031090444, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:15:16", + "atechDateTime": 20211031091516, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:15:18", + "atechDateTime": 20211031091518, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.05, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:19:47", + "atechDateTime": 20211031091947, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:19:49", + "atechDateTime": 20211031091949, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.25, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:30:02", + "atechDateTime": 20211031093002, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:30:04", + "atechDateTime": 20211031093004, + "decodedData": { + "Object": { + "durationMinutes": 60, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:54:44", + "atechDateTime": 20211031095444, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.0500000000000003, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 09:59:51", + "atechDateTime": 20211031095951, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:05:22", + "atechDateTime": 20211031100522, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.8, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:09:45", + "atechDateTime": 20211031100945, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:09:47", + "atechDateTime": 20211031100947, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.2000000000000002, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:24:48", + "atechDateTime": 20211031102448, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:24:49", + "atechDateTime": 20211031102449, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.5, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:30:19", + "atechDateTime": 20211031103019, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:30:20", + "atechDateTime": 20211031103020, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.6000000000000001, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:35:16", + "atechDateTime": 20211031103516, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:35:17", + "atechDateTime": 20211031103517, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 3.4000000000000004, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:41:00", + "atechDateTime": 20211031104100, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:41:02", + "atechDateTime": 20211031104102, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 5.3500000000000005, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:49:48", + "atechDateTime": 20211031104948, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:49:49", + "atechDateTime": 20211031104949, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.2000000000000002, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 10:59:44", + "atechDateTime": 20211031105944, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:05:18", + "atechDateTime": 20211031110518, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.9000000000000001, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:10:34", + "atechDateTime": 20211031111034, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:10:35", + "atechDateTime": 20211031111035, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 1.4500000000000002, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:14:48", + "atechDateTime": 20211031111448, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:14:50", + "atechDateTime": 20211031111450, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:30:15", + "atechDateTime": 20211031113015, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.5, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:45:43", + "atechDateTime": 20211031114543, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:45:44", + "atechDateTime": 20211031114544, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.25, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:50:12", + "atechDateTime": 20211031115012, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:50:13", + "atechDateTime": 20211031115013, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.05, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:54:45", + "atechDateTime": 20211031115445, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:54:46", + "atechDateTime": 20211031115446, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.8000000000000003, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 11:59:49", + "atechDateTime": 20211031115949, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:04:47", + "atechDateTime": 20211031120447, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 3.25, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:14:46", + "atechDateTime": 20211031121446, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:14:48", + "atechDateTime": 20211031121448, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 3.5500000000000003, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:19:45", + "atechDateTime": 20211031121945, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:19:47", + "atechDateTime": 20211031121947, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.2, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:20:24", + "atechDateTime": 20211031122024, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:20:26", + "atechDateTime": 20211031122026, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.15, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:24:52", + "atechDateTime": 20211031122452, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:24:53", + "atechDateTime": 20211031122453, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 0.05, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:25:01", + "atechDateTime": 20211031122501, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:25:03", + "atechDateTime": 20211031122503, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.15, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:34:45", + "atechDateTime": 20211031123445, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:34:47", + "atechDateTime": 20211031123447, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 2.95, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:39:47", + "atechDateTime": 20211031123947, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:39:49", + "atechDateTime": 20211031123949, + "decodedData": { + "Object": { + "durationMinutes": 30, + "insulinRate": 3.6, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:41:18", + "atechDateTime": 20211031124118, + "decodedData": { + "Object": { + "durationMinutes": 0, + "insulinRate": 0.0, + "isPercent": false + } + } +}, { + "entryType": "TempBasalCombined", + "DT": "31.10.2021 12:41:19", + "atechDateTime": 20211031124119, + "decodedData": { + "Object": { + "durationMinutes": 60, + "insulinRate": 0.0, + "isPercent": false + } + } +}] diff --git a/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index daaec647ce..5960258c71 100644 --- a/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -323,6 +323,7 @@ abstract class PumpPluginAbstract protected constructor( return ret } + @Synchronized override fun deliverTreatment(detailedBolusInfo: DetailedBolusInfo): PumpEnactResult { return try { if (detailedBolusInfo.insulin == 0.0 && detailedBolusInfo.carbs == 0.0) {