Changed yz origin to y origin after probing

This commit is contained in:
sanjayk03-dev
2025-06-13 21:24:14 +05:30
parent d3b1006740
commit 33a352e14c
4 changed files with 9 additions and 9 deletions

View File

@@ -58,7 +58,7 @@
const MoveToZeroDialogProps = writable<MoveToZeroDialogPropsType>();
type MoveToZeroDialogPropsType = {
open: boolean;
axes: "xy" | "z" | "a" | "yz";
axes: "xy" | "y" | "z" | "a";
};
const ShutdownDialogProps = writable<ShutdownDialogPropsType>();

View File

@@ -4,7 +4,7 @@
import { ControllerMethods } from "$lib/RegisterControllerMethods";
export let open;
export let axes: "xy" | "z" | "a" | "yz";
export let axes: "xy" | "y" | "z" | "a";
</script>
<Dialog

View File

@@ -171,7 +171,7 @@
if (probeType === "xyz" ) {
if(isRotaryActive){
ControllerMethods.gotoZero("yz");
ControllerMethods.gotoZero("y");
} else {
ControllerMethods.gotoZero("xy");
}

View File

@@ -9,7 +9,7 @@ interface RegisterableControllerMethods {
}
interface ControllerMethods extends RegisterableControllerMethods {
gotoZero: (axes: "xy" | "z" | "a" | "yz") => void;
gotoZero: (axes: "xy" | "y" | "z" | "a") => void;
}
export let ControllerMethods: ControllerMethods;
@@ -22,13 +22,17 @@ export function registerControllerMethods(methods: Partial<RegisterableControlle
};
}
function gotoZero(axes: "xy" | "z" | "a" | "yz") {
function gotoZero(axes: "xy" | "y" | "z" | "a") {
let axesClause = "";
switch (axes.toLowerCase()) {
case "xy":
axesClause = "X0Y0";
break;
case "y":
axesClause = "Y0";
break;
case "z":
axesClause = "Z0";
break;
@@ -37,10 +41,6 @@ function gotoZero(axes: "xy" | "z" | "a" | "yz") {
axesClause = "A0";
break;
case "yz":
axesClause = "Y0Z0";
break;
default:
throw new Error(`Invalid axes: ${axes}`);
}