Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed X travel distance in XYZ probing #2292

Merged
merged 3 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ This file is part of Universal Gcode Sender (UGS).

import com.google.common.base.Preconditions;
import com.willwinder.ugs.nbp.lib.lookup.CentralLookup;
import com.willwinder.ugs.platform.probe.renderable.ProbePreviewManager;
import com.willwinder.universalgcodesender.Utils;
import com.willwinder.universalgcodesender.gcode.util.GcodeUtils;
import com.willwinder.universalgcodesender.listeners.ControllerState;
Expand All @@ -32,7 +31,6 @@ This file is part of Universal Gcode Sender (UGS).
import com.willwinder.universalgcodesender.model.WorkCoordinateSystem;
import com.willwinder.universalgcodesender.model.events.ControllerStateEvent;
import com.willwinder.universalgcodesender.model.events.ProbeEvent;
import org.openide.util.Lookup;
import org.openide.util.lookup.ServiceProvider;

import java.util.ArrayList;
Expand Down Expand Up @@ -292,7 +290,7 @@ private void performXYZProbeInternal(int stepNumber) throws IllegalStateExceptio
case 4: {
gcode(g0Abs + " X" + -params.xSpacing);
gcode(g0Abs + " Y" + -params.ySpacing);
gcode(g0Abs + " X" + params.xSpacing);
gcode(g0Abs + " X0");

// Y
probe('Y', params.feedRate, params.ySpacing, params.units);
Expand Down Expand Up @@ -441,7 +439,7 @@ private void updateWCS(WorkCoordinateSystem wcs, Double x, Double y, Double z) t
sb.append("Z").append(Utils.formatter.format(z));
}

gcode(String.format(WCS_PATTERN, wcs.getPValue(), sb.toString()));
gcode(String.format(WCS_PATTERN, wcs.getPValue(), sb));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public void testProbeServiceXYZ() throws Exception {
ps.UGSEvent(new ControllerStateEvent(ControllerState.IDLE, ControllerState.RUN));

InOrder order = inOrder(backend);

order.verify(backend, times(1)).sendGcodeCommand(true, "G10 L20 P2 X0Y0Z0");

// Probe Z axis
Expand All @@ -172,7 +171,7 @@ public void testProbeServiceXYZ() throws Exception {
order.verify(backend, times(1)).probe("X", pc.feedRateSlow, pc.xSpacing, pc.units);
order.verify(backend, times(1)).sendGcodeCommand(true, "G90 G21 G0 X" + -pc.xSpacing);
order.verify(backend, times(1)).sendGcodeCommand(true, "G90 G21 G0 Y" + -pc.ySpacing);
order.verify(backend, times(1)).sendGcodeCommand(true, "G90 G21 G0 X" + pc.xSpacing);
order.verify(backend, times(1)).sendGcodeCommand(true, "G90 G21 G0 X0");

// probe Y axis
order.verify(backend, times(1)).probe("Y", pc.feedRate, pc.ySpacing, pc.units);
Expand Down