Retrying setting puck barcode reader

This commit is contained in:
gac-S_Changer
2018-12-17 15:20:08 +01:00
parent 8902314d59
commit 8d972ea853
2 changed files with 99 additions and 53 deletions

View File

@@ -200,7 +200,8 @@ public class MainPanel extends Panel {
}
setPuckDatamatrix(null);
setSampleDatamatrix(null);
startTimer(3000, 1000);
setBackgroundUpdate(true);
startTimer(3000, 1000);
updateCameraView();
}
@@ -229,7 +230,7 @@ public class MainPanel extends Panel {
}
Controller.getInstance().onTimer();
if (getState() == State.Ready) {
if (Boolean.TRUE.equals(Controller.getInstance().puckLoading)) {
if (Boolean.TRUE.equals(Controller.getInstance().isPuckLoading())) {
getView().getStatusBar().setStatusMessage(PUCK_LOADING_STATUS);
} else {
if (PUCK_LOADING_STATUS.equals(getView().getStatusBar().getStatusLabel().getText())) {
@@ -331,24 +332,35 @@ public class MainPanel extends Panel {
void execute(String statement, boolean background) {
execute(statement, background, false);
}
void execute(String statement, boolean background, boolean showReturn) {
execute(statement, background, showReturn, true);
}
void execute(String statement, boolean background, boolean showReturn, boolean showException) {
try {
getLogger().log(Level.INFO, "Execute: " + statement + (background ? "&" : ""));
evalAsync(statement, background).handle((ret, ex) -> {
if (ex != null) {
showException((Exception) ex);
if (showException){
showException((Exception) ex);
}
} else if (showReturn) {
showMessage("Return", String.valueOf(ret));
}
return ret;
});
} catch (Exception ex) {
showException(ex);
if (showException){
showException(ex);
}
}
}
void execute(String script, Object args, boolean background, boolean showReturn) {
execute(script, args, background, showReturn, true);
}
void execute(String script, Object args, boolean background, boolean showReturn, boolean showException) {
try {
getLogger().log(Level.INFO, "Execute: " + script + (background ? "&" : ""));
runAsync(script, args, background).handle((ret, ex) -> {
@@ -360,7 +372,9 @@ public class MainPanel extends Panel {
return ret;
});
} catch (Exception ex) {
showException(ex);
if (showException){
showException(ex);
}
}
}