Cleanup.
This commit is contained in:
parent
fa81f57d9f
commit
2b8b6828e5
1 changed files with 7 additions and 11 deletions
|
@ -21,23 +21,18 @@ public class CancelTbrCommand extends BaseCommand {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String reconnectAlarm() {
|
||||||
|
return "TBR CANCELLED";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommandResult execute() {
|
public CommandResult execute() {
|
||||||
try {
|
try {
|
||||||
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
|
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
|
||||||
PumpState pumpState = scripter.readPumpStateInternal();
|
PumpState pumpState = scripter.readPumpStateInternal();
|
||||||
if (!pumpState.tbrActive) {
|
if (!pumpState.tbrActive) {
|
||||||
// log.debug("active temp basal 90s ago: " +
|
log.debug("No TBR active to cancel");
|
||||||
// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 90 * 1000));
|
|
||||||
// log.debug("active temp basal 60s ago: " +
|
|
||||||
// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 30 * 1000));
|
|
||||||
// log.debug("active temp basal 30s ago: " +
|
|
||||||
// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis() - 30 * 1000));
|
|
||||||
// log.debug("active temp basal now:: " +
|
|
||||||
// MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()));
|
|
||||||
// TODO keep checking logs to ensure this case only happens because CancelTbrCommand was called
|
|
||||||
// twice by AAPS
|
|
||||||
log.warn("No TBR active to cancel");
|
|
||||||
return new CommandResult()
|
return new CommandResult()
|
||||||
.success(true)
|
.success(true)
|
||||||
// Technically, nothing was enacted, but AAPS needs this to recover
|
// Technically, nothing was enacted, but AAPS needs this to recover
|
||||||
|
@ -47,6 +42,7 @@ public class CancelTbrCommand extends BaseCommand {
|
||||||
.enacted(true)
|
.enacted(true)
|
||||||
.message("No TBR active");
|
.message("No TBR active");
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug("Cancelling active TBR of " + pumpState.tbrPercent
|
log.debug("Cancelling active TBR of " + pumpState.tbrPercent
|
||||||
+ "% with " + pumpState.tbrRemainingDuration + " min remaining");
|
+ "% with " + pumpState.tbrRemainingDuration + " min remaining");
|
||||||
SetTbrCommand setTbrCommand = new SetTbrCommand(100, 0);
|
SetTbrCommand setTbrCommand = new SetTbrCommand(100, 0);
|
||||||
|
|
Loading…
Reference in a new issue