This commit is contained in:
bsaravanan783
2025-06-03 22:37:31 +05:30
parent 7cf2929264
commit 879b36dd0d

View File

@@ -14,10 +14,18 @@ export const homeMachineComplete = writable(false);
export function handleControllerStateUpdate(state: Record<string, any>) { export function handleControllerStateUpdate(state: Record<string, any>) {
if (!get(systemReady)) { if (!get(systemReady)) {
systemReady.set(true); systemReady.set(true);
probeContacted.set(false);
probingFailed.set(false);
probingStarted.set(false);
probingComplete.set(false);
} }
if (state.xx === "READY" && !get(homeMachineComplete)) { if (state.xx === "READY" && !get(homeMachineComplete)) {
homeMachineComplete.set(true); homeMachineComplete.set(true);
probeContacted.set(false);
probingFailed.set(false);
probingStarted.set(false);
probingComplete.set(false);
} }
if (get(probingActive) && get(systemReady) && get(homeMachineComplete)) { if (get(probingActive) && get(systemReady) && get(homeMachineComplete)) {
@@ -27,7 +35,7 @@ export function handleControllerStateUpdate(state: Record<string, any>) {
probingComplete.set(false); probingComplete.set(false);
} }
if (state.pw === 0) { if (state.cycle !== "idle" && state.pw === 0) {
probeContacted.set(true); probeContacted.set(true);
} }