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:
parent
5654a8ee6e
commit
7eb40653b2
|
@ -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
|
* If there was an error during BolusCommand the scripter try to reconnect. The pump refuses
|
||||||
* for a bolus delivery to complete (once bolus delivery started it continues regardless of a connection loss).
|
* connections while a bolus delivery is still in progress (once bolus delivery started it
|
||||||
* So, here we are with a connection again, let's read the last bolus record and check if
|
* continues regardless of a connection loss), retry the read history command a few
|
||||||
* its date is >= the time this command started (using the pump's time!).
|
* times if we run into the 90s connect timeout (with 3 retries, a bolus of up to 54 U could
|
||||||
* If there is such a bolus with <= the requested amount, then it's from this
|
* be delivered until we give up).
|
||||||
* command and shall be added to treatments. If the bolus wasn't delivered in full
|
* 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.
|
* 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) {
|
private PumpEnactResult recoverFromErrorDuringBolusDelivery(DetailedBolusInfo detailedBolusInfo, long pumpTimeAtStartOfCommand) {
|
||||||
|
|
|
@ -363,21 +363,6 @@ public class RuffyScripter implements RuffyCommands {
|
||||||
return false;
|
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;
|
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();
|
boolean connected = isConnected();
|
||||||
if (connected) {
|
if (connected) {
|
||||||
MenuType menuType = getCurrentMenu().getType();
|
MenuType menuType = getCurrentMenu().getType();
|
||||||
|
|
Loading…
Reference in a new issue