show disabled closed reasons
This commit is contained in:
parent
867302dd29
commit
8d0d8d3866
3 changed files with 6 additions and 3 deletions
|
@ -130,13 +130,14 @@ class LoopFragment : DaggerFragment(), MenuProvider {
|
|||
binding.smbsetbypump.text = it.smbSetByPump?.let { smbSetByPump -> HtmlHelper.fromHtml(smbSetByPump.toHtml()) }
|
||||
?: ""
|
||||
|
||||
val constraints =
|
||||
var constraints =
|
||||
it.constraintsProcessed?.let { constraintsProcessed ->
|
||||
val allConstraints = Constraint(0.0)
|
||||
constraintsProcessed.rateConstraint?.let { rateConstraint -> allConstraints.copyReasons(rateConstraint) }
|
||||
constraintsProcessed.smbConstraint?.let { smbConstraint -> allConstraints.copyReasons(smbConstraint) }
|
||||
allConstraints.getMostLimitedReasons(aapsLogger)
|
||||
} ?: ""
|
||||
constraints += loop.closedLoopEnabled?.getReasons(aapsLogger) ?: ""
|
||||
binding.constraints.text = constraints
|
||||
binding.swipeRefresh.isRefreshing = false
|
||||
}
|
||||
|
|
|
@ -105,6 +105,7 @@ class LoopPlugin @Inject constructor(
|
|||
private var carbsSuggestionsSuspendedUntil: Long = 0
|
||||
private var prevCarbsreq = 0
|
||||
override var lastRun: LastRun? = null
|
||||
override var closedLoopEnabled: Constraint<Boolean>? = null
|
||||
|
||||
override fun onStart() {
|
||||
createNotificationChannel()
|
||||
|
@ -294,8 +295,8 @@ class LoopPlugin @Inject constructor(
|
|||
rxBus.send(EventLoopSetLastRunGui(rh.gs(R.string.pumpsuspended)))
|
||||
return
|
||||
}
|
||||
val closedLoopEnabled = constraintChecker.isClosedLoopAllowed()
|
||||
if (closedLoopEnabled.value()) {
|
||||
closedLoopEnabled = constraintChecker.isClosedLoopAllowed()
|
||||
if (closedLoopEnabled?.value() == true) {
|
||||
if (allowNotification) {
|
||||
if (resultAfterConstraints.isCarbsRequired
|
||||
&& resultAfterConstraints.carbsReq >= sp.getInt(
|
||||
|
|
|
@ -22,6 +22,7 @@ interface Loop {
|
|||
}
|
||||
|
||||
var lastRun: LastRun?
|
||||
var closedLoopEnabled: Constraint<Boolean>?
|
||||
val isSuspended: Boolean
|
||||
val isLGS: Boolean
|
||||
val isSuperBolus: Boolean
|
||||
|
|
Loading…
Reference in a new issue