diff --git a/src/js/app.js b/src/js/app.js index 732db90..b148013 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -395,7 +395,6 @@ module.exports = new Vue({ update_object(this.state, e.data, false); SvelteComponents.handleControllerStateUpdate(this.state); - console.log("Controller state updated:", this.state); delete this.state.log; diff --git a/src/svelte-components/src/dialogs/ProbeDialog.svelte b/src/svelte-components/src/dialogs/ProbeDialog.svelte index 075f6c5..1cd6fed 100644 --- a/src/svelte-components/src/dialogs/ProbeDialog.svelte +++ b/src/svelte-components/src/dialogs/ProbeDialog.svelte @@ -11,9 +11,7 @@ probeContacted, probingComplete, probingFailed, - probingStarted, - systemReady, - homeMachineComplete + probingStarted } from "$lib/ControllerState"; import { numberWithUnit } from "$lib/RegexHelpers"; import TextFieldWithOptions from "$components/TextFieldWithOptions.svelte"; @@ -132,24 +130,6 @@ async function begin() { try { - // Wait for both system ready and home machine completion - if (!get(systemReady) || !get(homeMachineComplete)) { - await new Promise(resolve => { - const unsubscribeSystem = systemReady.subscribe(ready => { - if (ready && get(homeMachineComplete)) { - unsubscribeSystem(); - resolve(true); - } - }); - const unsubscribeHome = homeMachineComplete.subscribe(homeComplete => { - if (homeComplete && get(systemReady)) { - unsubscribeHome(); - resolve(true); - } - }); - }); - } - $probingActive = true; assertValidProbeType(); diff --git a/src/svelte-components/src/lib/ControllerState.ts b/src/svelte-components/src/lib/ControllerState.ts index 2bb1783..d1f8ad1 100644 --- a/src/svelte-components/src/lib/ControllerState.ts +++ b/src/svelte-components/src/lib/ControllerState.ts @@ -5,37 +5,13 @@ export const networkInfo = writable({}); export const probingActive = writable(false); export const probeContacted = writable(false); -export const probingFailed = writable(false); export const probingStarted = writable(false); +export const probingFailed = writable(false); export const probingComplete = writable(false); -export const systemReady = writable(false); -export const homeMachineComplete = writable(false); export function handleControllerStateUpdate(state: Record) { - if (!get(systemReady)) { - systemReady.set(true); - probeContacted.set(false); - probingFailed.set(false); - probingStarted.set(false); - probingComplete.set(false); - } - - if (state.xx === "READY" && !get(homeMachineComplete)) { - homeMachineComplete.set(true); - probeContacted.set(false); - probingFailed.set(false); - probingStarted.set(false); - probingComplete.set(false); - } - - if (get(probingActive) && get(systemReady) && get(homeMachineComplete)) { - if (state.cycle === "idle" && !get(probingStarted)) { - probeContacted.set(false); - probingFailed.set(false); - probingComplete.set(false); - } - - if (state.cycle !== "idle" && state.pw === 0) { + if (get(probingActive)) { + if (state.pw === 0) { probeContacted.set(true); }