SetBasalProfileCommand: fix waiting for input scrolling to complete.

This commit is contained in:
Johannes Mockenhaupt 2017-11-24 23:06:21 +01:00
parent 71b32ac078
commit 63afb7bd84
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -107,8 +107,8 @@ public class SetBasalProfileCommand extends BaseCommand {
double displayedRate = scripter.readBlinkingValue(Double.class, MenuAttribute.BASAL_RATE);
long timeout = System.currentTimeMillis() + 10 * 1000;
while (timeout > System.currentTimeMillis()
&& ((change > 0 && displayedRate < requestedRate)
|| (change < 0 && displayedRate > requestedRate))) {
&& ((change > 0 && requestedRate - displayedRate > 0.001) // displayedRate < requestedRate)
|| (change < 0 && displayedRate - requestedRate > 0.001))) { //displayedRate > requestedRate))) {
log.debug("Waiting for pump to process scrolling input for rate, current: "
+ displayedRate + ", desired: " + requestedRate + ", scrolling "
+ (change > 0 ? "up" : "down"));