Cleanups.
This commit is contained in:
parent
7cb0268afc
commit
1f5c03b64e
2 changed files with 3 additions and 6 deletions
|
@ -104,10 +104,8 @@ public class RuffyScripter {
|
|||
|
||||
private volatile Command activeCmd = null;
|
||||
|
||||
// TODO take a callback to call when command finishes?
|
||||
// TODO sometimes hangs ... we should timeout and raise an alert to check the pump and ruffy
|
||||
// TODO not getting a menu update in a while is a good cue ...
|
||||
// fire up a monitoring thread for that?
|
||||
// TODO fire up a monitoring thread to intervene when we're stuck? re-bind service
|
||||
// in case ruffy app went away
|
||||
public CommandResult runCommand(final Command cmd) {
|
||||
try {
|
||||
if (isPumpBusy()) {
|
||||
|
|
|
@ -81,8 +81,7 @@ public class BolusCommand implements Command {
|
|||
private void verifyDisplayedBolusAmount(RuffyScripter scripter) {
|
||||
double displayedBolus = (double) scripter.currentMenu.getAttribute(MenuAttribute.BOLUS);
|
||||
log.debug("Final bolus: " + displayedBolus);
|
||||
// TODO can't we just use BigDecimal? doubles aren't precise ...
|
||||
if (Math.abs(displayedBolus - bolus) > 0.001) {
|
||||
if (Math.abs(displayedBolus - bolus) > 0.05) {
|
||||
throw new CommandException().message("Failed to set correct bolus. Expected: " + bolus + ", actual: " + displayedBolus);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue