The pump doesn't accept connections while a bolus delivery is in progress.

Remove the code which checked for a bolus delivery in progress
and waited.
This commit is contained in:
Johannes Mockenhaupt 2017-12-13 13:00:47 +01:00
parent 5654a8ee6e
commit 7eb40653b2
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
2 changed files with 8 additions and 32 deletions

View file

@ -496,12 +496,14 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
/**
* If there was an error during BolusCommand the scripter will have reconnected as needed and waited
* for a bolus delivery to complete (once bolus delivery started it continues regardless of a connection loss).
* So, here we are with a connection again, let's read the last bolus record and check if
* its date is >= the time this command started (using the pump's time!).
* If there is such a bolus with <= the requested amount, then it's from this
* command and shall be added to treatments. If the bolus wasn't delivered in full
* If there was an error during BolusCommand the scripter try to reconnect. The pump refuses
* connections while a bolus delivery is still in progress (once bolus delivery started it
* continues regardless of a connection loss), retry the read history command a few
* times if we run into the 90s connect timeout (with 3 retries, a bolus of up to 54 U could
* be delivered until we give up).
* Then verify the bolus record we read has a date which is >= the time this command started
* (using the pump's time!). If there is such a bolus with <= the requested amount, then it's
* from this command and shall be added to treatments. If the bolus wasn't delivered in full
* add it but raise a warning. Raise a warning as well if no bolus was delivered at all.
*/
private PumpEnactResult recoverFromErrorDuringBolusDelivery(DetailedBolusInfo detailedBolusInfo, long pumpTimeAtStartOfCommand) {

View file

@ -363,21 +363,6 @@ public class RuffyScripter implements RuffyCommands {
return false;
}
}
// 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);
waitForScreenUpdate();
}
} catch (Exception e) {
log.error("Exception waiting for bolus from previous command to finish", e);
return false;
}
}
return true;
}
@ -404,17 +389,6 @@ public class RuffyScripter implements RuffyCommands {
}
}
// A BOLUS CANCELLED alert is raised BEFORE a bolus is started. If a disconnect occurs after a
// bolus has started (or the user interacts with the pump) the bolus continues.
// If that happened, wait till the pump has finished the bolus, then it can be read from
// the history as delivered.
Double bolusRemaining = (Double) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_REMAINING);
BolusType bolusType = (BolusType) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_TYPE);
while (isConnected() && bolusRemaining != null && bolusType == BolusType.NORMAL) {
waitForScreenUpdate();
bolusRemaining = (Double) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_REMAINING);
bolusType = (BolusType) getCurrentMenu().getAttribute(MenuAttribute.BOLUS_TYPE);
}
boolean connected = isConnected();
if (connected) {
MenuType menuType = getCurrentMenu().getType();