removed changes
This commit is contained in:
@@ -395,7 +395,6 @@ module.exports = new Vue({
|
|||||||
update_object(this.state, e.data, false);
|
update_object(this.state, e.data, false);
|
||||||
|
|
||||||
SvelteComponents.handleControllerStateUpdate(this.state);
|
SvelteComponents.handleControllerStateUpdate(this.state);
|
||||||
console.log("Controller state updated:", this.state);
|
|
||||||
|
|
||||||
delete this.state.log;
|
delete this.state.log;
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,7 @@
|
|||||||
probeContacted,
|
probeContacted,
|
||||||
probingComplete,
|
probingComplete,
|
||||||
probingFailed,
|
probingFailed,
|
||||||
probingStarted,
|
probingStarted
|
||||||
systemReady,
|
|
||||||
homeMachineComplete
|
|
||||||
} from "$lib/ControllerState";
|
} from "$lib/ControllerState";
|
||||||
import { numberWithUnit } from "$lib/RegexHelpers";
|
import { numberWithUnit } from "$lib/RegexHelpers";
|
||||||
import TextFieldWithOptions from "$components/TextFieldWithOptions.svelte";
|
import TextFieldWithOptions from "$components/TextFieldWithOptions.svelte";
|
||||||
@@ -132,24 +130,6 @@
|
|||||||
|
|
||||||
async function begin() {
|
async function begin() {
|
||||||
try {
|
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;
|
$probingActive = true;
|
||||||
assertValidProbeType();
|
assertValidProbeType();
|
||||||
|
|
||||||
|
|||||||
@@ -5,37 +5,13 @@ export const networkInfo = writable({});
|
|||||||
|
|
||||||
export const probingActive = writable(false);
|
export const probingActive = writable(false);
|
||||||
export const probeContacted = writable(false);
|
export const probeContacted = writable(false);
|
||||||
export const probingFailed = writable(false);
|
|
||||||
export const probingStarted = writable(false);
|
export const probingStarted = writable(false);
|
||||||
|
export const probingFailed = writable(false);
|
||||||
export const probingComplete = writable(false);
|
export const probingComplete = writable(false);
|
||||||
export const systemReady = writable(false);
|
|
||||||
export const homeMachineComplete = writable(false);
|
|
||||||
|
|
||||||
export function handleControllerStateUpdate(state: Record<string, any>) {
|
export function handleControllerStateUpdate(state: Record<string, any>) {
|
||||||
if (!get(systemReady)) {
|
if (get(probingActive)) {
|
||||||
systemReady.set(true);
|
if (state.pw === 0) {
|
||||||
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) {
|
|
||||||
probeContacted.set(true);
|
probeContacted.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user