RuffyScripter: fix on-connect checks to detect running bolus properly.
This commit is contained in:
parent
26fa63d571
commit
bb1c1f79f1
1 changed files with 10 additions and 7 deletions
|
@ -367,14 +367,17 @@ public class RuffyScripter implements RuffyCommands {
|
||||||
|
|
||||||
// if everything broke before, the pump might still be delivering a bolus, if that's the case, wait for bolus to finish
|
// if everything broke before, the pump might still be delivering a bolus, if that's the case, wait for bolus to finish
|
||||||
Double bolusRemaining = (Double) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_REMAINING);
|
Double bolusRemaining = (Double) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_REMAINING);
|
||||||
try {
|
BolusType bolusType = (BolusType) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_TYPE);
|
||||||
while (isConnected() && bolusRemaining != null) {
|
if (bolusType != null && bolusType == BolusType.NORMAL) {
|
||||||
log.debug("Waiting for bolus from previous connection to complete, remaining: " + bolusRemaining);
|
try {
|
||||||
waitForScreenUpdate();
|
while (isConnected() && bolusRemaining != null) {
|
||||||
|
log.debug("Waiting for bolus from previous connection to complete, remaining: " + bolusRemaining);
|
||||||
|
waitForScreenUpdate();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Exception waiting for bolus from previous command to finish", e);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("Exception waiting for bolus from previous command to finish", e);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue