From 6f8e0fc2573f45159fc43f93d3d8334ea00c92d3 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Mon, 28 Aug 2017 12:24:38 +0200 Subject: [PATCH] Remove hack to cancel a request for a TBR that is already running (localized issue). (cherry picked from commit a671536) --- .../java/de/jotomo/ruffyscripter/RuffyScripter.java | 3 ++- .../jotomo/ruffyscripter/commands/SetTbrCommand.java | 11 ----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java index 2934ee7eed..ae3269dcae 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/RuffyScripter.java @@ -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) { synchronized (screenlock) { try { diff --git a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java index f51bce9259..a2e3fa6a55 100644 --- a/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java +++ b/app/src/main/java/de/jotomo/ruffyscripter/commands/SetTbrCommand.java @@ -56,17 +56,6 @@ public class SetTbrCommand extends BaseCommand { public CommandResult execute() { try { 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(); boolean increasingPercentage = inputTbrPercentage();