diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt index 1b6111e483..cc14666dac 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt @@ -90,9 +90,8 @@ interface PumpSync { **/ fun addBolusWithTempId(timestamp: Long, amount: Double, temporaryId: Long, type: DetailedBolusInfo.BolusType, pumpType: PumpType, pumpSerial: String): Boolean - /** - * Synchronization of boluses with temporary id (with + * Synchronization of boluses with temporary id * * Search for combination of temporaryId, PumpType, pumpSerial * @@ -111,12 +110,9 @@ interface PumpSync { * @param pumpId pump id from history * @param pumpType pump type like PumpType.ACCU_CHEK_COMBO * @param pumpSerial pump serial number - * @param ignoreBolusTypeOnUpdate bolusType won't be updated, if item already exists * @return true if record is successfully updated **/ - fun syncBolusWithTempId(timestamp: Long, amount: Double, temporaryId: Long, type: DetailedBolusInfo.BolusType?, pumpId: Long?, pumpType: PumpType, pumpSerial: String, ignoreBolusTypeOnUpdate : - Boolean = false): Boolean - + fun syncBolusWithTempId(timestamp: Long, amount: Double, temporaryId: Long, type: DetailedBolusInfo.BolusType?, pumpId: Long?, pumpType: PumpType, pumpSerial: String): Boolean /** * Synchronization of boluses @@ -127,8 +123,6 @@ interface PumpSync { * If exists, amount, type (if provided) and timestamp is updated * isValid field is preserved * - * NOTE: this method can be removed, when all drivers are in kotlin - * * @param timestamp timestamp of event from pump history * @param amount amount of insulin * @param type type of bolus (NORMAL, SMB, PRIME) @@ -139,29 +133,6 @@ interface PumpSync { **/ fun syncBolusWithPumpId(timestamp: Long, amount: Double, type: DetailedBolusInfo.BolusType?, pumpId: Long, pumpType: PumpType, pumpSerial: String): Boolean - - /** - * Synchronization of boluses (with bolusType ignore) - * - * Search for combination of pumpId, PumpType, pumpSerial - * - * If db record doesn't exist, new record is created. - * If exists, amount, type (if provided) and timestamp is updated - * isValid field is preserved - * - * @param timestamp timestamp of event from pump history - * @param amount amount of insulin - * @param type type of bolus (NORMAL, SMB, PRIME) - * @param pumpId pump id from history - * @param pumpType pump type like PumpType.ACCU_CHEK_COMBO - * @param pumpSerial pump serial number - * @param ignoreBolusTypeOnUpdate bolusType won't be updated, if item already exists - * @return true if new record is created - **/ - fun syncBolusWithPumpId(timestamp: Long, amount: Double, type: DetailedBolusInfo.BolusType?, pumpId: Long, pumpType: PumpType, pumpSerial: String, ignoreBolusTypeOnUpdate : - Boolean = false): Boolean - - /** * Synchronization of carbs * diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt index 444dc6338a..1a92af8ae6 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt @@ -137,8 +137,7 @@ class PumpSyncImplementation @Inject constructor( } } - override fun syncBolusWithTempId(timestamp: Long, amount: Double, temporaryId: Long, type: DetailedBolusInfo.BolusType?, pumpId: Long?, pumpType: PumpType, pumpSerial: String, ignoreBolusTypeOnUpdate : - Boolean): Boolean { + override fun syncBolusWithTempId(timestamp: Long, amount: Double, temporaryId: Long, type: DetailedBolusInfo.BolusType?, pumpId: Long?, pumpType: PumpType, pumpSerial: String): Boolean { if (!confirmActivePump(timestamp, pumpType, pumpSerial)) return false val bolus = Bolus( timestamp = timestamp, @@ -151,7 +150,7 @@ class PumpSyncImplementation @Inject constructor( pumpSerial = pumpSerial ) ) - repository.runTransactionForResult(SyncBolusWithTempIdTransaction(bolus, type?.toDBbBolusType(), ignoreBolusTypeOnUpdate)) + repository.runTransactionForResult(SyncBolusWithTempIdTransaction(bolus, type?.toDBbBolusType())) .doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving Bolus", it) } .blockingGet() .also { result -> @@ -161,19 +160,6 @@ class PumpSyncImplementation @Inject constructor( } override fun syncBolusWithPumpId(timestamp: Long, amount: Double, type: DetailedBolusInfo.BolusType?, pumpId: Long, pumpType: PumpType, pumpSerial: String): Boolean { - return syncBolusWithPumpId( - timestamp = timestamp, - amount = amount, - type = type, - pumpId = pumpId, - pumpType = pumpType, - pumpSerial = pumpSerial, - ignoreBolusTypeOnUpdate = false - ) - } - - override fun syncBolusWithPumpId(timestamp: Long, amount: Double, type: DetailedBolusInfo.BolusType?, pumpId: Long, pumpType: PumpType, pumpSerial: String, ignoreBolusTypeOnUpdate : - Boolean): Boolean { if (!confirmActivePump(timestamp, pumpType, pumpSerial)) return false val bolus = Bolus( timestamp = timestamp, @@ -185,7 +171,7 @@ class PumpSyncImplementation @Inject constructor( pumpSerial = pumpSerial ) ) - repository.runTransactionForResult(SyncPumpBolusTransaction(bolus, type?.toDBbBolusType(), ignoreBolusTypeOnUpdate)) + repository.runTransactionForResult(SyncPumpBolusTransaction(bolus, type?.toDBbBolusType())) .doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving Bolus", it) } .blockingGet() .also { result -> 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/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt index e3f9a02423..99449f5ce7 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt @@ -7,8 +7,7 @@ import info.nightscout.androidaps.database.entities.Bolus */ class SyncBolusWithTempIdTransaction( private val bolus: Bolus, - private val newType: Bolus.Type?, - private val ignoreBolusTypeOnUpdate: Boolean + private val newType: Bolus.Type? ) : Transaction() { override fun run(): TransactionResult { @@ -19,9 +18,7 @@ class SyncBolusWithTempIdTransaction( if (current != null) { current.timestamp = bolus.timestamp current.amount = bolus.amount - if (!ignoreBolusTypeOnUpdate) { - current.type = newType ?: current.type - } + current.type = newType ?: current.type current.interfaceIDs.pumpId = bolus.interfaceIDs.pumpId database.bolusDao.updateExistingEntry(current) result.updated.add(current) diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt index fb0fecda19..c7ff85ba21 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt @@ -7,8 +7,7 @@ import info.nightscout.androidaps.database.entities.Bolus */ class SyncPumpBolusTransaction( private val bolus: Bolus, - private val bolusType: Bolus.Type?, // extra parameter because field is not nullable in Bolus.class - private val ignoreBolusTypeOnUpdate: Boolean + private val bolusType: Bolus.Type? // extra parameter because field is not nullable in Bolus.class ) : Transaction() { override fun run(): TransactionResult { @@ -20,28 +19,16 @@ class SyncPumpBolusTransaction( database.bolusDao.insertNewEntry(bolus) result.inserted.add(bolus) } else { - if (ignoreBolusTypeOnUpdate) { - if ( - current.timestamp != bolus.timestamp || - current.amount != bolus.amount - ) { - current.timestamp = bolus.timestamp - current.amount = bolus.amount - database.bolusDao.updateExistingEntry(current) - result.updated.add(current) - } - } else { - if ( - current.timestamp != bolus.timestamp || - current.amount != bolus.amount || - current.type != bolusType ?: current.type - ) { - current.timestamp = bolus.timestamp - current.amount = bolus.amount - current.type = bolusType ?: current.type - database.bolusDao.updateExistingEntry(current) - result.updated.add(current) - } + if ( + current.timestamp != bolus.timestamp || + current.amount != bolus.amount || + current.type != bolusType ?: current.type + ) { + current.timestamp = bolus.timestamp + current.amount = bolus.amount + current.type = bolusType ?: current.type + database.bolusDao.updateExistingEntry(current) + result.updated.add(current) } } return result 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 3f11910c5f..0f287db750 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 @@ -469,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 @@ -581,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) @@ -692,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) { @@ -743,7 +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() + //cancelTBRWithTemporaryId() aapsLogger.info(LTag.PUMP, logPrefix + "setTempBasalAbsolute - Current TBR cancelled.") } } @@ -774,6 +777,7 @@ 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) { @@ -829,6 +833,7 @@ class MedtronicPumpPlugin @Inject constructor( } } + @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) @@ -1024,6 +1029,7 @@ class MedtronicPumpPlugin @Inject constructor( } } + @Synchronized override fun cancelTempBasal(enforceNew: Boolean): PumpEnactResult { aapsLogger.info(LTag.PUMP, logPrefix + "cancelTempBasal - started") if (isPumpNotReachable) { @@ -1084,7 +1090,7 @@ class MedtronicPumpPlugin @Inject constructor( } } - cancelTBRWithTemporaryId() + //cancelTBRWithTemporaryId() PumpEnactResult(injector).success(true).enacted(true) // .isTempCancel(true) @@ -1103,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..6730439a4b 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 @@ -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 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 0f1e177de3..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 @@ -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/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 ac39b3fab1..7b34490067 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) {