I am working on java fxml where i take 2 inputs and use them to run a script. I pause at execution points of the script
My problem is when i provide only 1 input (ex 1 2 add 3 equal)the code runs fine but when I am providing 2 inputs (ex 1 2 add and 3 equal) the code stops at countDownLatch.await() at the very last step and does not print the script output.
I am starting on fxml button click something like below
Executors.newSingleThreadExecutor().submit(()-> {
method(ui_inputs1);
method(ui_inputs2)
}):
I am trying to achieve pause in FXML UI ie until the user clicks next something like debug where a user will select UI points to pause at.
so something like this
public void onExcecute(
if (debugMode) {
//check is breakpoint the do Platform.runLater(() + UI updates//
countDownLatch.await();
countDownLatch = new CountDownLatch(1);
}
}
when user click Play next button it moves to next step till it hits execution point
public void onHitBreakpoint() {
Platform.runLater(()->{
addStackDebug(listener,false);});
}
playToNextExecPoint() {
countDownLatch.countDown();
}
public void onfinish{
// script success or failed
}
Console log for the correct execution is:
Lets parse 1 2 ADD 3 EQUAL
Executing OP_CODE operation: [1]
Lets parse 1 2 ADD 3 EQUAL
-------Press 'Play' To Continue--------
Executing OP_CODE operation: [2]
Lets parse 2 ADD 3 EQUAL
-------Press 'Play' To Continue--------
Executing OP_CODE operation: [ADD]
Lets parse ADD 3 EQUAL
-------Press 'Play' To Continue--------
Executing OP_CODE operation: [3]
Lets parse 3 EQUAL
-------Press 'Play' To Continue--------
Executing OP_CODE operation: [EQUAL]
Lets parse EQUAL -------Press 'Play' To Continue-------- Script success. Script success.
When I provide 2 inputs, the prints in Bold and Italics are missing