Skip to content

Commit c868d50

Browse files
committed
feat: moves home controls to a rollout
1 parent 84ae80f commit c868d50

3 files changed

Lines changed: 99 additions & 57 deletions

File tree

src/components/cards/dashboard/ToolheadCard.vue

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:draggable="true"
66
:inLayout="inLayout"
77
:enabled="enabled"
8-
menu-breakpoint="xl"
8+
menu-breakpoint="lg"
99
@enabled="$emit('enabled', $event)">
1010

1111
<template v-slot:title>
@@ -81,37 +81,6 @@
8181
color="secondary">
8282
QGL
8383
</v-btn>
84-
<v-divider class="my-2"></v-divider>
85-
<v-btn
86-
@click="sendGcode('G28', waits.onHomeAll)"
87-
:elevation="2"
88-
:loading="hasWait(waits.onHomeAll)"
89-
:disabled="hasWaits || !klippyConnected || printerPrinting"
90-
small
91-
class="ma-1"
92-
:color="(!allHomed) ? 'warning' : 'secondary'">
93-
<v-icon small class="mr-1">$home</v-icon> All
94-
</v-btn>
95-
<v-btn
96-
@click="sendGcode('G28 X', waits.onHomeX)"
97-
:elevation="2"
98-
:loading="hasWait(waits.onHomeX)"
99-
:disabled="hasWaits || !klippyConnected || printerPrinting"
100-
small
101-
class="ma-1"
102-
:color="(!allHomed) ? 'warning' : 'secondary'">
103-
<v-icon small class="mr-1">$home</v-icon> X
104-
</v-btn>
105-
<v-btn
106-
@click="sendGcode('G28 Y', waits.onHomeY)"
107-
:elevation="2"
108-
:loading="hasWait(waits.onHomeY)"
109-
:disabled="hasWaits || !klippyConnected || printerPrinting"
110-
small
111-
class="ma-1"
112-
:color="(!allHomed) ? 'warning' : 'secondary'">
113-
<v-icon small class="mr-1">$home</v-icon> Y
114-
</v-btn>
11584
</template>
11685

11786
<toolhead-widget></toolhead-widget>

src/components/inputs/BtnToolheadMove.vue

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
<template>
2-
<v-btn
3-
@click="$emit('click')"
4-
:disabled="disabled"
5-
:elevation="2"
6-
:min-width="40"
7-
:loading="loading"
8-
:color="color"
9-
class="pa-0">
10-
<v-icon :small="hasDefaultSlot">{{ icon }}</v-icon>
11-
<slot></slot>
12-
</v-btn>
2+
<v-badge
3+
color="orange"
4+
overlap
5+
bordered
6+
offset-x="15"
7+
offset-y="15"
8+
left
9+
:content="badge"
10+
:value="(badge !== '')"
11+
>
12+
<v-btn
13+
@click="$emit('click')"
14+
:disabled="disabled"
15+
:elevation="2"
16+
:min-width="40"
17+
:loading="loading"
18+
:color="color"
19+
class="pa-0">
20+
<v-icon :small="hasDefaultSlot">{{ icon }}</v-icon>
21+
<slot></slot>
22+
</v-btn>
23+
</v-badge>
1324
</template>
1425

