Add deterministic LGS function

This commit is contained in:
Tim Gunn 2020-05-02 00:05:50 +12:00
parent 585b45fb97
commit 01e8934f7a
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C

View file

@ -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;