fix canceling temp in open loop mode. credits to @warstar2187
This commit is contained in:
parent
d7dfe8942e
commit
bdd1a85d26
2 changed files with 8 additions and 4 deletions
|
@ -248,9 +248,11 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
|
||||||
determineBasalResultAMA.changeRequested = false;
|
determineBasalResultAMA.changeRequested = false;
|
||||||
// limit requests on openloop mode
|
// limit requests on openloop mode
|
||||||
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
||||||
if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1)
|
if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultAMA.rate == 0 && determineBasalResultAMA.duration == 0) {
|
||||||
|
// going to cancel
|
||||||
|
} else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) {
|
||||||
determineBasalResultAMA.changeRequested = false;
|
determineBasalResultAMA.changeRequested = false;
|
||||||
if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1)
|
} else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultAMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1)
|
||||||
determineBasalResultAMA.changeRequested = false;
|
determineBasalResultAMA.changeRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,9 +232,11 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
|
||||||
determineBasalResultMA.changeRequested = false;
|
determineBasalResultMA.changeRequested = false;
|
||||||
// limit requests on openloop mode
|
// limit requests on openloop mode
|
||||||
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
||||||
if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1)
|
if (MainApp.getConfigBuilder().isTempBasalInProgress() && determineBasalResultMA.rate == 0 && determineBasalResultMA.duration == 0) {
|
||||||
|
// going to cancel
|
||||||
|
} else if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory()) < 0.1) {
|
||||||
determineBasalResultMA.changeRequested = false;
|
determineBasalResultMA.changeRequested = false;
|
||||||
if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1)
|
} else if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResultMA.rate - ConfigBuilderPlugin.getActivePump().getBaseBasalRate()) < 0.1)
|
||||||
determineBasalResultMA.changeRequested = false;
|
determineBasalResultMA.changeRequested = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue