PumpEnactResult

This commit is contained in:
Milos Kozak 2022-11-14 08:30:50 +01:00
parent c9164e6274
commit f141d003a4
46 changed files with 191 additions and 164 deletions

View file

@ -1,8 +1,7 @@
package info.nightscout.androidaps.events package info.nightscout.rx.events
import android.content.Context import android.content.Context
import info.nightscout.core.main.R import info.nightscout.rx.R
import info.nightscout.rx.events.EventStatus
class EventPumpStatusChanged : EventStatus { class EventPumpStatusChanged : EventStatus {
@ -48,7 +47,7 @@ class EventPumpStatusChanged : EventStatus {
// status for startup wizard // status for startup wizard
override fun getStatus(context: Context): String { override fun getStatus(context: Context): String {
return when (status) { return when (status) {
Status.CONNECTING -> context.getString(R.string.connectingfor, secondsElapsed) Status.CONNECTING -> context.getString(R.string.connecting_for, secondsElapsed)
Status.HANDSHAKING -> context.getString(R.string.handshaking) Status.HANDSHAKING -> context.getString(R.string.handshaking)
Status.CONNECTED -> context.getString(R.string.connected) Status.CONNECTED -> context.getString(R.string.connected)
Status.PERFORMING -> performingAction Status.PERFORMING -> performingAction
@ -57,4 +56,4 @@ class EventPumpStatusChanged : EventStatus {
Status.DISCONNECTED -> "" Status.DISCONNECTED -> ""
} }
} }
} }

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="connecting_for">Connecting for %1$d s</string>
<string name="handshaking">Handshaking</string>
<string name="connected">Connected</string>
<string name="disconnecting">Disconnecting</string>
<string name="waiting_for_disconnection">Waiting for disconnection</string>
</resources>

View file

@ -16,11 +16,10 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.LoopFragmentBinding import info.nightscout.androidaps.databinding.LoopFragmentBinding
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui
import info.nightscout.androidaps.utils.DecimalFormatter
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
import info.nightscout.core.pumpExtensions.toHtml
import info.nightscout.interfaces.aps.Loop import info.nightscout.interfaces.aps.Loop
import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraint
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.HtmlHelper
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
@ -170,44 +169,4 @@ class LoopFragment : DaggerFragment(), MenuProvider {
binding.smbsetbypump.text = "" binding.smbsetbypump.text = ""
binding.swipeRefresh.isRefreshing = false binding.swipeRefresh.isRefreshing = false
} }
private fun PumpEnactResult.toHtml(rh: ResourceHelper): String {
var ret = "<b>" + rh.gs(info.nightscout.core.main.R.string.success) + "</b>: " + success
if (queued) {
ret = rh.gs(info.nightscout.core.main.R.string.waitingforpumpresult)
} else if (enacted) {
when {
bolusDelivered > 0 -> {
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.enacted) + "</b>: " + enacted
if (comment.isNotEmpty()) ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.smb_shortname) + "</b>: " + bolusDelivered + " " + rh.gs(info.nightscout.core.main.R.string.insulin_unit_shortname)
}
isTempCancel -> {
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.enacted) + "</b>: " + enacted
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment +
"<br>" + rh.gs(info.nightscout.core.main.R.string.cancel_temp)
}
isPercent && percent != -1 -> {
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.enacted) + "</b>: " + enacted
if (comment.isNotEmpty()) ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.duration) + "</b>: " + duration + " min"
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.percent) + "</b>: " + percent + "%"
}
absolute != -1.0 -> {
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.enacted) + "</b>: " + enacted
if (comment.isNotEmpty()) ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.duration) + "</b>: " + duration + " min"
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.absolute) + "</b>: " + DecimalFormatter.to2Decimal(absolute) + " U/h"
}
}
} else {
if (comment.isNotEmpty()) ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment
}
return ret
}
} }

View file

@ -31,7 +31,6 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.ProfileSealed
import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged
import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventNewBG
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.directionToIcon
import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.extensions.valueToUnitsString
import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.logging.UserEntryLogger
@ -94,6 +93,7 @@ import info.nightscout.rx.events.EventAcceptOpenLoopChange
import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.events.EventExtendedBolusChange
import info.nightscout.rx.events.EventMobileToWear import info.nightscout.rx.events.EventMobileToWear
import info.nightscout.rx.events.EventPreferenceChange import info.nightscout.rx.events.EventPreferenceChange
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.events.EventRefreshOverview
import info.nightscout.rx.events.EventScale import info.nightscout.rx.events.EventScale
import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.events.EventTempBasalChange

View file

@ -6,7 +6,6 @@ import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference import androidx.preference.SwitchPreference
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.putDouble import info.nightscout.androidaps.extensions.putDouble
import info.nightscout.androidaps.extensions.putInt import info.nightscout.androidaps.extensions.putInt
import info.nightscout.androidaps.extensions.putString import info.nightscout.androidaps.extensions.putString
@ -29,6 +28,7 @@ import info.nightscout.plugins.general.overview.notifications.NotificationWithAc
import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP

View file

@ -9,7 +9,6 @@ import androidx.appcompat.app.AppCompatActivity
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.ProfileSealed
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
@ -46,6 +45,7 @@ import info.nightscout.plugins.profile.ProfileFragment
import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.plugins.profile.ProfilePlugin
import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.events.EventSWUpdate import info.nightscout.rx.events.EventSWUpdate
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP

View file

@ -9,11 +9,9 @@ import info.nightscout.androidaps.MainActivity
import info.nightscout.androidaps.R import info.nightscout.androidaps.R
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
import info.nightscout.androidaps.databinding.ActivitySetupwizardBinding import info.nightscout.androidaps.databinding.ActivitySetupwizardBinding
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
import info.nightscout.androidaps.setupwizard.elements.SWItem import info.nightscout.androidaps.setupwizard.elements.SWItem
import info.nightscout.rx.events.EventSWUpdate
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
import info.nightscout.interfaces.locale.LocaleHelper.update import info.nightscout.interfaces.locale.LocaleHelper.update
@ -21,6 +19,8 @@ import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.events.EventProfileStoreChanged import info.nightscout.rx.events.EventProfileStoreChanged
import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.events.EventProfileSwitchChanged
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.events.EventSWUpdate
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.plusAssign

View file

@ -32,6 +32,7 @@ import info.nightscout.interfaces.constraints.Objectives
import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.ActivePlugin
import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginBase
import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.plugin.PluginType
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.PumpSync
import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpDescription
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
@ -89,8 +90,8 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
it.sp = sp it.sp = sp
it.dateUtil = dateUtil it.dateUtil = dateUtil
} }
if (it is PumpEnactResultObject) { if (it is PumpEnactResult) {
it.rh = rh it.context = context
} }
} }
} }
@ -122,7 +123,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
`when`(rh.gs(R.string.limitingpercentrate)).thenReturn("Limiting max percent rate to %1\$d%% because of %2\$s") `when`(rh.gs(R.string.limitingpercentrate)).thenReturn("Limiting max percent rate to %1\$d%% because of %2\$s")
`when`(rh.gs(R.string.limitingbolus)).thenReturn("Limiting bolus to %1\$.1f U because of %2\$s") `when`(rh.gs(R.string.limitingbolus)).thenReturn("Limiting bolus to %1\$.1f U because of %2\$s")
`when`(rh.gs(R.string.limitingbasalratio)).thenReturn("Limiting max basal rate to %1\$.2f U/h because of %2\$s") `when`(rh.gs(R.string.limitingbasalratio)).thenReturn("Limiting max basal rate to %1\$.2f U/h because of %2\$s")
`when`(rh.gs(R.string.combo_pump_unsupported_operation)).thenReturn("Requested operation not supported by pump") `when`(context.getString(R.string.combo_pump_unsupported_operation)).thenReturn("Requested operation not supported by pump")
`when`(rh.gs(R.string.objectivenotstarted)).thenReturn("Objective %1\$d not started") `when`(rh.gs(R.string.objectivenotstarted)).thenReturn("Objective %1\$d not started")
// RS constructor // RS constructor

View file

@ -1,10 +1,14 @@
package info.nightscout.androidaps.data package info.nightscout.androidaps.pump
import dagger.android.AndroidInjector import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestBaseWithProfile
import info.nightscout.core.main.R import info.nightscout.core.main.R
import info.nightscout.core.pumpExtensions.toHtml
import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.plugins.extensions.toText
import info.nightscout.plugins.sync.nsShared.extensions.json
import info.nightscout.plugins.sync.nsShared.extensions.log
import org.json.JSONObject import org.json.JSONObject
import org.junit.Assert import org.junit.Assert
import org.junit.Before import org.junit.Before
@ -16,8 +20,8 @@ class PumpEnactResultTest : TestBaseWithProfile() {
private val injector = HasAndroidInjector { private val injector = HasAndroidInjector {
AndroidInjector { AndroidInjector {
if (it is PumpEnactResultObject) { if (it is PumpEnactResult) {
it.rh = rh it.context = context
} }
} }
} }
@ -130,7 +134,7 @@ class PumpEnactResultTest : TestBaseWithProfile() {
Enacted: true Enacted: true
Comment: AAA Comment: AAA
Insulin: 10.0 U Insulin: 10.0 U
""".trimIndent(), per.toString() """.trimIndent(), per.toText(rh)
) )
per = PumpEnactResult(injector).enacted(true).isTempCancel(true).comment("AAA") per = PumpEnactResult(injector).enacted(true).isTempCancel(true).comment("AAA")
Assert.assertEquals( Assert.assertEquals(
@ -139,7 +143,7 @@ class PumpEnactResultTest : TestBaseWithProfile() {
Enacted: true Enacted: true
Comment: AAA Comment: AAA
Cancel temp basal Cancel temp basal
""".trimIndent(), per.toString() """.trimIndent(), per.toText(rh)
) )
per = PumpEnactResult(injector).enacted(true).isPercent(true).percent(90).duration(20).comment("AAA") per = PumpEnactResult(injector).enacted(true).isPercent(true).percent(90).duration(20).comment("AAA")
Assert.assertEquals( Assert.assertEquals(
@ -149,7 +153,7 @@ class PumpEnactResultTest : TestBaseWithProfile() {
Comment: AAA Comment: AAA
Duration: 20 min Duration: 20 min
Percent: 90% Percent: 90%
""".trimIndent(), per.toString() """.trimIndent(), per.toText(rh)
) )
per = PumpEnactResult(injector).enacted(true).isPercent(false).absolute(1.0).duration(30).comment("AAA") per = PumpEnactResult(injector).enacted(true).isPercent(false).absolute(1.0).duration(30).comment("AAA")
Assert.assertEquals( Assert.assertEquals(
@ -159,29 +163,29 @@ class PumpEnactResultTest : TestBaseWithProfile() {
Comment: AAA Comment: AAA
Duration: 30 min Duration: 30 min
Absolute: 1.0 U/h Absolute: 1.0 U/h
""".trimIndent(), per.toString() """.trimIndent(), per.toText(rh)
) )
per = PumpEnactResult(injector).enacted(false).comment("AAA") per = PumpEnactResult(injector).enacted(false).comment("AAA")
Assert.assertEquals( Assert.assertEquals(
""" """
Success: false Success: false
Comment: AAA Comment: AAA
""".trimIndent(), per.toString() """.trimIndent(), per.toText(rh)
) )
} }
@Test fun toHtmlTest() { @Test fun toHtmlTest() {
var per: PumpEnactResult = PumpEnactResult(injector).enacted(true).bolusDelivered(10.0).comment("AAA") var per: PumpEnactResult = PumpEnactResult(injector).enacted(true).bolusDelivered(10.0).comment("AAA")
Assert.assertEquals("<b>Success</b>: false<br><b>Enacted</b>: true<br><b>Comment</b>: AAA<br><b>SMB</b>: 10.0 U", per.toHtml()) Assert.assertEquals("<b>Success</b>: false<br><b>Enacted</b>: true<br><b>Comment</b>: AAA<br><b>SMB</b>: 10.0 U", per.toHtml(rh))
per = PumpEnactResult(injector).enacted(true).isTempCancel(true).comment("AAA") per = PumpEnactResult(injector).enacted(true).isTempCancel(true).comment("AAA")
Assert.assertEquals("<b>Success</b>: false<br><b>Enacted</b>: true<br><b>Comment</b>: AAA<br>Cancel temp basal", per.toHtml()) Assert.assertEquals("<b>Success</b>: false<br><b>Enacted</b>: true<br><b>Comment</b>: AAA<br>Cancel temp basal", per.toHtml(rh))
per = PumpEnactResult(injector).enacted(true).isPercent(true).percent(90).duration(20).comment("AAA") per = PumpEnactResult(injector).enacted(true).isPercent(true).percent(90).duration(20).comment("AAA")
Assert.assertEquals("<b>Success</b>: false<br><b>Enacted</b>: true<br><b>Comment</b>: AAA<br><b>Duration</b>: 20 min<br><b>Percent</b>: 90%", per.toHtml()) Assert.assertEquals("<b>Success</b>: false<br><b>Enacted</b>: true<br><b>Comment</b>: AAA<br><b>Duration</b>: 20 min<br><b>Percent</b>: 90%", per.toHtml(rh))
per = PumpEnactResult(injector).enacted(true).isPercent(false).absolute(1.0).duration(30).comment("AAA") per = PumpEnactResult(injector).enacted(true).isPercent(false).absolute(1.0).duration(30).comment("AAA")
Assert.assertEquals("<b>Success</b>: false<br><b>Enacted</b>: true<br><b>Comment</b>: AAA<br><b>Duration</b>: 30 min<br><b>Absolute</b>: 1.00 U/h", per.toHtml()) Assert.assertEquals("<b>Success</b>: false<br><b>Enacted</b>: true<br><b>Comment</b>: AAA<br><b>Duration</b>: 30 min<br><b>Absolute</b>: 1.00 U/h", per.toHtml(rh))
per = PumpEnactResult(injector).enacted(false).comment("AAA") per = PumpEnactResult(injector).enacted(false).comment("AAA")
Assert.assertEquals("<b>Success</b>: false<br><b>Comment</b>: AAA", per.toHtml()) Assert.assertEquals("<b>Success</b>: false<br><b>Comment</b>: AAA", per.toHtml(rh))
} }
@Test fun jsonTest() { @Test fun jsonTest() {

View file

@ -7,6 +7,7 @@ import info.nightscout.androidaps.TestBase
import info.nightscout.automation.R import info.nightscout.automation.R
import info.nightscout.automation.elements.InputString import info.nightscout.automation.elements.InputString
import info.nightscout.interfaces.Config import info.nightscout.interfaces.Config
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.Callback
import info.nightscout.interfaces.utils.TimerUtil import info.nightscout.interfaces.utils.TimerUtil
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
@ -39,16 +40,16 @@ class ActionAlarmTest : TestBase() {
it.dateUtil = dateUtil it.dateUtil = dateUtil
it.config = config it.config = config
} }
if (it is PumpEnactResultObject) { if (it is PumpEnactResult) {
it.rh = rh it.context = context
} }
} }
} }
@Before @Before
fun setup() { fun setup() {
`when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK") `when`(context.getString(info.nightscout.core.main.R.string.ok)).thenReturn("OK")
`when`(rh.gs(info.nightscout.core.main.R.string.alarm)).thenReturn("Alarm") `when`(context.getString(info.nightscout.core.main.R.string.alarm)).thenReturn("Alarm")
`when`(rh.gs(ArgumentMatchers.eq(R.string.alarm_message), ArgumentMatchers.anyString())).thenReturn("Alarm: %s") `when`(rh.gs(ArgumentMatchers.eq(R.string.alarm_message), ArgumentMatchers.anyString())).thenReturn("Alarm: %s")
sut = ActionAlarm(injector) sut = ActionAlarm(injector)

View file

@ -18,8 +18,9 @@ class ActionLoopDisableTest : ActionsTestBase() {
fun setup() { fun setup() {
testPumpPlugin.pumpDescription.isTempBasalCapable = true testPumpPlugin.pumpDescription.isTempBasalCapable = true
`when`(context.getString(info.nightscout.core.main.R.string.disableloop)).thenReturn("Disable loop")
`when`(rh.gs(info.nightscout.core.main.R.string.disableloop)).thenReturn("Disable loop") `when`(rh.gs(info.nightscout.core.main.R.string.disableloop)).thenReturn("Disable loop")
`when`(rh.gs(R.string.alreadydisabled)).thenReturn("Disable loop") `when`(context.getString(R.string.alreadydisabled)).thenReturn("Already disabled")
sut = ActionLoopDisable(injector) sut = ActionLoopDisable(injector)
} }

View file

@ -18,7 +18,7 @@ class ActionLoopEnableTest : ActionsTestBase() {
testPumpPlugin.pumpDescription.isTempBasalCapable = true testPumpPlugin.pumpDescription.isTempBasalCapable = true
`when`(rh.gs(info.nightscout.core.main.R.string.enableloop)).thenReturn("Enable loop") `when`(rh.gs(info.nightscout.core.main.R.string.enableloop)).thenReturn("Enable loop")
`when`(rh.gs(R.string.alreadyenabled)).thenReturn("Already enabled") `when`(context.getString(R.string.alreadyenabled)).thenReturn("Already enabled")
sut = ActionLoopEnable(injector) sut = ActionLoopEnable(injector)
} }

View file

@ -1,9 +1,9 @@
package info.nightscout.automation.actions package info.nightscout.automation.actions
import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction
import info.nightscout.database.impl.transactions.Transaction
import info.nightscout.automation.R import info.nightscout.automation.R
import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.TemporaryTarget
import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction
import info.nightscout.database.impl.transactions.Transaction
import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.Callback
import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.core.Single
import org.junit.Assert import org.junit.Assert
@ -19,7 +19,7 @@ class ActionLoopResumeTest : ActionsTestBase() {
fun setup() { fun setup() {
`when`(rh.gs(info.nightscout.core.main.R.string.resumeloop)).thenReturn("Resume loop") `when`(rh.gs(info.nightscout.core.main.R.string.resumeloop)).thenReturn("Resume loop")
`when`(rh.gs(R.string.notsuspended)).thenReturn("Not suspended") `when`(context.getString(R.string.notsuspended)).thenReturn("Not suspended")
sut = ActionLoopResume(injector) sut = ActionLoopResume(injector)
} }

View file

@ -1,8 +1,8 @@
package info.nightscout.automation.actions package info.nightscout.automation.actions
import info.nightscout.interfaces.queue.Callback
import info.nightscout.automation.R import info.nightscout.automation.R
import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputDuration
import info.nightscout.interfaces.queue.Callback
import org.junit.Assert import org.junit.Assert
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
@ -17,9 +17,9 @@ class ActionLoopSuspendTest : ActionsTestBase() {
@Before @Before
fun setup() { fun setup() {
`when`(rh.gs(info.nightscout.core.main.R.string.suspendloop)).thenReturn("Suspend loop") `when`(context.getString(info.nightscout.core.main.R.string.suspendloop)).thenReturn("Suspend loop")
`when`(rh.gs(ArgumentMatchers.eq(R.string.suspendloopforXmin), ArgumentMatchers.anyInt())).thenReturn("Suspend loop for %d min") `when`(rh.gs(ArgumentMatchers.eq(R.string.suspendloopforXmin), ArgumentMatchers.anyInt())).thenReturn("Suspend loop for %d min")
`when`(rh.gs(R.string.alreadysuspended)).thenReturn("Already suspended") `when`(context.getString(R.string.alreadysuspended)).thenReturn("Already suspended")
sut = ActionLoopSuspend(injector) sut = ActionLoopSuspend(injector)
} }

View file

@ -1,5 +1,6 @@
package info.nightscout.automation.actions package info.nightscout.automation.actions
import android.content.Context
import dagger.android.AndroidInjector import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestBase
@ -8,6 +9,7 @@ import info.nightscout.automation.elements.InputString
import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.AppRepository
import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction
import info.nightscout.database.impl.transactions.Transaction import info.nightscout.database.impl.transactions.Transaction
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.Callback
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper
@ -23,6 +25,7 @@ import org.mockito.Mockito.`when`
class ActionNotificationTest : TestBase() { class ActionNotificationTest : TestBase() {
@Mock lateinit var rh: ResourceHelper @Mock lateinit var rh: ResourceHelper
@Mock lateinit var context: Context
@Mock lateinit var rxBus: RxBus @Mock lateinit var rxBus: RxBus
@Mock lateinit var repository: AppRepository @Mock lateinit var repository: AppRepository
@ -34,15 +37,15 @@ class ActionNotificationTest : TestBase() {
it.rxBus = rxBus it.rxBus = rxBus
it.repository = repository it.repository = repository
} }
if (it is PumpEnactResultObject) { if (it is PumpEnactResult) {
it.rh = rh it.context = context
} }
} }
} }
@Before @Before
fun setup() { fun setup() {
`when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK") `when`(context.getString(info.nightscout.core.main.R.string.ok)).thenReturn("OK")
`when`(rh.gs(info.nightscout.core.main.R.string.notification)).thenReturn("Notification") `when`(rh.gs(info.nightscout.core.main.R.string.notification)).thenReturn("Notification")
`when`( `when`(
rh.gs( rh.gs(

View file

@ -1,8 +1,8 @@
package info.nightscout.automation.actions package info.nightscout.automation.actions
import info.nightscout.interfaces.queue.Callback
import info.nightscout.automation.R import info.nightscout.automation.R
import info.nightscout.automation.elements.InputProfileName import info.nightscout.automation.elements.InputProfileName
import info.nightscout.interfaces.queue.Callback
import org.junit.Assert import org.junit.Assert
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
@ -22,10 +22,10 @@ class ActionProfileSwitchTest : ActionsTestBase() {
@Before fun setUp() { @Before fun setUp() {
`when`(rh.gs(R.string.profilename)).thenReturn("Change profile to") `when`(rh.gs(R.string.profilename)).thenReturn("Change profile to")
`when`(rh.gs(ArgumentMatchers.eq(R.string.changengetoprofilename), ArgumentMatchers.anyString())).thenReturn("Change profile to %s") `when`(rh.gs(ArgumentMatchers.eq(R.string.changengetoprofilename), ArgumentMatchers.anyString())).thenReturn("Change profile to %s")
`when`(rh.gs(R.string.alreadyset)).thenReturn("Already set") `when`(context.getString(R.string.alreadyset)).thenReturn("Already set")
`when`(rh.gs(info.nightscout.core.main.R.string.notexists)).thenReturn("not exists") `when`(context.getString(info.nightscout.core.main.R.string.notexists)).thenReturn("not exists")
`when`(rh.gs(info.nightscout.core.main.R.string.error_field_must_not_be_empty)).thenReturn("The field must not be empty") `when`(context.getString(info.nightscout.core.main.R.string.error_field_must_not_be_empty)).thenReturn("The field must not be empty")
`when`(rh.gs(info.nightscout.core.main.R.string.noprofile)).thenReturn("No profile loaded from NS yet") `when`(context.getString(info.nightscout.core.main.R.string.noprofile)).thenReturn("No profile loaded from NS yet")
sut = ActionProfileSwitch(injector) sut = ActionProfileSwitch(injector)
} }

View file

@ -1,5 +1,6 @@
package info.nightscout.automation.actions package info.nightscout.automation.actions
import android.content.Context
import dagger.android.AndroidInjector import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestBaseWithProfile
@ -16,6 +17,7 @@ import info.nightscout.interfaces.plugin.PluginBase
import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginDescription
import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.Profile
import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.interfaces.profile.ProfileSource
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.interfaces.smsCommunicator.SmsCommunicator
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
@ -65,6 +67,7 @@ ActionsTestBase : TestBaseWithProfile() {
@Mock lateinit var smsCommunicator: SmsCommunicator @Mock lateinit var smsCommunicator: SmsCommunicator
@Mock lateinit var loopPlugin: TestLoopPlugin @Mock lateinit var loopPlugin: TestLoopPlugin
@Mock lateinit var uel: UserEntryLogger @Mock lateinit var uel: UserEntryLogger
@Mock lateinit var context: Context
private val pluginDescription = PluginDescription() private val pluginDescription = PluginDescription()
lateinit var testPumpPlugin: TestPumpPlugin lateinit var testPumpPlugin: TestPumpPlugin
@ -156,8 +159,8 @@ ActionsTestBase : TestBaseWithProfile() {
if (it is ActionStopProcessing) { if (it is ActionStopProcessing) {
it.rh = rh it.rh = rh
} }
if (it is PumpEnactResultObject) { if (it is PumpEnactResult) {
it.rh = rh it.context = context
} }
if (it is Trigger) { if (it is Trigger) {
it.rh = rh it.rh = rh
@ -179,7 +182,7 @@ ActionsTestBase : TestBaseWithProfile() {
`when`(activePlugin.activeProfileSource).thenReturn(profilePlugin) `when`(activePlugin.activeProfileSource).thenReturn(profilePlugin)
`when`(profilePlugin.profile).thenReturn(getValidProfileStore()) `when`(profilePlugin.profile).thenReturn(getValidProfileStore())
`when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK") `when`(context.getString(info.nightscout.core.main.R.string.ok)).thenReturn("OK")
`when`(rh.gs(info.nightscout.core.main.R.string.error)).thenReturn("Error") `when`(context.getString(info.nightscout.core.main.R.string.error)).thenReturn("Error")
} }
} }

View file

@ -9,7 +9,6 @@ import android.view.Window
import android.view.WindowManager import android.view.WindowManager
import dagger.android.support.DaggerDialogFragment import dagger.android.support.DaggerDialogFragment
import info.nightscout.androidaps.activities.DialogAppCompatActivity import info.nightscout.androidaps.activities.DialogAppCompatActivity
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
import info.nightscout.core.main.R import info.nightscout.core.main.R
@ -20,6 +19,7 @@ import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.events.EventOverviewBolusProgress
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper

View file

@ -0,0 +1,43 @@
package info.nightscout.core.pumpExtensions
import info.nightscout.androidaps.utils.DecimalFormatter
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.shared.interfaces.ResourceHelper
fun PumpEnactResult.toHtml(rh: ResourceHelper): String {
var ret = "<b>" + rh.gs(info.nightscout.core.main.R.string.success) + "</b>: " + success
if (queued) {
ret = rh.gs(info.nightscout.core.main.R.string.waitingforpumpresult)
} else if (enacted) {
when {
bolusDelivered > 0 -> {
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.enacted) + "</b>: " + enacted
if (comment.isNotEmpty()) ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.smb_shortname) + "</b>: " + bolusDelivered + " " + rh.gs(info.nightscout.core.main.R.string.insulin_unit_shortname)
}
isTempCancel -> {
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.enacted) + "</b>: " + enacted
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment +
"<br>" + rh.gs(info.nightscout.core.main.R.string.cancel_temp)
}
isPercent && percent != -1 -> {
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.enacted) + "</b>: " + enacted
if (comment.isNotEmpty()) ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.duration) + "</b>: " + duration + " min"
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.percent) + "</b>: " + percent + "%"
}
absolute != -1.0 -> {
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.enacted) + "</b>: " + enacted
if (comment.isNotEmpty()) ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.duration) + "</b>: " + duration + " min"
ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.absolute) + "</b>: " + DecimalFormatter.to2Decimal(absolute) + " U/h"
}
}
} else {
if (comment.isNotEmpty()) ret += "<br><b>" + rh.gs(info.nightscout.core.main.R.string.comment) + "</b>: " + comment
}
return ret
}

View file

@ -110,14 +110,9 @@
<string name="tempbasaldeliveryerror">Tempbasal delivery error</string> <string name="tempbasaldeliveryerror">Tempbasal delivery error</string>
<string name="goingtodeliver">Going to deliver %1$.2f U</string> <string name="goingtodeliver">Going to deliver %1$.2f U</string>
<string name="waitingforpump">Waiting for pump</string> <string name="waitingforpump">Waiting for pump</string>
<string name="connectingfor">Connecting for %1$d s</string>
<string name="bolusdelivering">Delivering %1$.2f U</string> <string name="bolusdelivering">Delivering %1$.2f U</string>
<string name="handshaking">Handshaking</string>
<string name="connecting">Connecting</string> <string name="connecting">Connecting</string>
<string name="connected">Connected</string>
<string name="disconnected">Disconnected</string> <string name="disconnected">Disconnected</string>
<string name="disconnecting">Disconnecting</string>
<string name="waiting_for_disconnection">Waiting for disconnection</string>
<string name="androidaps_start">AAPS started</string> <string name="androidaps_start">AAPS started</string>
<string name="formatinsulinunits1">%1$.1f U</string> <string name="formatinsulinunits1">%1$.1f U</string>
<string name="formatinsulinunits">%1$.2f U</string> <string name="formatinsulinunits">%1$.2f U</string>

View file

@ -5,7 +5,6 @@ import android.content.Context
import android.os.Build import android.os.Build
import android.os.PowerManager import android.os.PowerManager
import android.os.SystemClock import android.os.SystemClock
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.safeDisable import info.nightscout.androidaps.extensions.safeDisable
import info.nightscout.androidaps.extensions.safeEnable import info.nightscout.androidaps.extensions.safeEnable
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
@ -16,6 +15,7 @@ import info.nightscout.interfaces.Constants
import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.ActivePlugin
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.events.EventQueueChanged import info.nightscout.rx.events.EventQueueChanged
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag

View file

@ -24,6 +24,7 @@ import info.nightscout.interfaces.constraints.Constraints
import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.ActivePlugin
import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.profile.ProfileFunction
import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.DetailedBolusInfo
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.PumpSync
import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.Callback
import info.nightscout.interfaces.queue.Command import info.nightscout.interfaces.queue.Command
@ -104,8 +105,8 @@ class CommandQueueImplementationTest : TestBaseWithProfile() {
if (it is CommandLoadHistory) { if (it is CommandLoadHistory) {
it.activePlugin = activePlugin it.activePlugin = activePlugin
} }
if (it is PumpEnactResultObject) { if (it is PumpEnactResult) {
it.rh = rh it.context = context
} }
} }
} }
@ -254,7 +255,7 @@ class CommandQueueImplementationTest : TestBaseWithProfile() {
Assert.assertEquals(2, commandQueue.size()) Assert.assertEquals(2, commandQueue.size())
// when // when
commandQueue.cancelAllBoluses(anyLong()) commandQueue.cancelAllBoluses(null)
// then // then
Assert.assertEquals(0, commandQueue.size()) Assert.assertEquals(0, commandQueue.size())

View file

@ -0,0 +1,40 @@
package info.nightscout.plugins.extensions
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.shared.interfaces.ResourceHelper
fun PumpEnactResult.toText(rh: ResourceHelper): String {
var ret = rh.gs(info.nightscout.core.main.R.string.success) + ": " + success
if (enacted) {
when {
bolusDelivered > 0 -> {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.enacted)}: $enacted"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.configbuilder_insulin)}: $bolusDelivered ${rh.gs(info.nightscout.core.main.R.string.insulin_unit_shortname)}"
}
isTempCancel -> {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.enacted)}: $enacted"
if (comment.isNotEmpty()) ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.cancel_temp)}"
}
isPercent -> {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.enacted)}: $enacted"
if (comment.isNotEmpty()) ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.duration)}: $duration min"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.percent)}: $percent%"
}
else -> {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.enacted)}: $enacted"
if (comment.isNotEmpty()) ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.duration)}: $duration min"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.absolute)}: $absolute U/h"
}
}
} else {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
}
return ret
}

View file

@ -28,6 +28,7 @@ import info.nightscout.interfaces.pump.defs.PumpType
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.interfaces.utils.TimeChangeType
import info.nightscout.plugins.R import info.nightscout.plugins.R
import info.nightscout.plugins.extensions.toText
import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
@ -399,40 +400,4 @@ open class VirtualPumpPlugin @Inject constructor(
} }
override fun timezoneOrDSTChanged(timeChangeType: TimeChangeType) {} override fun timezoneOrDSTChanged(timeChangeType: TimeChangeType) {}
private fun PumpEnactResult.toText(rh: ResourceHelper): String {
var ret = rh.gs(info.nightscout.core.main.R.string.success) + ": " + success
if (enacted) {
when {
bolusDelivered > 0 -> {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.enacted)}: $enacted"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.configbuilder_insulin)}: $bolusDelivered ${rh.gs(info.nightscout.core.main.R.string.insulin_unit_shortname)}"
}
isTempCancel -> {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.enacted)}: $enacted"
if (comment.isNotEmpty()) ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.cancel_temp)}"
}
isPercent -> {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.enacted)}: $enacted"
if (comment.isNotEmpty()) ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.duration)}: $duration min"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.percent)}: $percent%"
}
else -> {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.enacted)}: $enacted"
if (comment.isNotEmpty()) ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.duration)}: $duration min"
ret += "\n${rh.gs(info.nightscout.core.main.R.string.absolute)}: $absolute U/h"
}
}
} else {
ret += "\n${rh.gs(info.nightscout.core.main.R.string.comment)}: $comment"
}
return ret
}
} }

View file

@ -70,8 +70,8 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() {
var injector: HasAndroidInjector = HasAndroidInjector { var injector: HasAndroidInjector = HasAndroidInjector {
AndroidInjector { AndroidInjector {
if (it is PumpEnactResultObject) { if (it is PumpEnactResult) {
it.rh = rh it.context = context
} }
if (it is AuthRequest) { if (it is AuthRequest) {
it.aapsLogger = aapsLogger it.aapsLogger = aapsLogger

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.pump.combo package info.nightscout.androidaps.plugins.pump.combo
import android.content.Context
import dagger.android.AndroidInjector import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestBase
@ -9,6 +10,7 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus
import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraint
import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.plugin.PluginType
import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.profile.ProfileFunction
import info.nightscout.interfaces.pump.PumpEnactResult
import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.PumpSync
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
@ -30,11 +32,12 @@ class ComboPluginTest : TestBase() {
@Mock lateinit var sp: SP @Mock lateinit var sp: SP
@Mock lateinit var dateUtil: DateUtil @Mock lateinit var dateUtil: DateUtil
@Mock lateinit var ruffyScripter: RuffyScripter @Mock lateinit var ruffyScripter: RuffyScripter
@Mock lateinit var context: Context
private val injector = HasAndroidInjector { private val injector = HasAndroidInjector {
AndroidInjector { AndroidInjector {
if (it is PumpEnactResultObject) { if (it is PumpEnactResult) {
it.rh = rh it.context = context
} }
} }
} }
@ -44,7 +47,7 @@ class ComboPluginTest : TestBase() {
@Before @Before
fun prepareMocks() { fun prepareMocks() {
`when`(rh.gs(R.string.novalidbasalrate)).thenReturn("No valid basal rate read from pump") `when`(rh.gs(R.string.novalidbasalrate)).thenReturn("No valid basal rate read from pump")
`when`(rh.gs(R.string.combo_pump_unsupported_operation)).thenReturn("Requested operation not supported by pump") `when`(context.getString(R.string.combo_pump_unsupported_operation)).thenReturn("Requested operation not supported by pump")
comboPlugin = ComboPlugin(injector, aapsLogger, RxBus(aapsSchedulers, aapsLogger), rh, profileFunction, sp, commandQueue, pumpSync, dateUtil, ruffyScripter) comboPlugin = ComboPlugin(injector, aapsLogger, RxBus(aapsSchedulers, aapsLogger), rh, profileFunction, sp, commandQueue, pumpSync, dateUtil, ruffyScripter)
} }

View file

@ -14,7 +14,6 @@ import info.nightscout.androidaps.dana.activities.DanaHistoryActivity
import info.nightscout.androidaps.dana.activities.DanaUserOptionsActivity import info.nightscout.androidaps.dana.activities.DanaUserOptionsActivity
import info.nightscout.androidaps.dana.databinding.DanarFragmentBinding import info.nightscout.androidaps.dana.databinding.DanarFragmentBinding
import info.nightscout.androidaps.dana.events.EventDanaRNewStatus import info.nightscout.androidaps.dana.events.EventDanaRNewStatus
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.logging.UserEntryLogger
import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.WarnColors
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
@ -31,6 +30,7 @@ import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.events.EventExtendedBolusChange
import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.events.EventInitializationChanged
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.events.EventQueueChanged import info.nightscout.rx.events.EventQueueChanged
import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.events.EventTempBasalChange
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger

View file

@ -15,7 +15,6 @@ import info.nightscout.androidaps.dana.database.DanaHistoryRecord
import info.nightscout.androidaps.dana.database.DanaHistoryRecordDao import info.nightscout.androidaps.dana.database.DanaHistoryRecordDao
import info.nightscout.androidaps.dana.databinding.DanarHistoryActivityBinding import info.nightscout.androidaps.dana.databinding.DanarHistoryActivityBinding
import info.nightscout.androidaps.dana.databinding.DanarHistoryItemBinding import info.nightscout.androidaps.dana.databinding.DanarHistoryItemBinding
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DecimalFormatter
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
import info.nightscout.core.profile.toUnitsString import info.nightscout.core.profile.toUnitsString
@ -28,6 +27,7 @@ import info.nightscout.interfaces.queue.Callback
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.rx.events.EventDanaRSyncStatus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.DateUtil
import info.nightscout.shared.utils.T import info.nightscout.shared.utils.T

View file

@ -37,7 +37,6 @@ import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended;
import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal;
import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService; import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService;
import info.nightscout.androidaps.dialogs.BolusProgressDialog; import info.nightscout.androidaps.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.interfaces.Constants; import info.nightscout.interfaces.Constants;
import info.nightscout.interfaces.constraints.Constraints; import info.nightscout.interfaces.constraints.Constraints;
@ -54,6 +53,7 @@ import info.nightscout.rx.bus.RxBus;
import info.nightscout.rx.events.EventInitializationChanged; import info.nightscout.rx.events.EventInitializationChanged;
import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventOverviewBolusProgress;
import info.nightscout.rx.events.EventProfileSwitchChanged; import info.nightscout.rx.events.EventProfileSwitchChanged;
import info.nightscout.rx.events.EventPumpStatusChanged;
import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.AAPSLogger;
import info.nightscout.rx.logging.LTag; import info.nightscout.rx.logging.LTag;
import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.interfaces.ResourceHelper;

View file

@ -4,10 +4,10 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.dana.DanaPump 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.interfaces.pump.defs.PumpType import info.nightscout.interfaces.pump.defs.PumpType
import info.nightscout.shared.utils.T import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.utils.T
import java.util.GregorianCalendar import java.util.GregorianCalendar
class MsgHistoryEventsV2 constructor( class MsgHistoryEventsV2 constructor(

View file

@ -49,7 +49,6 @@ import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended;
import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal;
import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService; import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService;
import info.nightscout.androidaps.dialogs.BolusProgressDialog; import info.nightscout.androidaps.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.interfaces.Constants; import info.nightscout.interfaces.Constants;
import info.nightscout.interfaces.notifications.Notification; import info.nightscout.interfaces.notifications.Notification;
@ -68,6 +67,7 @@ import info.nightscout.rx.bus.RxBus;
import info.nightscout.rx.events.EventInitializationChanged; import info.nightscout.rx.events.EventInitializationChanged;
import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventOverviewBolusProgress;
import info.nightscout.rx.events.EventProfileSwitchChanged; import info.nightscout.rx.events.EventProfileSwitchChanged;
import info.nightscout.rx.events.EventPumpStatusChanged;
import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.AAPSLogger;
import info.nightscout.rx.logging.LTag; import info.nightscout.rx.logging.LTag;
import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.interfaces.ResourceHelper;

View file

@ -39,7 +39,6 @@ import info.nightscout.androidaps.danar.comm.MsgHistoryRefill;
import info.nightscout.androidaps.danar.comm.MsgHistorySuspend; import info.nightscout.androidaps.danar.comm.MsgHistorySuspend;
import info.nightscout.androidaps.danar.comm.MsgPCCommStart; import info.nightscout.androidaps.danar.comm.MsgPCCommStart;
import info.nightscout.androidaps.danar.comm.MsgPCCommStop; import info.nightscout.androidaps.danar.comm.MsgPCCommStop;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.utils.ToastUtils; import info.nightscout.androidaps.utils.ToastUtils;
import info.nightscout.core.fabric.FabricPrivacy; import info.nightscout.core.fabric.FabricPrivacy;
@ -53,6 +52,7 @@ import info.nightscout.rx.bus.RxBus;
import info.nightscout.rx.events.EventAppExit; import info.nightscout.rx.events.EventAppExit;
import info.nightscout.rx.events.EventBTChange; import info.nightscout.rx.events.EventBTChange;
import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventOverviewBolusProgress;
import info.nightscout.rx.events.EventPumpStatusChanged;
import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.AAPSLogger;
import info.nightscout.rx.logging.LTag; import info.nightscout.rx.logging.LTag;
import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.interfaces.ResourceHelper;

View file

@ -44,7 +44,6 @@ import info.nightscout.androidaps.danar.comm.MsgStatusBasic;
import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended; import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended;
import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal;
import info.nightscout.androidaps.dialogs.BolusProgressDialog; import info.nightscout.androidaps.dialogs.BolusProgressDialog;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.interfaces.Constants; import info.nightscout.interfaces.Constants;
import info.nightscout.interfaces.notifications.Notification; import info.nightscout.interfaces.notifications.Notification;
@ -60,6 +59,7 @@ import info.nightscout.rx.bus.RxBus;
import info.nightscout.rx.events.EventInitializationChanged; import info.nightscout.rx.events.EventInitializationChanged;
import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventOverviewBolusProgress;
import info.nightscout.rx.events.EventProfileSwitchChanged; import info.nightscout.rx.events.EventProfileSwitchChanged;
import info.nightscout.rx.events.EventPumpStatusChanged;
import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.AAPSLogger;
import info.nightscout.rx.logging.LTag; import info.nightscout.rx.logging.LTag;
import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.interfaces.ResourceHelper;

View file

@ -7,13 +7,13 @@ import info.nightscout.androidaps.danars.DanaRSPlugin
import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.R
import info.nightscout.androidaps.danars.databinding.DanarsEnterPinActivityBinding import info.nightscout.androidaps.danars.databinding.DanarsEnterPinActivityBinding
import info.nightscout.androidaps.danars.services.BLEComm import info.nightscout.androidaps.danars.services.BLEComm
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.hexStringToByteArray import info.nightscout.androidaps.extensions.hexStringToByteArray
import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.textValidator.DefaultEditTextValidator import info.nightscout.androidaps.utils.textValidator.DefaultEditTextValidator
import info.nightscout.androidaps.utils.textValidator.EditTextValidator import info.nightscout.androidaps.utils.textValidator.EditTextValidator
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import javax.inject.Inject import javax.inject.Inject

View file

@ -4,12 +4,12 @@ import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.dana.DanaPump
import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.R
import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.androidaps.danars.encryption.BleEncryption
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage
import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.DetailedBolusInfo
import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.PumpSync
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP

View file

@ -30,7 +30,6 @@ import info.nightscout.androidaps.danars.comm.DanaRSPacketEtcKeepConnection
import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.androidaps.danars.encryption.BleEncryption
import info.nightscout.androidaps.danars.encryption.EncryptionType import info.nightscout.androidaps.danars.encryption.EncryptionType
import info.nightscout.androidaps.danars.events.EventDanaRSPairingSuccess import info.nightscout.androidaps.danars.events.EventDanaRSPairingSuccess
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.notify
import info.nightscout.androidaps.extensions.waitMillis import info.nightscout.androidaps.extensions.waitMillis
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
@ -39,6 +38,7 @@ import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.notifications.Notification
import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.PumpSync
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper

View file

@ -55,7 +55,6 @@ import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionSetPumpTime
import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionSetPumpUTCAndTimeZone import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionSetPumpUTCAndTimeZone
import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionSetUserOption import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionSetUserOption
import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.dialogs.BolusProgressDialog
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
import info.nightscout.interfaces.Constants import info.nightscout.interfaces.Constants
@ -76,6 +75,7 @@ import info.nightscout.rx.events.EventAppExit
import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.events.EventInitializationChanged
import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.events.EventOverviewBolusProgress
import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.events.EventProfileSwitchChanged
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper

View file

@ -13,7 +13,6 @@ import info.nightscout.androidaps.diaconn.activities.DiaconnG8HistoryActivity
import info.nightscout.androidaps.diaconn.activities.DiaconnG8UserOptionsActivity import info.nightscout.androidaps.diaconn.activities.DiaconnG8UserOptionsActivity
import info.nightscout.androidaps.diaconn.databinding.DiaconnG8FragmentBinding import info.nightscout.androidaps.diaconn.databinding.DiaconnG8FragmentBinding
import info.nightscout.androidaps.diaconn.events.EventDiaconnG8NewStatus import info.nightscout.androidaps.diaconn.events.EventDiaconnG8NewStatus
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.WarnColors
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.ActivePlugin
@ -24,6 +23,7 @@ import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.events.EventExtendedBolusChange
import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.events.EventInitializationChanged
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.events.EventQueueChanged import info.nightscout.rx.events.EventQueueChanged
import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.events.EventTempBasalChange
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger

View file

@ -15,7 +15,6 @@ import info.nightscout.androidaps.diaconn.common.RecordTypes
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryRecord import info.nightscout.androidaps.diaconn.database.DiaconnHistoryRecord
import info.nightscout.androidaps.diaconn.database.DiaconnHistoryRecordDao import info.nightscout.androidaps.diaconn.database.DiaconnHistoryRecordDao
import info.nightscout.androidaps.diaconn.databinding.DiaconnG8HistoryActivityBinding import info.nightscout.androidaps.diaconn.databinding.DiaconnG8HistoryActivityBinding
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DecimalFormatter
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.ActivePlugin
@ -23,6 +22,7 @@ import info.nightscout.interfaces.profile.ProfileFunction
import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.Callback
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.DateUtil
import info.nightscout.shared.utils.T import info.nightscout.shared.utils.T
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable

View file

@ -38,7 +38,6 @@ import info.nightscout.androidaps.diaconn.pumplog.LOG_SUSPEND_V2
import info.nightscout.androidaps.diaconn.pumplog.LOG_TB_START_V3 import info.nightscout.androidaps.diaconn.pumplog.LOG_TB_START_V3
import info.nightscout.androidaps.diaconn.pumplog.LOG_TB_STOP_V3 import info.nightscout.androidaps.diaconn.pumplog.LOG_TB_STOP_V3
import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage
import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.plugin.ActivePlugin
@ -47,6 +46,7 @@ import info.nightscout.interfaces.pump.PumpSync
import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpDescription
import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.pump.defs.PumpType
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.extensions.safeGetPackageInfo import info.nightscout.shared.extensions.safeGetPackageInfo
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper

View file

@ -25,12 +25,12 @@ import info.nightscout.androidaps.diaconn.packet.DiaconnG8ResponseMessageHashTab
import info.nightscout.androidaps.diaconn.packet.DiaconnG8SettingResponseMessageHashTable import info.nightscout.androidaps.diaconn.packet.DiaconnG8SettingResponseMessageHashTable
import info.nightscout.androidaps.diaconn.packet.InjectionBlockReportPacket import info.nightscout.androidaps.diaconn.packet.InjectionBlockReportPacket
import info.nightscout.androidaps.diaconn.packet.InsulinLackReportPacket import info.nightscout.androidaps.diaconn.packet.InsulinLackReportPacket
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.notify
import info.nightscout.androidaps.extensions.waitMillis import info.nightscout.androidaps.extensions.waitMillis
import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.ToastUtils
import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper

View file

@ -45,7 +45,6 @@ import info.nightscout.androidaps.diaconn.packet.TimeInquirePacket
import info.nightscout.androidaps.diaconn.packet.TimeSettingPacket import info.nightscout.androidaps.diaconn.packet.TimeSettingPacket
import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil
import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.dialogs.BolusProgressDialog
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
@ -68,6 +67,7 @@ import info.nightscout.rx.events.EventAppExit
import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.events.EventInitializationChanged
import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.events.EventOverviewBolusProgress
import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.events.EventProfileSwitchChanged
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.AAPSLogger
import info.nightscout.rx.logging.LTag import info.nightscout.rx.logging.LTag
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper

View file

@ -8,7 +8,6 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Singleton; import javax.inject.Singleton;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.plugins.pump.eopatch.R; import info.nightscout.androidaps.plugins.pump.eopatch.R;
import info.nightscout.androidaps.plugins.pump.eopatch.RxAction; import info.nightscout.androidaps.plugins.pump.eopatch.RxAction;
import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode;
@ -47,6 +46,7 @@ import info.nightscout.interfaces.queue.CommandQueue;
import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.AapsSchedulers;
import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.bus.RxBus;
import info.nightscout.rx.events.EventCustomActionsChanged; import info.nightscout.rx.events.EventCustomActionsChanged;
import info.nightscout.rx.events.EventPumpStatusChanged;
import info.nightscout.rx.events.EventRefreshOverview; import info.nightscout.rx.events.EventRefreshOverview;
import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.AAPSLogger;
import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.interfaces.ResourceHelper;

View file

@ -9,7 +9,6 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import dagger.android.support.DaggerFragment import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice
@ -34,6 +33,7 @@ import info.nightscout.pump.core.defs.PumpDeviceState
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.events.EventExtendedBolusChange
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.events.EventQueueChanged import info.nightscout.rx.events.EventQueueChanged
import info.nightscout.rx.events.EventRefreshButtonState import info.nightscout.rx.events.EventRefreshButtonState
import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.events.EventTempBasalChange

View file

@ -9,7 +9,6 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import dagger.android.support.DaggerFragment import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewButtonsBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewButtonsBinding
import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewPodInfoBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewPodInfoBinding
@ -39,6 +38,7 @@ import info.nightscout.interfaces.ui.ActivityNames
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventPreferenceChange import info.nightscout.rx.events.EventPreferenceChange
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.rx.events.EventQueueChanged import info.nightscout.rx.events.EventQueueChanged
import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.interfaces.ResourceHelper
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP

View file

@ -15,7 +15,6 @@ import android.widget.TableLayout
import android.widget.TableRow import android.widget.TableRow
import android.widget.TextView import android.widget.TextView
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
import info.nightscout.androidaps.events.EventPumpStatusChanged
import info.nightscout.androidaps.extensions.total import info.nightscout.androidaps.extensions.total
import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.fabric.FabricPrivacy
import info.nightscout.core.main.R import info.nightscout.core.main.R
@ -28,6 +27,7 @@ import info.nightscout.interfaces.queue.Callback
import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.AapsSchedulers
import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.rx.events.EventDanaRSyncStatus
import info.nightscout.rx.events.EventPumpStatusChanged
import info.nightscout.shared.SafeParse import info.nightscout.shared.SafeParse
import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.sharedPreferences.SP
import info.nightscout.shared.utils.T import info.nightscout.shared.utils.T