Skip to content

Commit

Permalink
Fixed reported regression from Issue #40
Browse files Browse the repository at this point in the history
  • Loading branch information
winder committed Feb 13, 2013
1 parent b9f0579 commit 2bf77b8
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/com/willwinder/universalgcodesender/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -1305,15 +1305,17 @@ private void updateControlsForState(ControlState state) {
case COMM_DISCONNECTED:
this.updateConnectionControls(false);
this.updateManualControls(false);
this.updateWorkflowCommands(false);
this.updateWorkflowControls(false);
this.updateFileControls(false);
this.resetSentRowLabels(0);
this.updateControlsStopSending();
break;
case COMM_IDLE:
this.updateConnectionControls(true);
this.updateManualControls(true);
this.updateWorkflowCommands(true);
this.updateWorkflowControls(true);
this.updateFileControls(true);
this.updateControlsStopSending();
break;
case COMM_SENDING:
// Command tab
Expand All @@ -1329,7 +1331,7 @@ private void updateControlsForState(ControlState state) {
this.overrideSpeedValueSpinner.setEnabled(false);

// Workflow tab
this.updateWorkflowCommands(false);
this.updateWorkflowControls(false);

// Jogging commands
this.updateManualControls(false);
Expand Down Expand Up @@ -1372,13 +1374,22 @@ private void updateFileControls(boolean enabled) {
this.fileTextField.setEnabled(enabled);

if (!enabled) {
// In case transitioning from file sending or file send paused.
this.pauseButton.setText("Pause");
this.pauseButton.setEnabled(false);
this.cancelButton.setEnabled(false);
updateControlsStopSending();
}
}

private void updateControlsStopSending() {
if (this.timer != null && this.timer.isRunning()) {
// Stop the timer
this.timer.stop();
}

// In case transitioning from file sending or file send paused.
this.pauseButton.setText("Pause");
this.pauseButton.setEnabled(false);
this.cancelButton.setEnabled(false);
}

/**
* Enable/disable jogging controls.
*/
Expand All @@ -1395,7 +1406,7 @@ private void updateManualControls(boolean enabled) {
this.stepSizeSpinner.setEnabled(enabled);
}

private void updateWorkflowCommands(boolean enabled) {
private void updateWorkflowControls(boolean enabled) {
this.resetCoordinatesButton.setEnabled(enabled);
this.returnToZeroButton.setEnabled(enabled);
this.performHomingCycleButton.setEnabled(enabled);
Expand Down

0 comments on commit 2bf77b8

Please sign in to comment.