use of com.willwinder.universalgcodesender.IController in project Universal-G-Code-Sender by winder.
the class WizardPanelHoming method createInvertComboBox.
private JComboBox<String> createInvertComboBox(Axis axis) {
JComboBox<String> result = new JComboBox<>();
result.setVisible(false);
result.addItem("+" + axis.name());
result.addItem("-" + axis.name());
result.addActionListener(event -> {
IController controller = getBackend().getController();
if (controller != null) {
try {
controller.getFirmwareSettings().setHomingDirectionInverted(axis, result.getSelectedIndex() == 1);
} catch (FirmwareSettingsException e) {
NotifyDescriptor nd = new NotifyDescriptor.Message("Unexpected error while updating setting: " + e.getMessage(), NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(nd);
}
}
});
return result;
}
use of com.willwinder.universalgcodesender.IController in project Universal-G-Code-Sender by winder.
the class WizardPanelMotorWiring method refreshReverseDirectionCheckboxes.
private void refreshReverseDirectionCheckboxes() {
IController controller = getBackend().getController();
if (controller != null) {
try {
checkboxReverseX.setSelected(controller.getFirmwareSettings().isInvertDirection(Axis.X));
checkboxReverseY.setSelected(controller.getFirmwareSettings().isInvertDirection(Axis.Y));
checkboxReverseZ.setSelected(controller.getFirmwareSettings().isInvertDirection(Axis.Z));
} catch (FirmwareSettingsException e) {
NotifyDescriptor nd = new NotifyDescriptor.Message("Unexpected error while getting setting: " + e.getMessage(), NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(nd);
}
}
}
Aggregations