cleanup
This commit is contained in:
parent
e06ec0eba1
commit
884ecd9f2b
|
@ -191,7 +191,7 @@ class FillDialog : DialogFragmentWithDate() {
|
||||||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -224,7 +224,7 @@ class InsulinDialog : DialogFragmentWithDate() {
|
||||||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -324,7 +324,7 @@ class LoopDialog : DaggerDialogFragment() {
|
||||||
commandQueue.cancelTempBasal(true, object : Callback() {
|
commandQueue.cancelTempBasal(true, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -119,7 +119,7 @@ class TempBasalDialog : DialogFragmentWithDate() {
|
||||||
val callback: Callback = object : Callback() {
|
val callback: Callback = object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ class TreatmentDialog : DialogFragmentWithDate() {
|
||||||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -631,7 +631,7 @@ open class LoopPlugin @Inject constructor(
|
||||||
commandQueue.tempBasalAbsolute(0.0, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.EMULATED_PUMP_SUSPEND, object : Callback() {
|
commandQueue.tempBasalAbsolute(0.0, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.EMULATED_PUMP_SUSPEND, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -639,7 +639,7 @@ open class LoopPlugin @Inject constructor(
|
||||||
commandQueue.tempBasalPercent(0, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.EMULATED_PUMP_SUSPEND, object : Callback() {
|
commandQueue.tempBasalPercent(0, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.EMULATED_PUMP_SUSPEND, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -648,7 +648,7 @@ open class LoopPlugin @Inject constructor(
|
||||||
commandQueue.cancelExtended(object : Callback() {
|
commandQueue.cancelExtended(object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.extendedbolusdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.extendedbolusdeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -666,7 +666,7 @@ open class LoopPlugin @Inject constructor(
|
||||||
commandQueue.cancelTempBasal(true, object : Callback() {
|
commandQueue.cancelTempBasal(true, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(context, result.comment, resourceHelper.gs(R.string.tempbasaldeliveryerror), R.raw.boluserror)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package info.nightscout.androidaps.danaRv2.comm
|
package info.nightscout.androidaps.danaRv2.comm
|
||||||
|
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
|
import info.nightscout.androidaps.dana.DanaPump
|
||||||
import info.nightscout.androidaps.danar.R
|
import info.nightscout.androidaps.danar.R
|
||||||
import info.nightscout.androidaps.danar.comm.MessageBase
|
import info.nightscout.androidaps.danar.comm.MessageBase
|
||||||
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
import info.nightscout.androidaps.events.EventPumpStatusChanged
|
||||||
|
@ -69,7 +70,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
val param2 = intFromBuff(bytes, 9, 2)
|
val param2 = intFromBuff(bytes, 9, 2)
|
||||||
val status: String
|
val status: String
|
||||||
when (recordCode.toInt()) {
|
when (recordCode.toInt()) {
|
||||||
info.nightscout.androidaps.dana.DanaPump.TEMPSTART -> {
|
DanaPump.TEMPSTART -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTART (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Ratio: " + param1 + "% Duration: " + param2 + "min")
|
||||||
val temporaryBasalInfo = temporaryBasalStorage.findTemporaryBasal(datetime, param1.toDouble())
|
val temporaryBasalInfo = temporaryBasalStorage.findTemporaryBasal(datetime, param1.toDouble())
|
||||||
pumpSync.syncTemporaryBasalWithPumpId(
|
pumpSync.syncTemporaryBasalWithPumpId(
|
||||||
|
@ -84,7 +85,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "TEMPSTART " + dateUtil.timeString(datetime)
|
status = "TEMPSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.TEMPSTOP -> {
|
DanaPump.TEMPSTOP -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime))
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT TEMPSTOP (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime))
|
||||||
pumpSync.syncStopTemporaryBasalWithPumpId(
|
pumpSync.syncStopTemporaryBasalWithPumpId(
|
||||||
timestamp = datetime,
|
timestamp = datetime,
|
||||||
|
@ -94,7 +95,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "TEMPSTOP " + dateUtil.timeString(datetime)
|
status = "TEMPSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.EXTENDEDSTART -> {
|
DanaPump.EXTENDEDSTART -> {
|
||||||
val newRecord = pumpSync.syncExtendedBolusWithPumpId(
|
val newRecord = pumpSync.syncExtendedBolusWithPumpId(
|
||||||
timestamp = datetime,
|
timestamp = datetime,
|
||||||
amount = param1 / 100.0,
|
amount = param1 / 100.0,
|
||||||
|
@ -107,7 +108,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "EXTENDEDSTART " + dateUtil.timeString(datetime)
|
status = "EXTENDEDSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.EXTENDEDSTOP -> {
|
DanaPump.EXTENDEDSTOP -> {
|
||||||
val newRecord = pumpSync.syncStopExtendedBolusWithPumpId(
|
val newRecord = pumpSync.syncStopExtendedBolusWithPumpId(
|
||||||
timestamp = datetime,
|
timestamp = datetime,
|
||||||
endPumpId = datetime,
|
endPumpId = datetime,
|
||||||
|
@ -117,7 +118,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
|
status = "EXTENDEDSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.BOLUS -> {
|
DanaPump.BOLUS -> {
|
||||||
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
||||||
val newRecord = pumpSync.syncBolusWithPumpId(
|
val newRecord = pumpSync.syncBolusWithPumpId(
|
||||||
timestamp = datetime,
|
timestamp = datetime,
|
||||||
|
@ -130,7 +131,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "BOLUS " + dateUtil.timeString(datetime)
|
status = "BOLUS " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.DUALBOLUS -> {
|
DanaPump.DUALBOLUS -> {
|
||||||
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
val detailedBolusInfo = detailedBolusInfoStorage.findDetailedBolusInfo(datetime, param1 / 100.0)
|
||||||
val newRecord = pumpSync.syncBolusWithPumpId(
|
val newRecord = pumpSync.syncBolusWithPumpId(
|
||||||
timestamp = datetime,
|
timestamp = datetime,
|
||||||
|
@ -143,7 +144,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "DUALBOLUS " + dateUtil.timeString(datetime)
|
status = "DUALBOLUS " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.DUALEXTENDEDSTART -> {
|
DanaPump.DUALEXTENDEDSTART -> {
|
||||||
val newRecord = pumpSync.syncExtendedBolusWithPumpId(
|
val newRecord = pumpSync.syncExtendedBolusWithPumpId(
|
||||||
timestamp = datetime,
|
timestamp = datetime,
|
||||||
amount = param1 / 100.0,
|
amount = param1 / 100.0,
|
||||||
|
@ -156,7 +157,7 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime)
|
status = "DUALEXTENDEDSTART " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.DUALEXTENDEDSTOP -> {
|
DanaPump.DUALEXTENDEDSTOP -> {
|
||||||
val newRecord = pumpSync.syncStopExtendedBolusWithPumpId(
|
val newRecord = pumpSync.syncStopExtendedBolusWithPumpId(
|
||||||
timestamp = datetime,
|
timestamp = datetime,
|
||||||
endPumpId = datetime,
|
endPumpId = datetime,
|
||||||
|
@ -166,32 +167,32 @@ class MsgHistoryEvents_v2 constructor(
|
||||||
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
|
status = "DUALEXTENDEDSTOP " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.SUSPENDON -> {
|
DanaPump.SUSPENDON -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDON (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
||||||
status = "SUSPENDON " + dateUtil.timeString(datetime)
|
status = "SUSPENDON " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.SUSPENDOFF -> {
|
DanaPump.SUSPENDOFF -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT SUSPENDOFF (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")")
|
||||||
status = "SUSPENDOFF " + dateUtil.timeString(datetime)
|
status = "SUSPENDOFF " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.REFILL -> {
|
DanaPump.REFILL -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT REFILL (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
||||||
status = "REFILL " + dateUtil.timeString(datetime)
|
status = "REFILL " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.PRIME -> {
|
DanaPump.PRIME -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PRIME (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " Amount: " + param1 / 100.0 + "U")
|
||||||
status = "PRIME " + dateUtil.timeString(datetime)
|
status = "PRIME " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.PROFILECHANGE -> {
|
DanaPump.PROFILECHANGE -> {
|
||||||
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
|
aapsLogger.debug(LTag.PUMPBTCOMM, "EVENT PROFILECHANGE (" + recordCode + ") " + dateUtil.dateAndTimeString(datetime) + " (" + datetime + ")" + " No: " + param1 + " CurrentRate: " + param2 / 100.0 + "U/h")
|
||||||
status = "PROFILECHANGE " + dateUtil.timeString(datetime)
|
status = "PROFILECHANGE " + dateUtil.timeString(datetime)
|
||||||
}
|
}
|
||||||
|
|
||||||
info.nightscout.androidaps.dana.DanaPump.CARBS -> {
|
DanaPump.CARBS -> {
|
||||||
val newRecord = pumpSync.syncCarbsWithTimestamp(
|
val newRecord = pumpSync.syncCarbsWithTimestamp(
|
||||||
timestamp = datetime,
|
timestamp = datetime,
|
||||||
amount = param1.toDouble(),
|
amount = param1.toDouble(),
|
||||||
|
|
|
@ -9,13 +9,15 @@ import android.text.format.DateFormat
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.dana.DanaPump
|
import info.nightscout.androidaps.dana.DanaPump
|
||||||
|
import info.nightscout.androidaps.dana.comm.RecordTypes
|
||||||
import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange
|
import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange
|
||||||
import info.nightscout.androidaps.danars.services.DanaRSService
|
import info.nightscout.androidaps.danars.services.DanaRSService
|
||||||
import info.nightscout.androidaps.data.DetailedBolusInfo
|
import info.nightscout.androidaps.data.DetailedBolusInfo
|
||||||
import info.nightscout.androidaps.interfaces.Profile
|
|
||||||
import info.nightscout.androidaps.data.PumpEnactResult
|
import info.nightscout.androidaps.data.PumpEnactResult
|
||||||
import info.nightscout.androidaps.events.EventAppExit
|
import info.nightscout.androidaps.events.EventAppExit
|
||||||
import info.nightscout.androidaps.events.EventConfigBuilderChange
|
import info.nightscout.androidaps.events.EventConfigBuilderChange
|
||||||
|
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
||||||
|
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
||||||
import info.nightscout.androidaps.interfaces.*
|
import info.nightscout.androidaps.interfaces.*
|
||||||
import info.nightscout.androidaps.logging.AAPSLogger
|
import info.nightscout.androidaps.logging.AAPSLogger
|
||||||
import info.nightscout.androidaps.logging.LTag
|
import info.nightscout.androidaps.logging.LTag
|
||||||
|
@ -31,8 +33,6 @@ import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalSt
|
||||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||||
import info.nightscout.androidaps.utils.*
|
import info.nightscout.androidaps.utils.*
|
||||||
import info.nightscout.androidaps.utils.T.Companion.mins
|
import info.nightscout.androidaps.utils.T.Companion.mins
|
||||||
import info.nightscout.androidaps.extensions.convertedToAbsolute
|
|
||||||
import info.nightscout.androidaps.extensions.plannedRemainingMinutes
|
|
||||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||||
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
||||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||||
|
@ -622,7 +622,7 @@ class DanaRSPlugin @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override val isFakingTempsByExtendedBoluses: Boolean = false
|
override val isFakingTempsByExtendedBoluses: Boolean = false
|
||||||
override fun loadTDDs(): PumpEnactResult = loadHistory(info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_DAILY)
|
override fun loadTDDs(): PumpEnactResult = loadHistory(RecordTypes.RECORD_TYPE_DAILY)
|
||||||
override fun canHandleDST(): Boolean = false
|
override fun canHandleDST(): Boolean = false
|
||||||
override fun clearPairing() {
|
override fun clearPairing() {
|
||||||
sp.remove(resourceHelper.gs(R.string.key_danars_pairingkey) + mDeviceName)
|
sp.remove(resourceHelper.gs(R.string.key_danars_pairingkey) + mDeviceName)
|
||||||
|
|
|
@ -2,12 +2,13 @@ package info.nightscout.androidaps.danars.comm
|
||||||
|
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
|
import info.nightscout.androidaps.dana.DanaPump
|
||||||
|
import info.nightscout.androidaps.danars.DanaRSTestBase
|
||||||
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
import info.nightscout.androidaps.danars.encryption.BleEncryption
|
||||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||||
import info.nightscout.androidaps.interfaces.Constraint
|
import info.nightscout.androidaps.interfaces.Constraint
|
||||||
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
|
||||||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
|
||||||
import info.nightscout.androidaps.danars.DanaRSTestBase
|
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
@ -47,7 +48,7 @@ class DanaRsMessageHashTableTest : DanaRSTestBase() {
|
||||||
`when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0))
|
`when`(constraintChecker.applyBolusConstraints(anyObject())).thenReturn(Constraint(0.0))
|
||||||
|
|
||||||
val danaRSMessageHashTable = DanaRSMessageHashTable(packetInjector)
|
val danaRSMessageHashTable = DanaRSMessageHashTable(packetInjector)
|
||||||
val forTesting: DanaRSPacket = DanaRSPacketAPSSetEventHistory(packetInjector, info.nightscout.androidaps.dana.DanaPump.CARBS, 0, 0, 0)
|
val forTesting: DanaRSPacket = DanaRSPacketAPSSetEventHistory(packetInjector, DanaPump.CARBS, 0, 0, 0)
|
||||||
val testPacket: DanaRSPacket = danaRSMessageHashTable.findMessage(forTesting.command)
|
val testPacket: DanaRSPacket = danaRSMessageHashTable.findMessage(forTesting.command)
|
||||||
Assert.assertEquals(BleEncryption.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY.toLong(), testPacket.opCode.toLong())
|
Assert.assertEquals(BleEncryption.DANAR_PACKET__OPCODE__APS_SET_EVENT_HISTORY.toLong(), testPacket.opCode.toLong())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue