Skip to content

Commit 762399e

Browse files
committed
feat: enable machine limits
1 parent 38c563c commit 762399e

4 files changed

Lines changed: 77 additions & 71 deletions

File tree

src/components/widgets/PrinterLimitsWidget.vue

Lines changed: 71 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,67 @@
11
<template>
2-
<v-expansion-panels flat>
3-
<v-expansion-panel>
4-
<v-expansion-panel-header>Acceleration, Velocity &amp; Limits</v-expansion-panel-header>
5-
<v-expansion-panel-content>
6-
<!-- <v-col>
7-
Velocity Limits
8-
These are not persistent. They will reset to your printer configuration on host reboot.
9-
<v-divider></v-divider>
10-
</v-col> -->
11-
<!-- Speed and Flow Adjust -->
12-
<v-row>
13-
<v-col cols="12" sm="6" class="px-2 pt-0 pb-5">
14-
<input-slider
15-
label="Velocity"
16-
value-suffix="mm/s"
17-
:value="velocity.current"
18-
:min="0"
19-
:max="velocity.max"
20-
:disabled="!klippyConnected"
21-
:loading="hasWait(waits.onSetVelocity)"
22-
@input="setVelocity($event)">
23-
</input-slider>
24-
</v-col>
25-
<v-col cols="12" sm="6" class="px-2 pt-0 pb-5">
26-
<input-slider
27-
label="Square Corner Velocity"
28-
value-suffix="mm/s"
29-
:value="scv.current"
30-
:min="0"
31-
:max="scv.max"
32-
:disabled="!klippyConnected"
33-
:loading="hasWait(waits.onSetSQV)"
34-
@input="setSCV($event)">
35-
</input-slider>
36-
</v-col>
37-
</v-row>
38-
<v-row>
39-
<v-col cols="12" sm="6" class="px-2 py-0">
40-
<input-slider
41-
label="Acceleration"
42-
value-suffix="mm/s^2"
43-
:value="accel.current"
44-
:min="0"
45-
:max="accel.max"
46-
:disabled="!klippyConnected"
47-
:loading="hasWait(waits.onSetAcceleration)"
48-
@input="setAcceleration($event)">
49-
</input-slider>
50-
</v-col>
51-
<v-col cols="12" sm="6" class="px-2 py-0">
52-
<input-slider
53-
label="Deceleration"
54-
value-suffix="mm/s^2"
55-
:value="decel.current"
56-
:min="0"
57-
:max="decel.max"
58-
:disabled="!klippyConnected"
59-
:loading="hasWait(waits.onSetDeceleration)"
60-
@input="setDeceleration($event)">
61-
</input-slider>
62-
</v-col>
63-
</v-row>
64-
</v-expansion-panel-content>
65-
</v-expansion-panel>
66-
</v-expansion-panels>
2+
<div>
3+
<v-btn block text @click="limitsVisible = !limitsVisible" class="mb-2">
4+
{{ (limitsVisible) ? 'Hide' : 'Show' }} machine limits
5+
<v-icon>{{ (limitsVisible) ? icons.chevronUp : icons.chevronDown }}</v-icon>
6+
</v-btn>
7+
<v-expand-transition>
8+
<!-- Speed and Flow Adjust -->
9+
<div v-show="limitsVisible">
10+
<v-row>
11+
<v-col cols="12" sm="6" class="px-2 pt-0 pb-5">
12+
<input-slider
13+
label="Velocity"
14+
value-suffix="mm/s"
15+
:value="velocity.current"
16+
:min="0"
17+
:max="velocity.max"
18+
:disabled="!klippyConnected"
19+
:loading="hasWait(waits.onSetVelocity)"
20+
@input="setVelocity($event)">
21+
</input-slider>
22+
</v-col>
23+
<v-col cols="12" sm="6" class="px-2 pt-0 pb-5">
24+
<input-slider
25+
label="Square Corner Velocity"
26+
value-suffix="mm/s"
27+
:value="scv.current"
28+
:min="0"
29+
:max="scv.max"
30+
:disabled="!klippyConnected"
31+
:loading="hasWait(waits.onSetSQV)"
32+
@input="setSCV($event)">
33+
</input-slider>
34+
</v-col>
35+
</v-row>
36+
<v-row>
37+
<v-col cols="12" sm="6" class="px-2 pt-0 pb-0">
38+
<input-slider
39+
label="Acceleration"
40+
value-suffix="mm/s^2"
41+
:value="accel.current"
42+
:min="0"
43+
:max="accel.max"
44+
:disabled="!klippyConnected"
45+
:loading="hasWait(waits.onSetAcceleration)"
46+
@input="setAcceleration($event)">
47+
</input-slider>
48+
</v-col>
49+
<v-col cols="12" sm="6" class="px-2 pt-0 pb-0">
50+
<input-slider
51+
label="Deceleration"
52+
value-suffix="mm/s^2"
53+
:value="decel.current"
54+
:min="0"
55+
:max="decel.max"
56+
:disabled="!klippyConnected"
57+
:loading="hasWait(waits.onSetDeceleration)"
58+
@input="setDeceleration($event)">
59+
</input-slider>
60+
</v-col>
61+
</v-row>
62+
</div>
63+
</v-expand-transition>
64+
</div>
6765
</template>
6866

6967
<script lang="ts">
@@ -80,6 +78,14 @@ import InputSlider from '@/components/inputs/InputSlider.vue'
8078
export default class PrinterLimitsWidget extends Mixins(UtilsMixin) {
8179
waits = Waits
8280
81+
get limitsVisible (): boolean {
82+
return this.$store.state.config.localConfig.limitsVisible
83+
}
84+
85+
set limitsVisible (val: boolean) {
86+
this.$store.dispatch('config/saveLocalStorage', { limitsVisible: val })
87+
}
88+
8389
get velocity () {
8490
const max = parseInt(this.$store.state.socket.printer.configfile.config.printer.max_velocity)
8591
return {

src/components/widgets/ToolheadWidget.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@
88
</v-col>
99

1010
<v-col class="pt-0">
11-
<!-- Extruder Moves, Tooldhead Position-->
12-
<!-- <v-container fluid class="pa-0"> -->
13-
<extruder-moves-widget v-if="!printerPrinting"></extruder-moves-widget>
14-
<toolhead-position-widget></toolhead-position-widget>
15-
<!-- </v-container> -->
11+
<extruder-moves-widget v-if="!printerPrinting"></extruder-moves-widget>
12+
<toolhead-position-widget></toolhead-position-widget>
1613
</v-col>
1714
</v-row>
1815

1916
<v-row>
2017
<v-col class="pt-0">
2118
<!-- Part cooling -->
2219
<fans-widget></fans-widget>
20+
2321
<!-- Speed and Flow Adjustments -->
2422
<speed-and-flow-adjust-widget></speed-and-flow-adjust-widget>
25-
<!-- <printer-limits-widget></printer-limits-widget> -->
23+
<printer-limits-widget></printer-limits-widget>
2624
</v-col>
2725
</v-row>
2826
</v-container>

src/store/config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const state: ConfigState = {
1515
localConfig: {
1616
cameraVisible: false,
1717
chartVisible: true,
18+
limitsVisible: false,
1819
darkMode: true
1920
},
2021
fileConfig: {

src/store/config/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface LocalConfig {
1212
[key: string]: string | boolean | number;
1313
cameraVisible: boolean;
1414
chartVisible: boolean;
15+
limitsVisible: boolean;
1516
darkMode: boolean;
1617
}
1718

0 commit comments

Comments
 (0)