Add deterministic LGS function
This commit is contained in:
parent
585b45fb97
commit
01e8934f7a
1 changed files with 15 additions and 0 deletions
|
@ -288,6 +288,21 @@ public class LoopPlugin extends PluginBase {
|
|||
return true;
|
||||
}
|
||||
|
||||
public boolean isLGS(){
|
||||
Constraint<Boolean> closedLoopEnabled = constraintChecker.isClosedLoopAllowed();
|
||||
Double MaxIOBallowed = constraintChecker.getMaxIOBAllowed().value();
|
||||
String APSmode = sp.getString(R.string.key_aps_mode, "open");
|
||||
Double LGSthreshold = 0d;
|
||||
PumpInterface pump = activePlugin.getActivePump();
|
||||
boolean isLGS = false;
|
||||
if (!isSuspended() && !pump.isSuspended())
|
||||
if (closedLoopEnabled.value())
|
||||
if ((MaxIOBallowed.equals(LGSthreshold)) || (APSmode.equals("lgs")))
|
||||
isLGS = true;
|
||||
|
||||
return isLGS;
|
||||
}
|
||||
|
||||
public boolean isSuperBolus() {
|
||||
if (loopSuspendedTill == 0)
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue