Skip to content

Commit 9b22c8d

Browse files
committed
.
1 parent 5452205 commit 9b22c8d

3 files changed

Lines changed: 26 additions & 15 deletions

File tree

elle-app/elle-frontend/src/App.vue

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const {
6464
zpitchactive,
6565
xstepperactive,
6666
zstepperactive,
67+
currentToolIndex,
6768
updateHALOut
6869
} = useHAL()
6970
@@ -431,7 +432,6 @@ function setFinalNumber(value: number) {
431432
break
432433
case TurningEntryType.turningFeedRate:
433434
setTurningParameter(TurningEntryType.turningFeedRate, value)
434-
updatePitchFromTurning()
435435
break
436436
case TurningEntryType.turningStepDown:
437437
setTurningParameter(TurningEntryType.turningStepDown, value)
@@ -833,13 +833,6 @@ const pitchClicked = (axis: string) => {
833833
if (xpitchangle.value > 0) {
834834
xpitch.value = pitchForAngle(zpitch.value, xpitchangle.value)
835835
}
836-
// If we're in turning mode, also update the turning feed rate parameter
837-
if (
838-
selectedMenu.value === MenuType.cannedCycles &&
839-
selectedCannedCycle.value === CannedCycle.turning
840-
) {
841-
turningFeedRate.value = value
842-
}
843836
}
844837
break
845838
case 'x':
@@ -1078,11 +1071,6 @@ const turningResetClicked = () => {
10781071
}
10791072
10801073
const updatePitchFromTurning = () => {
1081-
// Update feed rate display for turning (feed rate is in mm/rev)
1082-
if (turningFeedRate.value !== null) {
1083-
zpitch.value = Math.abs(turningFeedRate.value)
1084-
}
1085-
10861074
// Minimal cross feed for turning
10871075
xpitch.value = 0.001
10881076
xpitchangle.value = 0
@@ -1218,6 +1206,8 @@ onUnmounted(() => {
12181206
:cursorpos="cursorpos"
12191207
:diameter-mode="diameterMode"
12201208
:show-x-pitch="true"
1209+
:show-z-pitch="true"
1210+
:tool-index="currentToolIndex"
12211211
@number-clicked="numberClicked"
12221212
@zero-clicked="zeroClicked"
12231213
@pitch-clicked="pitchClicked"
@@ -1441,6 +1431,8 @@ onUnmounted(() => {
14411431
:cursorpos="cursorpos"
14421432
:diameter-mode="diameterMode"
14431433
:show-x-pitch="false"
1434+
:show-z-pitch="false"
1435+
:tool-index="currentToolIndex"
14441436
@number-clicked="numberClicked"
14451437
@zero-clicked="zeroClicked"
14461438
@pitch-clicked="pitchClicked"

elle-app/elle-frontend/src/components/DRODisplay.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ interface Props {
4141
cursorpos?: number
4242
diameterMode?: boolean
4343
showXPitch?: boolean
44+
showZPitch?: boolean
45+
toolIndex?: number
4446
}
4547
4648
const props = withDefaults(defineProps<Props>(), {
@@ -61,7 +63,9 @@ const props = withDefaults(defineProps<Props>(), {
6163
metric: true,
6264
cursorpos: 0,
6365
diameterMode: false,
64-
showXPitch: true
66+
showXPitch: true,
67+
showZPitch: true,
68+
toolIndex: 0
6569
})
6670
6771
enum ZeroEntry {
@@ -191,6 +195,11 @@ const zpitchCursorFormatted = computed(() => {
191195
192196
const rpmsUnitFormatted = computed(() => `rpm${ ' '.repeat(3)}`)
193197
198+
const toolFormatted = computed(() => {
199+
const toolNum = props.toolIndex.toString().padStart(2, '0')
200+
return `🧰${toolNum}`
201+
})
202+
194203
const xposClicked = () => {
195204
emit('numberClicked', NumberEntry.xpos, props.xpos)
196205
}
@@ -322,12 +331,17 @@ const zpitchLabel = computed(() => props.entryActive == NumberEntry.zpitch
322331
{{ props.xpitchlabel }}
323332
</button>
324333
<br />
325-
<div class="inline" @click="zpitchClicked">
334+
<div
335+
class="inline"
336+
:style="{ visibility: showZPitch ? 'visible' : 'hidden' }"
337+
@click="zpitchClicked"
338+
>
326339
<span v-html="zpitchLabel" />{{ zpitchFormatted }}<font size="-1">&nbsp;</font><font color="#aaaaaa">{{ zpitchUnitFormatted }}</font>
327340
</div>
328341
<button
329342
class="dro-font-display-button align-content-center ml-5"
330343
style="width: 6em; padding: 0.75rem"
344+
:style="{ visibility: showZPitch ? 'visible' : 'hidden' }"
331345
@click="zpitchSelectClicked"
332346
>
333347
{{ props.zpitchlabel }}
@@ -343,6 +357,7 @@ const zpitchLabel = computed(() => props.entryActive == NumberEntry.zpitch
343357
>
344358
mm↔in
345359
</button>
360+
<div class="inline ml-3">{{ toolFormatted }}</div>
346361
<br />
347362
<div style="position: absolute; top: 0.71em">
348363
<span style="color: #ff0000">{{ xposCursorFormatted }}</span>

elle-app/elle-frontend/src/composables/useHAL.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export function useHAL() {
2626
const zpitchactive = ref(false)
2727
const xstepperactive = ref(false)
2828
const zstepperactive = ref(false)
29+
const currentToolIndex = ref(0)
30+
const currentToolOffset = ref(0)
2931

3032
let updateInterval: NodeJS.Timeout
3133
let halOutResetPositionScheduled: boolean = false
@@ -399,6 +401,8 @@ export function useHAL() {
399401
zpitchactive,
400402
xstepperactive,
401403
zstepperactive,
404+
currentToolIndex,
405+
currentToolOffset,
402406
putHalOut,
403407
putLinuxCNC,
404408
getHalIn,

0 commit comments

Comments
 (0)