Brought back "disable safety prompts" for probing

This commit is contained in:
David Carley
2022-09-14 05:11:39 +00:00
parent c7670ce7cc
commit a09ec6c563
4 changed files with 164 additions and 102 deletions

View File

@@ -24,6 +24,11 @@
"unit": "mm/min²", "unit": "mm/min²",
"default": 200000 "default": 200000
}, },
"probing-prompts": {
"help": "Enable or disable safety prompts during and after probing",
"type": "bool",
"default": true
},
"gamepad-default-type": { "gamepad-default-type": {
"help": "When a gamepad is not recognized, treat it as the selected type of gamepad.", "help": "When a gamepad is not recognized, treat it as the selected type of gamepad.",
"type": "enum", "type": "enum",

View File

@@ -22,6 +22,21 @@
scale?: number; 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; export let key: string;
let keyParts: string[]; let keyParts: string[];
let template: Template; let template: Template;
@@ -33,7 +48,7 @@
onMount(() => { onMount(() => {
keyParts = (key || "").split("."); keyParts = (key || "").split(".");
template = getTemplate(); template = getTemplate();
name = keyParts[keyParts.length - 1]; name = namesByKey[keyParts.at(-1)] || keyParts.at(-1);
title = getTitle(); title = getTitle();
value = getValue(); value = getValue();
}); });
@@ -81,7 +96,7 @@
target = target[part]; target = target[part];
} }
const value = coerceValue(event.target.value); const value = getValueFromElement(event.target);
target[keyParts[keyParts.length - 1]] = value; target[keyParts[keyParts.length - 1]] = value;
return config; return config;
@@ -90,14 +105,17 @@
ControllerMethods.dispatch("config-changed"); ControllerMethods.dispatch("config-changed");
} }
function coerceValue(value) { function getValueFromElement(element) {
switch (template.type) { switch (template.type) {
case "float": case "float":
case "int": case "int":
return Number(value); return Number(element.value);
case "bool":
return element.checked;
default: default:
return value; return element.value;
} }
} }
@@ -138,7 +156,12 @@
{/each} {/each}
</select> </select>
{:else if template.type === "bool"} {:else if template.type === "bool"}
<input {name} type="checkbox" bind:value on:input={onChange} /> <input
{name}
type="checkbox"
checked={value}
on:change={onChange}
/>
{:else if template.type === "float"} {:else if template.type === "float"}
<input <input
{name} {name}

View File

