BolusCommand: cancel earlier if requested.
This commit is contained in:
parent
50cbcaba52
commit
39b89df484
1 changed files with 6 additions and 0 deletions
|
@ -55,6 +55,11 @@ public class BolusCommand extends BaseCommand {
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
try {
|
try {
|
||||||
|
if (cancelRequested) {
|
||||||
|
bolusProgressReporter.report(STOPPED, 0, 0);
|
||||||
|
result.success = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
bolusProgressReporter.report(PROGRAMMING, 0, 0);
|
bolusProgressReporter.report(PROGRAMMING, 0, 0);
|
||||||
enterBolusMenu();
|
enterBolusMenu();
|
||||||
inputBolusAmount();
|
inputBolusAmount();
|
||||||
|
@ -191,6 +196,7 @@ public class BolusCommand extends BaseCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void requestCancellation() {
|
public void requestCancellation() {
|
||||||
|
log.debug("Bolus cancellation requested");
|
||||||
cancelRequested = true;
|
cancelRequested = true;
|
||||||
bolusProgressReporter.report(STOPPING, 0, 0);
|
bolusProgressReporter.report(STOPPING, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue