Dana,Diacon: fix wrongly used detailedBolusInfo

This commit is contained in:
Milos Kozak 2022-01-25 08:14:24 +01:00
parent 1aa4f7452c
commit 983b31866d
3 changed files with 36 additions and 0 deletions

View file

@ -151,6 +151,10 @@ class MsgHistoryEventsV2 constructor(
(if (newRecord) "**NEW** " else "") + "EVENT BOLUS (" + recordCode + ") "
+ dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min"
)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "BOLUS " + dateUtil.timeString(datetime)
}
@ -169,6 +173,10 @@ class MsgHistoryEventsV2 constructor(
(if (newRecord) "**NEW** " else "") + "EVENT DUAL_BOLUS (" + recordCode + ") "
+ dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Bolus: " + param1 / 100.0 + "U Duration: " + param2 + "min"
)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "DUAL_BOLUS " + dateUtil.timeString(datetime)
}

View file

@ -211,6 +211,10 @@ open class DanaRSPacketAPSHistoryEvents(
LTag.PUMPCOMM,
"[$pumpId] ${if (newRecord) "**NEW** " else ""}EVENT BOLUS ($recordCode) ${dateUtil.dateAndTimeString(datetime)} ($datetime) Bolus: ${param1 / 100.0}U "
)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "BOLUS " + dateUtil.timeString(datetime)
}
@ -228,6 +232,10 @@ open class DanaRSPacketAPSHistoryEvents(
LTag.PUMPCOMM,
"[$pumpId] ${if (newRecord) "**NEW** " else ""}EVENT DUAL_BOLUS ($recordCode) ${dateUtil.dateAndTimeString(datetime)} ($datetime) Bolus: ${param1 / 100.0}U Duration: ${param2}min"
)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "DUAL_BOLUS " + dateUtil.timeString(datetime)
}

View file

@ -120,6 +120,10 @@ class BigLogInquireResponsePacket(
diaconnG8HistoryRecord.bolusType = "M" // meal bolus
diaconnG8HistoryRecord.stringValue = rh.gs(R.string.diaconn_g8_logmealsuccess)
diaconnHistoryRecordDao.createOrUpdate(diaconnG8HistoryRecord)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "MEALBOLUSSUCCESS" + dateUtil.timeString(logDateTime)
}
@ -144,6 +148,10 @@ class BigLogInquireResponsePacket(
diaconnG8HistoryRecord.bolusType = "M" // Meal bolus
diaconnG8HistoryRecord.stringValue = rh.gs(R.string.diaconn_g8_logmealfail)
diaconnHistoryRecordDao.createOrUpdate(diaconnG8HistoryRecord)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "MEALBOLUSFAIL " + dateUtil.timeString(logDateTime)
}
@ -169,6 +177,10 @@ class BigLogInquireResponsePacket(
diaconnG8HistoryRecord.bolusType = "B" // bolus
diaconnG8HistoryRecord.stringValue = rh.gs(R.string.diaconn_g8_logsuccess)
diaconnHistoryRecordDao.createOrUpdate(diaconnG8HistoryRecord)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "BOLUSSUCCESS" + dateUtil.timeString(logDateTime)
}
@ -196,6 +208,10 @@ class BigLogInquireResponsePacket(
diaconnG8HistoryRecord.bolusType = "B" // bolus
diaconnG8HistoryRecord.stringValue = getReasonName(pumplogKind, logItem.reason)
diaconnHistoryRecordDao.createOrUpdate(diaconnG8HistoryRecord)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "BOLUSFAIL " + dateUtil.timeString(logDateTime)
}
@ -311,6 +327,10 @@ class BigLogInquireResponsePacket(
diaconnG8HistoryRecord.bolusType = "D" // bolus
diaconnG8HistoryRecord.stringValue = rh.gs(R.string.diaconn_g8_logdualnormalsuccess)
diaconnHistoryRecordDao.createOrUpdate(diaconnG8HistoryRecord)
if (!newRecord && detailedBolusInfo != null) {
// detailedInfo can be from another similar record. Reinsert
detailedBolusInfoStorage.add(detailedBolusInfo)
}
status = "DUALBOLUS" + dateUtil.timeString(logDateTime)
}