use of com.willwinder.universalgcodesender.model.events.SettingChangedEvent in project Universal-G-Code-Sender by winder.
the class AutoLevelerTopComponent method UGSEvent.
@Override
public void UGSEvent(UGSEvent evt) {
if (evt instanceof ProbeEvent) {
if (!scanner.isCollectedAllProbe())
return;
Position probe = ((ProbeEvent) evt).getProbePosition();
Position offset = this.settings.getAutoLevelSettings().autoLevelProbeOffset;
if (probe.getUnits() == Units.UNKNOWN || offset.getUnits() == Units.UNKNOWN) {
System.out.println("Unknown units in autoleveler receiving probe.");
}
offset = offset.getPositionIn(probe.getUnits());
scanner.probeEvent(new Position(probe.x + offset.x, probe.y + offset.y, probe.z + offset.z, probe.getUnits()));
} else if (evt instanceof SettingChangedEvent) {
updateSettings();
} else if (evt instanceof FileStateEvent) {
applyToGcode.setEnabled(true);
}
}
Aggregations