Better dection of a command hanging.
This commit is contained in:
parent
e6a29e5214
commit
0a1b8f5b14
|
@ -305,8 +305,9 @@ public class RuffyScripter implements RuffyCommands {
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
if (now > dynamicTimeout) {
|
if (now > dynamicTimeout) {
|
||||||
boolean menuRecentlyUpdated = now < menuLastUpdated + 5 * 1000;
|
boolean menuRecentlyUpdated = now < menuLastUpdated + 5 * 1000;
|
||||||
boolean inMenuNotMainMenu = currentMenu != null && currentMenu.getType() != MenuType.MAIN_MENU;
|
boolean idlingInMainMenu = getCurrentMenu().getType() == MenuType.MAIN_MENU
|
||||||
if (menuRecentlyUpdated || inMenuNotMainMenu) {
|
&& !getCurrentMenu().attributes().contains(MenuAttribute.BOLUS_REMAINING);
|
||||||
|
if (menuRecentlyUpdated && !idlingInMainMenu) {
|
||||||
// command still working (or waiting for pump to complete, e.g. bolus delivery)
|
// command still working (or waiting for pump to complete, e.g. bolus delivery)
|
||||||
dynamicTimeout = now + 30 * 1000;
|
dynamicTimeout = now + 30 * 1000;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue