From a09ec6c563881b658d8dfaccab05e42f3906d019 Mon Sep 17 00:00:00 2001 From: David Carley Date: Wed, 14 Sep 2022 05:11:39 +0000 Subject: [PATCH] Brought back "disable safety prompts" for probing --- src/resources/config-template.json | 5 + .../components/ConfigTemplatedInput.svelte | 35 +++- .../src/components/SettingsView.svelte | 179 ++++++++++-------- .../src/dialogs/ProbeDialog.svelte | 47 +++-- 4 files changed, 164 insertions(+), 102 deletions(-) diff --git a/src/resources/config-template.json b/src/resources/config-template.json index 6661cf5..99cbd15 100644 --- a/src/resources/config-template.json +++ b/src/resources/config-template.json @@ -24,6 +24,11 @@ "unit": "mm/min²", "default": 200000 }, + "probing-prompts": { + "help": "Enable or disable safety prompts during and after probing", + "type": "bool", + "default": true + }, "gamepad-default-type": { "help": "When a gamepad is not recognized, treat it as the selected type of gamepad.", "type": "enum", diff --git a/src/svelte-components/src/components/ConfigTemplatedInput.svelte b/src/svelte-components/src/components/ConfigTemplatedInput.svelte index 78957cb..49b1a60 100644 --- a/src/svelte-components/src/components/ConfigTemplatedInput.svelte +++ b/src/svelte-components/src/components/ConfigTemplatedInput.svelte @@ -22,6 +22,21 @@ scale?: number; }; + const namesByKey = { + "gamepad-default-type": "Default type", + "probing-prompts": "Show safety prompts", + "probe-xdim": "Probe block width", + "probe-ydim": "Probe block length", + "probe-zdim": "Probe block height", + "probe-fast-seek": "Fast seek speed", + "probe-slow-seek": "Slow seek speed", + "program-start": "On program start", + "tool-change": "On tool change", + "program-end": "On program end", + "max-deviation": "Maximum deviation", + "junction-accel": "Junction acceleration", + }; + export let key: string; let keyParts: string[]; let template: Template; @@ -33,7 +48,7 @@ onMount(() => { keyParts = (key || "").split("."); template = getTemplate(); - name = keyParts[keyParts.length - 1]; + name = namesByKey[keyParts.at(-1)] || keyParts.at(-1); title = getTitle(); value = getValue(); }); @@ -81,7 +96,7 @@ target = target[part]; } - const value = coerceValue(event.target.value); + const value = getValueFromElement(event.target); target[keyParts[keyParts.length - 1]] = value; return config; @@ -90,14 +105,17 @@ ControllerMethods.dispatch("config-changed"); } - function coerceValue(value) { + function getValueFromElement(element) { switch (template.type) { case "float": case "int": - return Number(value); + return Number(element.value); + + case "bool": + return element.checked; default: - return value; + return element.value; } } @@ -138,7 +156,12 @@ {/each} {:else if template.type === "bool"} - + {:else if template.type === "float"} -

Settings

+
+

Settings

-
-

User Interface

-
-
-
+
+

User Interface

+
+
+
-
-
-
+
+
+
-

Gamepads / Joypads

-
- -
+

Gamepads / Joypads

+
+ +
+ If your gamepad doesn't work as expected, try one of the other + types. +
+
-

- If you have a gamepad that is not officially supported, and doesn't seem - to be working right, try changing gamepad-default-type to one of - the other types. -

+

Probing

+
+ +
+ Onefinity highly recommends that you keep the safety prompts + enabled. If you choose to live dangerously, and disable the + safety prompts, Onefinity cannot be held responsible. +
-
-

Probe Dimensions

- {#each Object.keys(configTemplate.probe) as key} - {#if key !== "probe-diameter"} - - {/if} - {/each} -
+
-
-

GCode

- {#each Object.keys(configTemplate.gcode) as key} - - {/each} -
+ {#each Object.keys(configTemplate.probe) as key} + {#if key !== "probe-diameter"} + + {/if} + {/each} +
-

Path Accuracy

-
- -
+
+

GCode

+ {#each Object.keys(configTemplate.gcode) as key} + + {/each} +
-

- Lower max-deviation to follow the programmed path more precisely - but at a slower speed. -

+

Path Accuracy

+
+ -

- In order to improve traversal speed, the path planner may merge - consecutive moves or round off sharp corners if doing so would deviate - from the program path by less than max-deviation. -

+
+ Lower the maximum deviation to follow the programmed path more + precisely but at a slower speed. +
-

- GCode commands - G61, G61.1 - and G64 also affect - path planning accuracy. -

+
+ In order to improve traversal speed, the path planner may merge + consecutive moves or round off sharp corners if doing so would + deviate from the program path by less than the maximum + deviation. +
-

Cornering Speed (Advanced)

-
- -
+
+ GCode commands + G61, G61.1 + and G64 also + affect path planning accuracy. +
+
-

- Junction acceleration limits the cornering speed the planner will allow. - Increasing this value will allow for faster traversal of corners but may - cause the planner to violate axis jerk limits and stall the motors. Use - with caution. -

+

Cornering Speed (Advanced)

+
+ +
+ Junction acceleration limits the cornering speed the planner + will allow. Increasing this value will allow for faster + traversal of corners but may cause the planner to violate axis + jerk limits and stall the motors. Use with caution. +
+
+
+ + diff --git a/src/svelte-components/src/dialogs/ProbeDialog.svelte b/src/svelte-components/src/dialogs/ProbeDialog.svelte index 4c719d7..84cae65 100644 --- a/src/svelte-components/src/dialogs/ProbeDialog.svelte +++ b/src/svelte-components/src/dialogs/ProbeDialog.svelte @@ -105,10 +105,14 @@ $probingActive = true; assertValidProbeType(); + $probingFailed = false; + + const enableSafety = $Config.settings["probing-prompts"]; + steps = [ - "CheckProbe", + enableSafety ? "CheckProbe" : undefined, probeType === "xyz" ? "BitDimensions" : undefined, - "PlaceProbeBlock", + enableSafety ? "PlaceProbeBlock" : undefined, "Probe", "Done", ].filter(isStep); @@ -163,6 +167,10 @@ ) { currentStep = nextStep; + if (!steps.includes(currentStep)) { + return; + } + clearFlags(); updateButtons(); @@ -184,7 +192,6 @@ $cancelled = false; $probeContacted = false; $probingStarted = false; - $probingFailed = false; $probingComplete = false; $userAcknowledged = false; } @@ -310,10 +317,12 @@ {/each} -

+

{#if currentStep === "CheckProbe"} - Attach the probe magnet to the collet, then touch the probe - block to the bit. +

+ Attach the probe magnet to the collet, then touch the probe + block to the bit. +

{:else if currentStep === "PlaceProbeBlock"} - {#if probeType === "xyz"} - Place the probe block face up, on the lower-left corner of - your workpiece. - {:else} - Place the probe block face down, with the bit above the - recess. - {/if} +

+ {#if probeType === "xyz"} + Place the probe block face up, on the lower-left corner + of your workpiece. + {:else} + Place the probe block face down, with the bit above the + recess. + {/if} +

{:else if currentStep === "Probe"} - Probing in progress... +

Probing in progress...

{:else if currentStep === "Done"} {#if $probingFailed} - Could not find the probe block during probing! +

Emergency Stop!

+ +

Could not find the probe block during probing!

Make sure the tip of the bit is less than {metric @@ -368,7 +381,7 @@ above the probe block, and try again.

{:else} - Don't forget to put away the probe! +

Don't forget to put away the probe!

+