1526
<script lang="ts">
@@ -29,6 +40,9 @@ export default class BtnToolheadMove extends Vue {
2940
@Prop({ type: Boolean, default: false })
3041
loading!: boolean
3142
43+
@Prop({ type: String, default: '' })
44+
badge!: string
45+
3246
get hasDefaultSlot () {
3347
return !!this.$slots.default || !!this.$scopedSlots.default
3448
}

src/components/widgets/ToolheadMovesWidget.vue

Lines changed: 73 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<template>
22
<div>
33
<v-row no-gutters justify="start" class="mb-3">
4-
<v-col cols="auto" class="ml-13 mr-8">
4+
<v-col cols="auto" class="ml-13 mr-13">
55
<btn-toolhead-move
66
@click="sendMoveGcode('Y', toolheadMoveLength)"
77
:disabled="hasWaits || !xyHomed || !klippyConnected"
88
icon="$up">
99
</btn-toolhead-move>
1010
</v-col>
11-
<v-col cols="auto" class="ml-8">
11+
<v-col cols="auto" class="ml-3">
1212
<btn-toolhead-move
1313
@click="sendMoveGcode('Z', toolheadMoveLength)"
1414
:disabled="hasWaits || !zHomed || !klippyConnected"
@@ -17,22 +17,13 @@
1717
</v-col>
1818
</v-row>
1919
<v-row no-gutters justify="start" class="mb-3">
20-
<v-col cols="auto">
20+
<v-col cols="auto" class="mr-13">
2121
<btn-toolhead-move
2222
@click="sendMoveGcode('X', toolheadMoveLength, true)"
2323
:disabled="hasWaits || !xyHomed || !klippyConnected"
2424
icon="$left">
2525
</btn-toolhead-move>
2626
</v-col>
27-
<v-col cols="auto" class="ml-3">
28-
<btn-toolhead-move
29-
@click="sendGcode('G28 X Y', waits.onHomeXY)"
30-
:loading="hasWait(waits.onHomeXY)"
31-
:disabled="hasWaits || !klippyConnected"
32-
:color="(!xyHomed) ? 'warning' : 'secondary'"
33-
icon="$home">
34-
</btn-toolhead-move>
35-
</v-col>
3627
<v-col cols="auto" class="ml-3">
3728
<btn-toolhead-move
3829
@click="sendMoveGcode('X', toolheadMoveLength)"
@@ -41,13 +32,77 @@
4132
</btn-toolhead-move>
4233
</v-col>
4334
<v-col cols="auto" class="ml-3">
44-
<btn-toolhead-move
35+
<v-speed-dial
36+
v-model="fab"
37+
direction="right"
38+
open-on-hover
39+
transition="slide-y-reverse-transition"
40+
>
41+
<template v-slot:activator>
42+
<v-btn
43+
v-model="fab"
44+
class="px-0"
45+
:min-width="40"
46+
:loading="hasWait([waits.onHomeAll, waits.onHomeX, waits.onHomeY, waits.onHomeZ])"
47+
:color="(!allHomed) ? 'warning' : 'secondary'"
48+
>
49+
<v-icon v-if="fab">
50+
$close
51+
</v-icon>
52+
<v-icon v-else>
53+
$home
54+
</v-icon>
55+
</v-btn>
56+
</template>
57+
<v-btn
58+
:color="(!allHomed) ? 'warning' : 'secondary'"
59+
small
60+
:elevation="2"
61+
:loading="hasWait(waits.onHomeAll)"
62+
:disabled="!klippyConnected || printerPrinting || hasWait([waits.onHomeAll, waits.onHomeX, waits.onHomeY, waits.onHomeZ])"
63+
@click="sendGcode('G28', waits.onHomeAll)"
64+
>
65+
<v-icon small>$home</v-icon> All
66+
</v-btn>
67+
<v-btn
68+
:color="(!allHomed) ? 'warning' : 'secondary'"
69+
small
70+
:elevation="2"
71+
:loading="hasWait(waits.onHomeX)"
72+
:disabled="!klippyConnected || printerPrinting || hasWait([waits.onHomeAll, waits.onHomeX, waits.onHomeY, waits.onHomeZ])"
73+
@click="sendGcode('G28 X', waits.onHomeX)"
74+
>
75+
<v-icon small>$home</v-icon> X
76+
</v-btn>
77+
<v-btn
78+
:color="(!allHomed) ? 'warning' : 'secondary'"
79+
small
80+
:elevation="2"
81+
:loading="hasWait(waits.onHomeY)"
82+
:disabled="!klippyConnected || printerPrinting || hasWait([waits.onHomeAll, waits.onHomeX, waits.onHomeY, waits.onHomeZ])"
83+
@click="sendGcode('G28 Y', waits.onHomeY)"
84+
>
85+
<v-icon small>$home</v-icon> Y
86+
</v-btn>
87+
<v-btn
88+
:color="(!zHomed) ? 'warning' : 'secondary'"
89+
small
90+
:elevation="2"
91+
:loading="hasWait(waits.onHomeZ)"
92+
:disabled="!klippyConnected || printerPrinting || hasWait([waits.onHomeAll, waits.onHomeX, waits.onHomeY, waits.onHomeZ])"
93+
@click="sendGcode('G28 Z', waits.onHomeZ)"
94+
>
95+
<v-icon small>$home</v-icon> Z
96+
</v-btn>
97+
</v-speed-dial>
98+
<!-- <btn-toolhead-move
4599
@click="sendGcode('G28 Z', waits.onHomeZ)"
46100
:loading="hasWait(waits.onHomeZ)"
47101
:disabled="hasWaits || !klippyConnected"
48102
:color="(!zHomed) ? 'warning' : 'secondary'"
103+
badge="Z"
49104
icon="$home">
50-
</btn-toolhead-move>
105+
</btn-toolhead-move> -->
51106
</v-col>
52107
</v-row>
53108
<v-row no-gutters justify="start" class="mb-3">
@@ -93,6 +148,7 @@ import BtnToolheadMove from '@/components/inputs/BtnToolheadMove.vue'
93148
export default class ToolheadMovesWidget extends Mixins(UtilsMixin) {
94149
waits = Waits
95150
moveLength = ''
151+
fab = false
96152
97153
get toolheadMoveLength () {
98154
return (this.moveLength === '')
@@ -107,4 +163,7 @@ export default class ToolheadMovesWidget extends Mixins(UtilsMixin) {
107163
</script>
108164

109165
<style type="scss" scoped>
166+
::v-deep .v-speed-dial__list {
167+
flex-direction: column !important;
168+
}
110169
</style>

0 commit comments

Comments
 (0)