Remove hack to cancel a request for a TBR that is already running (localized issue).

(cherry picked from commit a671536)
This commit is contained in:
Johannes Mockenhaupt 2017-08-28 12:24:38 +02:00
parent cff4bc1abe
commit 6f8e0fc257
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 2 additions and 12 deletions

View file

@ -521,7 +521,8 @@ public class RuffyScripter {
} }
} }
// TODO sort out usages of this method and waitForMenu update, which have the same intent,
// but approach things differently;
public boolean waitForScreenUpdate(long timeout) { public boolean waitForScreenUpdate(long timeout) {
synchronized (screenlock) { synchronized (screenlock) {
try { try {

View file

@ -56,17 +56,6 @@ public class SetTbrCommand extends BaseCommand {
public CommandResult execute() { public CommandResult execute() {
try { try {
boolean cancellingTbr = percentage == 100; boolean cancellingTbr = percentage == 100;
PumpState pumpState = scripter.readPumpState();
// TODO hack, cancelling a TBR that isn't running is dealt with in CancelTbrCommand,
// this avoids setting a TBR twice until that AAPS bug is squished which calls this
// twice within a minute GL#27
if (!cancellingTbr
&& pumpState.tbrActive
&& pumpState.tbrPercent == percentage
&& (pumpState.tbrRemainingDuration == duration || pumpState.tbrRemainingDuration + 1 == duration)) {
return new CommandResult().success(true).enacted(false).message("Requested TBR already running");
}
enterTbrMenu(); enterTbrMenu();
boolean increasingPercentage = inputTbrPercentage(); boolean increasingPercentage = inputTbrPercentage();