use of com.willwinder.universalgcodesender.gcode.processors.TranslateProcessor in project Universal-G-Code-Sender by winder.
the class TranslateToZeroAction method performAction.
@Override
protected void performAction(Node[] activatedNodes) {
if (!isEnabled()) {
return;
}
ThreadHelper.invokeLater(() -> {
try {
LoaderDialogHelper.showDialog("Translating model", 1000);
File gcodeFile = backend.getProcessedGcodeFile();
Position offset = getLowerLeftCorner(gcodeFile);
offset.x = -offset.x;
offset.y = -offset.y;
offset.z = 0;
TranslateProcessor translateProcessor = new TranslateProcessor(offset);
backend.applyCommandProcessor(translateProcessor);
} catch (Exception ex) {
LOGGER.log(Level.SEVERE, "Could not translate gcode", ex);
GUIHelpers.displayErrorDialog(ex.getLocalizedMessage());
} finally {
LoaderDialogHelper.closeDialog();
}
});
}
Aggregations