limit requests on openloop mode
This commit is contained in:
parent
34d2178878
commit
47bff5ad5e
|
@ -177,6 +177,13 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
|
||||||
DetermineBasalResult determineBasalResult = determineBasalAdapterJS.invoke();
|
DetermineBasalResult determineBasalResult = determineBasalAdapterJS.invoke();
|
||||||
// Fix bug determine basal
|
// Fix bug determine basal
|
||||||
if (determineBasalResult.rate == 0d && determineBasalResult.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) determineBasalResult.changeRequested = false;
|
if (determineBasalResult.rate == 0d && determineBasalResult.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) determineBasalResult.changeRequested = false;
|
||||||
|
// limit requests on openloop mode
|
||||||
|
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
||||||
|
if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResult.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRate()) < 0.1)
|
||||||
|
determineBasalResult.changeRequested = false;
|
||||||
|
if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResult.rate - MainApp.getConfigBuilder().getBaseBasalRate()) < 0.1)
|
||||||
|
determineBasalResult.changeRequested = false;
|
||||||
|
}
|
||||||
|
|
||||||
determineBasalResult.iob = iobTotal;
|
determineBasalResult.iob = iobTotal;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue