Skip to content

Commit

Permalink
Fixed a problem with grblHAL where certain responses were treated as …
Browse files Browse the repository at this point in the history
…parser state commands. (#2275)
  • Loading branch information
breiler authored Aug 9, 2023
1 parent cb9d6ae commit 837d81d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ private void initialize() {
positionPollTimer.stop();
initializer.initialize();
capabilities = GrblUtils.getGrblStatusCapabilities(initializer.getVersion().getVersionNumber(), initializer.getVersion().getVersionLetter());

// Toggle the state to force UI update
setControllerState(ControllerState.CONNECTING);
positionPollTimer.start();
});
}
Expand Down Expand Up @@ -232,7 +235,8 @@ else if (GrblUtils.isGrblStatusString(response)) {
this.checkStreamFinished();
}

else if (GrblUtils.isGrblFeedbackMessage(response, capabilities)) {
// We can only parse feedback messages when we know what capabilities the controller have
else if (initializer.isInitialized() && GrblUtils.isGrblFeedbackMessage(response, capabilities)) {
GrblFeedbackMessage grblFeedbackMessage = new GrblFeedbackMessage(response);
// Convert feedback message to raw commands to update modal state.
updateParserModalState(getCommandCreator().createCommand(GrblUtils.parseFeedbackMessage(response, capabilities)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,9 @@ public boolean initialize() {
return false;
}

// Toggle the state to force UI update
controller.setControllerState(ControllerState.CONNECTING);
controller.setControllerState(ControllerState.IDLE);

fetchControllerState();

messageService.dispatchMessage(MessageType.INFO, String.format("*** Connected to %s\n", version.toString()));
controller.requestStatusReport();
isInitialized.set(true);
isInitializing.set(false);
return true;
Expand Down

0 comments on commit 837d81d

Please sign in to comment.