RuffyScripter: fix on-connect checks to detect running bolus properly.

This commit is contained in:
Johannes Mockenhaupt 2017-12-09 22:11:41 +01:00
parent 26fa63d571
commit bb1c1f79f1
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -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 // 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);
BolusType bolusType = (BolusType) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_TYPE);
if (bolusType != null && bolusType == BolusType.NORMAL) {
try { try {
while (isConnected() && bolusRemaining != null) { while (isConnected() && bolusRemaining != null) {
log.debug("Waiting for bolus from previous connection to complete, remaining: " + bolusRemaining); 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); log.error("Exception waiting for bolus from previous command to finish", e);
return false; return false;
} }
}
return true; return true;
} }