Show disconnected icon in overview for Omnipod when Pod is suspended and hide disconnect buttons in overview for Omnipod

This commit is contained in:
Bart Sopers 2020-11-11 20:12:57 +01:00
parent a875a9c437
commit c16fc3a946
2 changed files with 14 additions and 2 deletions

View file

@ -56,6 +56,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.plugins.source.DexcomPlugin
import info.nightscout.androidaps.plugins.source.XdripPlugin
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
@ -616,7 +617,13 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
}
pump.isSuspended -> {
overview_apsmode?.setImageResource(R.drawable.ic_loop_paused)
overview_apsmode?.setImageResource(if (pump.pumpDescription.pumpType == PumpType.Insulet_Omnipod) {
// For Omnipod, indicate the pump as disconnected when it's suspended.
// The only way to 'reconnect' it, is through the Omnipod tab
R.drawable.ic_loop_disconnected
} else {
R.drawable.ic_loop_paused
})
overview_apsmode_text?.text = ""
}

View file

@ -34,6 +34,7 @@ import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.DefaultValueHelper
@ -198,7 +199,11 @@ class OverviewMenus @Inject constructor(
menu.add(resourceHelper.gs(R.string.enableloop))
}
if (!loopPlugin.isDisconnected) {
if(pumpDescription.pumpType != PumpType.Insulet_Omnipod) {
// Don't show the disconnect menu for Omnipod,
// as an Omnipod is attached to your body and cannot be physically disconnected.
showSuspendPump(menu, pumpDescription)
}
} else {
menu.add(resourceHelper.gs(R.string.reconnect))
}