Allow/reenable the setting of TempTargets while pump is suspended or disconnected

Unfortunately, it is currently no longer possible to set a TempTarget when the pump is disconnected or suspended (TBR: 0%). This seems logical at first sight (why a TempTarget when the pump is not connected or the loop suspended!), but prevents many useful possibilities, namely when the TempTarget should be set immediately after the disconnection or suspension has expired.
An example of this are f. e. sport activities: To reduce IOB, I set a 0% TBR half an hour before sport for one hour with the function "pump disconnected", so that the associated 0% TBR continues for a while while sport starts. I also set a three hour Activity TempTarget. This continues to be active when the pump loops again with the pump disconnected time expired.
The fix allows/reenables setting a TempTarget even if the pump is suspended or disconnected.
This commit is contained in:
swissalpine 2021-12-05 14:11:51 +01:00 committed by GitHub
parent 2ec9517b02
commit 98f2df943c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -361,13 +361,10 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
activity, activity,
ProtectionCheck.Protection.BOLUS, ProtectionCheck.Protection.BOLUS,
UIRunnable { if (isAdded) CarbsDialog().show(childFragmentManager, "Overview") }) UIRunnable { if (isAdded) CarbsDialog().show(childFragmentManager, "Overview") })
R.id.temp_target -> R.id.temp_target -> protectionCheck.queryProtection(
if (loop.isDisconnected) OKDialog.show(activity, rh.gs(R.string.not_available_full), rh.gs(R.string.smscommunicator_pumpdisconnected)) activity,
else ProtectionCheck.Protection.BOLUS,
protectionCheck.queryProtection( UIRunnable { if (isAdded) TempTargetDialog().show(childFragmentManager, "Overview") })
activity,
ProtectionCheck.Protection.BOLUS,
UIRunnable { if (isAdded) TempTargetDialog().show(childFragmentManager, "Overview") })
R.id.active_profile -> { R.id.active_profile -> {
ProfileViewerDialog().also { pvd -> ProfileViewerDialog().also { pvd ->