@@ -14,6 +14,7 @@
<ScreenRotationDialog bind:open={showScreenRotationDialog} /> <ScreenRotationDialog bind:open={showScreenRotationDialog} />
<SetTimeDialog bind:open={showSetTimeDialog} /> <SetTimeDialog bind:open={showSetTimeDialog} />
<div class="settings-view">
<h1>Settings</h1> <h1>Settings</h1>
<div class="pure-form pure-form-aligned"> <div class="pure-form pure-form-aligned">
@@ -47,16 +48,23 @@
<h2>Gamepads / Joypads</h2> <h2>Gamepads / Joypads</h2>
<fieldset> <fieldset>
<ConfigTemplatedInput key={`settings.gamepad-default-type`} /> <ConfigTemplatedInput key={`settings.gamepad-default-type`} />
<div class="tip">
If your gamepad doesn't work as expected, try one of the other
types.
</div>
</fieldset> </fieldset>
<p> <h2>Probing</h2>
If you have a gamepad that is not officially supported, and doesn't seem
to be working right, try changing <tt>gamepad-default-type</tt> to one of
the other types.
</p>
<fieldset> <fieldset>
<h2>Probe Dimensions</h2> <ConfigTemplatedInput key={`settings.probing-prompts`} />
<div class="tip">
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.
</div>
<br />
{#each Object.keys(configTemplate.probe) as key} {#each Object.keys(configTemplate.probe) as key}
{#if key !== "probe-diameter"} {#if key !== "probe-diameter"}
<ConfigTemplatedInput key={`probe.${key}`} /> <ConfigTemplatedInput key={`probe.${key}`} />
@@ -74,35 +82,48 @@
<h2>Path Accuracy</h2> <h2>Path Accuracy</h2>
<fieldset> <fieldset>
<ConfigTemplatedInput key={`settings.max-deviation`} /> <ConfigTemplatedInput key={`settings.max-deviation`} />
</fieldset>
<p> <div class="tip">
Lower <tt>max-deviation</tt> to follow the programmed path more precisely Lower the maximum deviation to follow the programmed path more
but at a slower speed. precisely but at a slower speed.
</p> </div>
<p> <div class="tip">
In order to improve traversal speed, the path planner may merge In order to improve traversal speed, the path planner may merge
consecutive moves or round off sharp corners if doing so would deviate consecutive moves or round off sharp corners if doing so would
from the program path by less than <tt>max-deviation</tt>. deviate from the program path by less than the maximum
</p> deviation.
</div>
<p> <div class="tip">
GCode commands GCode commands
<a href={`${gcodeURL}#gcode:g61`} target="_blank">G61, G61.1</a> <a href={`${gcodeURL}#gcode:g61`} target="_blank">G61, G61.1</a>
and <a href={`${gcodeURL}#gcode:g64`} target="_blank"> G64</a> also affect and <a href={`${gcodeURL}#gcode:g64`} target="_blank">G64</a> also
path planning accuracy. affect path planning accuracy.
</p> </div>
</fieldset>
<h2>Cornering Speed (Advanced)</h2> <h2>Cornering Speed (Advanced)</h2>
<fieldset> <fieldset>
<ConfigTemplatedInput key={`settings.junction-accel`} /> <ConfigTemplatedInput key={`settings.junction-accel`} />
</fieldset> <div class="tip">
Junction acceleration limits the cornering speed the planner
<p> will allow. Increasing this value will allow for faster
Junction acceleration limits the cornering speed the planner will allow. traversal of corners but may cause the planner to violate axis
Increasing this value will allow for faster traversal of corners but may jerk limits and stall the motors. Use with caution.
cause the planner to violate axis jerk limits and stall the motors. Use
with caution.
</p>
</div> </div>
</fieldset>
</div>
</div>
<style lang="scss">
.settings-view {
.tip {
margin-left: 210px;
margin-bottom: 15px;
font-style: italic;
font-size: 90%;
line-height: 1.5;
}
}
</style>

View File

@@ -105,10 +105,14 @@
$probingActive = true; $probingActive = true;
assertValidProbeType(); assertValidProbeType();
$probingFailed = false;
const enableSafety = $Config.settings["probing-prompts"];
steps = [ steps = [
"CheckProbe", enableSafety ? "CheckProbe" : undefined,
probeType === "xyz" ? "BitDimensions" : undefined, probeType === "xyz" ? "BitDimensions" : undefined,
"PlaceProbeBlock", enableSafety ? "PlaceProbeBlock" : undefined,
"Probe", "Probe",
"Done", "Done",
].filter<Step>(isStep); ].filter<Step>(isStep);
@@ -163,6 +167,10 @@
) { ) {
currentStep = nextStep; currentStep = nextStep;
if (!steps.includes(currentStep)) {
return;
}
clearFlags(); clearFlags();
updateButtons(); updateButtons();
@@ -184,7 +192,6 @@
$cancelled = false; $cancelled = false;
$probeContacted = false; $probeContacted = false;
$probingStarted = false; $probingStarted = false;
$probingFailed = false;
$probingComplete = false; $probingComplete = false;
$userAcknowledged = false; $userAcknowledged = false;
} }
@@ -310,10 +317,12 @@
{/each} {/each}
</ul> </ul>
</div> </div>
<p style="width: 100%"> <div style="width: 100%">
{#if currentStep === "CheckProbe"} {#if currentStep === "CheckProbe"}
<p>
Attach the probe magnet to the collet, then touch the probe Attach the probe magnet to the collet, then touch the probe
block to the bit. block to the bit.
</p>
<Icon <Icon
data={probeType === "xyz" ? CheckXYZ : CheckZ} data={probeType === "xyz" ? CheckXYZ : CheckZ}
@@ -334,13 +343,15 @@
<Icon data={BitDiameter} size="150px" class="probe-icon-svg" /> <Icon data={BitDiameter} size="150px" class="probe-icon-svg" />
{:else if currentStep === "PlaceProbeBlock"} {:else if currentStep === "PlaceProbeBlock"}
<p>
{#if probeType === "xyz"} {#if probeType === "xyz"}
Place the probe block face up, on the lower-left corner of Place the probe block face up, on the lower-left corner
your workpiece. of your workpiece.
{:else} {:else}
Place the probe block face down, with the bit above the Place the probe block face down, with the bit above the
recess. recess.
{/if} {/if}
</p>
<Icon <Icon
data={probeType === "xyz" ? PlaceXYZ : PlaceZ} data={probeType === "xyz" ? PlaceXYZ : PlaceZ}
@@ -354,12 +365,14 @@
'Next'. 'Next'.
</p> </p>
{:else if currentStep === "Probe"} {:else if currentStep === "Probe"}
Probing in progress... <p>Probing in progress...</p>
<LinearProgress indeterminate /> <LinearProgress indeterminate />
{:else if currentStep === "Done"} {:else if currentStep === "Done"}
{#if $probingFailed} {#if $probingFailed}
Could not find the probe block during probing! <h3>Emergency Stop!</h3>
<p>Could not find the probe block during probing!</p>
<p> <p>
Make sure the tip of the bit is less than {metric Make sure the tip of the bit is less than {metric
@@ -368,7 +381,7 @@
above the probe block, and try again. above the probe block, and try again.
</p> </p>
{:else} {:else}
Don't forget to put away the probe! <p>Don't forget to put away the probe!</p>
<Icon <Icon
data={probeType === "xyz" ? PutAwayXYZ : PutAwayZ} data={probeType === "xyz" ? PutAwayXYZ : PutAwayZ}
@@ -384,7 +397,7 @@
{/if} {/if}
{/if} {/if}
{/if} {/if}
</p> </div>
</Content> </Content>
<Actions> <Actions>