From 0050857973426ceed39d0c9881ab91d52f1bbd50 Mon Sep 17 00:00:00 2001 From: miyeongkim Date: Wed, 23 Jun 2021 11:08:29 +0900 Subject: [PATCH] =?UTF-8?q?1.=20=EB=B3=80=EC=88=98=20=EC=9D=B4=EB=A6=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=202.=20=ED=99=95=EC=9E=A5=EB=B3=BC=EB=9F=AC?= =?UTF-8?q?=EC=8A=A4=20=EC=97=90=EB=9F=AC=20=EC=B2=98=EB=A6=AC.=203.=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=204.=20TDD=20=EC=A1=B0=ED=9A=8C=EC=8B=9C=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=20=EC=B2=98=EB=A6=AC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../androidaps/activities/TDDStatsActivity.kt | 7 ++++++- .../androidaps/diaconn/DiaconnG8Plugin.kt | 15 +++++++++++++-- .../androidaps/diaconn/DiaconnG8Pump.kt | 2 +- .../packet/AppCancelSettingResponsePacket.kt | 2 +- .../packet/AppConfirmSettingResponsePacket.kt | 2 +- .../packet/BasalPauseSettingResponsePacket.kt | 2 +- .../diaconn/packet/BasalSettingResponsePacket.kt | 2 +- .../diaconn/packet/BigLogInquireResponsePacket.kt | 8 ++++++-- .../packet/BolusSpeedSettingResponsePacket.kt | 2 +- .../packet/DisplayTimeoutSettingResponsePacket.kt | 2 +- .../packet/InjectionBasalSettingResponsePacket.kt | 2 +- .../InjectionCancelSettingResponsePacket.kt | 2 +- ...InjectionExtendedBolusSettingResponsePacket.kt | 2 +- .../packet/InjectionMealSettingResponsePacket.kt | 2 +- .../packet/InjectionSnackSettingResponsePacket.kt | 2 +- .../packet/LanguageSettingResponsePacket.kt | 2 +- .../diaconn/packet/SoundSettingResponsePacket.kt | 2 +- .../packet/TempBasalSettingResponsePacket.kt | 2 +- .../diaconn/packet/TimeSettingResponsePacket.kt | 2 +- .../diaconn/service/DiaconnG8Service.kt | 10 ++++------ diaconn/src/main/res/values-ko-rKR/strings.xml | 5 +++++ diaconn/src/main/res/values/strings.xml | 5 +++++ 22 files changed, 55 insertions(+), 27 deletions(-) diff --git a/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt b/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt index 58b939b2cb..0e29d22b00 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt @@ -26,6 +26,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueueProvider import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.AAPSLogger +import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.queue.Callback @@ -232,11 +233,15 @@ class TDDStatsActivity : NoSplashAppCompatActivity() { @SuppressLint("SetTextI18n") private fun loadDataFromDB() { historyList.clear() - historyList.addAll(repository.getLastTotalDailyDoses(10, false).blockingGet()) + // timestamp DESC sorting! + historyList.addAll(repository.getLastTotalDailyDoses(10, true).blockingGet()) //only use newest 10 historyList = historyList.subList(0, min(10, historyList.size)) + // dummies reset + dummies.clear() + //fill single gaps val df: DateFormat = SimpleDateFormat("dd.MM.", Locale.getDefault()) for (i in 0 until historyList.size - 1) { diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index e586e45c3f..168c0f3fa5 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -268,7 +268,7 @@ class DiaconnG8Plugin @Inject constructor( if(result.success) result.enacted = true if (!result.success) { - setErrorMsg(diaconnG8Pump.bolusStartErrorCode, result) + setErrorMsg(diaconnG8Pump.resultErrorCode, result) } else result.comment = resourceHelper.gs(R.string.ok) aapsLogger.debug(LTag.PUMP, "deliverTreatment: OK. Asked: " + detailedBolusInfo.insulin + " Delivered: " + result.bolusDelivered) result @@ -409,7 +409,7 @@ class DiaconnG8Plugin @Inject constructor( result.enacted = false result.success = false - setErrorMsg(diaconnG8Pump.bolusStartErrorCode, result) + setErrorMsg(diaconnG8Pump.resultErrorCode, result) aapsLogger.error("setExtendedBolus: Failed to extended bolus") return result } @@ -422,6 +422,7 @@ class DiaconnG8Plugin @Inject constructor( result.success = !diaconnG8Pump.isTempBasalInProgress result.enacted = true result.isTempCancel = true + if(!result.success) setErrorMsg(diaconnG8Pump.resultErrorCode, result) } else { result.success = true result.enacted = false @@ -438,6 +439,11 @@ class DiaconnG8Plugin @Inject constructor( diaconnG8Service?.extendedBolusStop() result.success = !diaconnG8Pump.isExtendedInProgress result.enacted = true + if(!result.success) { + setErrorMsg(diaconnG8Pump.resultErrorCode, result) + diaconnG8Service?.readPumpStatus() + } + } else { result.success = true result.enacted = false @@ -560,6 +566,11 @@ class DiaconnG8Plugin @Inject constructor( 13 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_13) 14 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_14) 15 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_15) + 32 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_32) + 33 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_33) + 34 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_34) + 35 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_35) + 36 -> result.comment = resourceHelper.gs(R.string.diaconn_g8_errorcode_36) else -> result.comment = "not defined Error code: $errorCode" } } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt index ddd9fe1de4..77739cf9e9 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt @@ -174,9 +174,9 @@ class DiaconnG8Pump @Inject constructor( var selectedLanguage = 0 var bolusSpeed = 0 + var resultErrorCode: Int = 0 // last start bolus erroCode // Bolus settings - var bolusStartErrorCode: Int = 0 // last start bolus erroCode var historyDoneReceived: Boolean = false // true when last history message is received var bolusingTreatment: EventOverviewBolusProgress.Treatment? = null // actually delivered treatment var bolusAmountToBeDelivered = 0.0 // amount to be delivered diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppCancelSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppCancelSettingResponsePacket.kt index bdba88b35f..97f2e09403 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppCancelSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppCancelSettingResponsePacket.kt @@ -30,7 +30,7 @@ class AppCancelSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppConfirmSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppConfirmSettingResponsePacket.kt index 096516e501..f54fc49d4a 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppConfirmSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppConfirmSettingResponsePacket.kt @@ -31,7 +31,7 @@ class AppConfirmSettingResponsePacket( aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${result}") if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalPauseSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalPauseSettingResponsePacket.kt index 649ed7ff5e..5ec73cbe3c 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalPauseSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalPauseSettingResponsePacket.kt @@ -32,7 +32,7 @@ class BasalPauseSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalSettingResponsePacket.kt index 10ee5d139a..d7902d76f9 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalSettingResponsePacket.kt @@ -31,7 +31,7 @@ class BasalSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt index 1afce9c0a9..e75008d66c 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt @@ -21,6 +21,7 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.sharedPreferences.SP import org.apache.commons.lang3.time.DateUtils +import org.joda.time.DateTime import javax.inject.Inject /** @@ -299,6 +300,9 @@ class BigLogInquireResponsePacket( pumpSerial = diaconnG8Pump.serialNo.toString()) aapsLogger.debug(LTag.PUMPCOMM, (if (newRecord) "**NEW** " else "") + "EVENT DUALBOLUS (" + pumplogKind + ") " + dateUtil.dateAndTimeString(logDateTime) + " (" + logDateTime + ")" + " Bolus: " + logItem.injectAmount / 100.0 + "U Duration: " + logItem.getInjectTime() + "min") + diaconnG8Pump.lastBolusAmount = logItem.injectAmount / 100.0 + diaconnG8Pump.lastBolusTime = logDateTime + //Diaconn History diaconnG8HistoryRecord.code = RecordTypes.RECORD_TYPE_BOLUS diaconnG8HistoryRecord.timestamp = logDateTime @@ -441,7 +445,7 @@ class BigLogInquireResponsePacket( val logDateTime = logStartDate.time diaconnG8HistoryRecord.code = RecordTypes.RECORD_TYPE_DAILY - diaconnG8HistoryRecord.timestamp = logDateTime + diaconnG8HistoryRecord.timestamp = DateTime(logDateTime).withTimeAtStartOfDay().millis diaconnG8HistoryRecord.dailyBolus = logItem.extAmount / 100.0 + logItem.mealAmount / 100.0 val recordDateStr = "" + diaconnG8HistoryRecord.timestamp @@ -488,7 +492,7 @@ class BigLogInquireResponsePacket( val logDateTime = logStartDate.time diaconnG8HistoryRecord.code = RecordTypes.RECORD_TYPE_DAILY - diaconnG8HistoryRecord.timestamp = logDateTime + diaconnG8HistoryRecord.timestamp = DateTime(logDateTime).withTimeAtStartOfDay().millis diaconnG8HistoryRecord.dailyBasal = logItem.amount / 100.0 val recordDateStr = "" + diaconnG8HistoryRecord.timestamp diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BolusSpeedSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BolusSpeedSettingResponsePacket.kt index efc55b2a49..8a5b22f5da 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BolusSpeedSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BolusSpeedSettingResponsePacket.kt @@ -31,7 +31,7 @@ class BolusSpeedSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DisplayTimeoutSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DisplayTimeoutSettingResponsePacket.kt index 9582da53e5..d3a1aff191 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DisplayTimeoutSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DisplayTimeoutSettingResponsePacket.kt @@ -31,7 +31,7 @@ class DisplayTimeoutSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionBasalSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionBasalSettingResponsePacket.kt index c9912472ce..921b7cfdf8 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionBasalSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionBasalSettingResponsePacket.kt @@ -31,7 +31,7 @@ class InjectionBasalSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionCancelSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionCancelSettingResponsePacket.kt index 9099e5ba0c..922198207d 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionCancelSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionCancelSettingResponsePacket.kt @@ -31,7 +31,7 @@ class InjectionCancelSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionExtendedBolusSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionExtendedBolusSettingResponsePacket.kt index a17ecd3bfb..051612ba2c 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionExtendedBolusSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionExtendedBolusSettingResponsePacket.kt @@ -31,7 +31,7 @@ class InjectionExtendedBolusSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionMealSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionMealSettingResponsePacket.kt index 7e30ef8c3c..802e95985e 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionMealSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionMealSettingResponsePacket.kt @@ -31,7 +31,7 @@ class InjectionMealSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionSnackSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionSnackSettingResponsePacket.kt index dec3271e47..aa60b70c1a 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionSnackSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionSnackSettingResponsePacket.kt @@ -31,7 +31,7 @@ class InjectionSnackSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/LanguageSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/LanguageSettingResponsePacket.kt index 91a29ddae7..4a560dd979 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/LanguageSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/LanguageSettingResponsePacket.kt @@ -31,7 +31,7 @@ class LanguageSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SoundSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SoundSettingResponsePacket.kt index 474dc3997c..fba733ee8c 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SoundSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SoundSettingResponsePacket.kt @@ -31,7 +31,7 @@ class SoundSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TempBasalSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TempBasalSettingResponsePacket.kt index 843f245e96..3ef1cf5668 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TempBasalSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TempBasalSettingResponsePacket.kt @@ -31,7 +31,7 @@ class TempBasalSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TimeSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TimeSettingResponsePacket.kt index ef78bf735f..75523537f8 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TimeSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TimeSettingResponsePacket.kt @@ -31,7 +31,7 @@ class TimeSettingResponsePacket( result = getByteToInt(bufferData) if(!isSuccSettingResponseResult(result)) { - diaconnG8Pump.bolusStartErrorCode = result + diaconnG8Pump.resultErrorCode = result failed = true return } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index f6c6e5631c..d6196efb78 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -231,11 +231,11 @@ class DiaconnG8Service : DaggerService() { result.comment = "pump not initialized" return result } - sendMessage(LogStatusInquirePacket(injector), 1000) + sendMessage(LogStatusInquirePacket(injector)) // pump version check if(diaconnG8Pump.isPumpVersionGe2_63) { - sendMessage(IncarnationInquirePacket(injector), 1000) + sendMessage(IncarnationInquirePacket(injector)) } val result = PumpEnactResult(injector) @@ -423,7 +423,6 @@ class DiaconnG8Service : DaggerService() { fun bolusStop() { val stop = InjectionCancelSettingPacket(injector, 0x07.toByte()) - diaconnG8Pump.bolusStopForced = true if (isConnected) { sendMessage(stop) @@ -483,7 +482,6 @@ class DiaconnG8Service : DaggerService() { } rxBus.send(EventPumpStatusChanged(resourceHelper.gs(R.string.settingtempbasal))) - val tbTime = 2 // 2: 30min, 3:45min, 4:60min var newAbsoluteRate = absoluteRate if (absoluteRate < 0.0) newAbsoluteRate = 0.0 @@ -586,7 +584,7 @@ class DiaconnG8Service : DaggerService() { sendMessage(msgStop) // otp process if(!processConfirm(msgStop.msgType)) return false - loadHistory() + loadHistory() // pump log sync( db update) val eb = pumpSync.expectedPumpState().extendedBolus diaconnG8Pump.fromExtendedBolus(eb) rxBus.send(EventPumpStatusChanged(EventPumpStatusChanged.Status.DISCONNECTING)) @@ -617,7 +615,7 @@ class DiaconnG8Service : DaggerService() { sendMessage(requestReqPacket4) // otp process - if(!processConfirm(0x0B)) return false + if(!processConfirm(requestReqPacket4.msgType)) return false // pump saving time about 30 second aapsLogger.debug(LTag.PUMPCOMM, "30 seconds Waiting!!") SystemClock.sleep(30000) diff --git a/diaconn/src/main/res/values-ko-rKR/strings.xml b/diaconn/src/main/res/values-ko-rKR/strings.xml index 9690702616..f6673736a2 100644 --- a/diaconn/src/main/res/values-ko-rKR/strings.xml +++ b/diaconn/src/main/res/values-ko-rKR/strings.xml @@ -140,4 +140,9 @@ 튜브 교체 로그 동기화 시 \"튜브 교체\" 노트 정보 자동 업로드 임시Basal 시작 + LGS 동작 중 볼러스 주입 거절 + LGS ON일때, ON 거절 + LGS OFF일 때, OFF 거절 + 임시기저 설정중인 상태일 때, 임시기저 시작 명령 거절 + 임시기저 설정이 안 된 상태일 때, 임시기저 중지 명령 거절 diff --git a/diaconn/src/main/res/values/strings.xml b/diaconn/src/main/res/values/strings.xml index d86a3f9bf1..3a51a9ff15 100644 --- a/diaconn/src/main/res/values/strings.xml +++ b/diaconn/src/main/res/values/strings.xml @@ -161,6 +161,11 @@ Log tube change Add \"Tube Change\" event to Note when detected in history TempBasal Start + During LGS running, injection is restricted + LGS status is ON, ON Command is declined. + LGS status is OFF, OFF Command is declined. + Tempbasal start is rejected when tempbasal is running + Tempbasal stop is rejected when tempbasal is not running \ No newline at end of file