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,6 +367,8 @@ 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
|
||||
Double bolusRemaining = (Double) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_REMAINING);
|
||||
BolusType bolusType = (BolusType) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_TYPE);
|
||||
if (bolusType != null && bolusType == BolusType.NORMAL) {
|
||||
try {
|
||||
while (isConnected() && bolusRemaining != null) {
|
||||
log.debug("Waiting for bolus from previous connection to complete, remaining: " + bolusRemaining);
|
||||
|
@ -376,6 +378,7 @@ public class RuffyScripter implements RuffyCommands {
|
|||
log.error("Exception waiting for bolus from previous command to finish", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue