removed changes
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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<string, any>) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user