Fixed dimension labels in the probe dialog

This commit is contained in:
David Carley
2022-07-16 19:18:58 -07:00
parent 9fa83d30c0
commit f6e17c656f
2 changed files with 27 additions and 29 deletions

View File

@@ -11,6 +11,7 @@
type Option = {
value: number;
label: string;
metric: boolean;
};
@@ -65,10 +66,7 @@
<List>
{#each options as option}
<Item on:SMUI:action={() => onOptionSelected(option)}>
<Text>
{option.value}
{option.metric ? "mm" : "in"}
</Text>
<Text>{option.label}</Text>
</Item>
{/each}
</List>
@@ -76,12 +74,11 @@
</div>
<style lang="scss">
:global {
.value-and-unit {
display: flex;
column-gap: 10px;
}
:global {
.mdc-select {
max-width: 60px;
}
@@ -90,4 +87,5 @@
margin-left: 0;
}
}
}
</style>

View File

@@ -63,21 +63,21 @@
import { Config } from "$lib/ConfigStore";
const cutterDiameterOptions = [
{ value: 0.5, metric: false },
{ value: 10, metric: true },
{ value: 0.25, metric: false },
{ value: 6, metric: true },
{ value: 0.125, metric: false },
{ value: 3, metric: true },
{ value: 0.5, label: '1/2 "', metric: false },
{ value: 0.25, label: '1/4 "', metric: false },
{ value: 0.125, label: '1/8 "', metric: false },
{ value: 10, label: "10 mm", metric: true },
{ value: 6, label: "6 mm", metric: true },
{ value: 3, label: "10 mm", metric: true },
];
const cutterLengthOptions = [
{ value: 1, metric: false },
{ value: 20, metric: true },
{ value: 0.5, metric: false },
{ value: 10, metric: true },
{ value: 0.25, metric: false },
{ value: 6, metric: true },
{ value: 1, label: '1 "', metric: false },
{ value: 0.5, label: '1/2 "', metric: false },
{ value: 0.25, label: '1/4 "', metric: false },
{ value: 20, label: "20 mm", metric: true },
{ value: 10, label: "10 mm", metric: true },
{ value: 6, label: "6 mm", metric: true },
];
export let open;
@@ -132,8 +132,8 @@
if (probeType === "xyz") {
await stepCompleted("BitDimensions", userAcknowledged);
localStorage.setItem("cutterDiameter", cutterDiameter);
localStorage.setItem("cutterLength", cutterLength);
localStorage.setItem("cutterDiameter", cutterDiameter.toString());
localStorage.setItem("cutterLength", cutterLength.toString());
}
await stepCompleted("PlaceProbeBlock", userAcknowledged);