Merge pull request #398 from Tornado-Tim/fix-LGS-constraint
Fix Low Glucose Constraint
This commit is contained in:
commit
9345276f94
|
@ -18,6 +18,9 @@ class ConstraintChecker @Inject constructor(private val activePlugin: ActivePlug
|
|||
fun isClosedLoopAllowed(): Constraint<Boolean> =
|
||||
isClosedLoopAllowed(Constraint(true))
|
||||
|
||||
fun isLgsAllowed(): Constraint<Boolean> =
|
||||
isLgsAllowed(Constraint(true))
|
||||
|
||||
fun isAutosensModeEnabled(): Constraint<Boolean> =
|
||||
isAutosensModeEnabled(Constraint(true))
|
||||
|
||||
|
@ -77,6 +80,16 @@ class ConstraintChecker @Inject constructor(private val activePlugin: ActivePlug
|
|||
return value
|
||||
}
|
||||
|
||||
override fun isLgsAllowed(value: Constraint<Boolean>): Constraint<Boolean> {
|
||||
val constraintsPlugins = activePlugin.getSpecificPluginsListByInterface(ConstraintsInterface::class.java)
|
||||
for (p in constraintsPlugins) {
|
||||
val constraint = p as ConstraintsInterface
|
||||
if (!p.isEnabled(PluginType.CONSTRAINTS)) continue
|
||||
constraint.isLgsAllowed(value)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
override fun isAutosensModeEnabled(value: Constraint<Boolean>): Constraint<Boolean> {
|
||||
val constraintsPlugins = activePlugin.getSpecificPluginsListByInterface(ConstraintsInterface::class.java)
|
||||
for (p in constraintsPlugins) {
|
||||
|
|
Loading…
Reference in a new issue