Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: toolhead control panel #712

Merged
merged 116 commits into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
8f63536
fix: add toString casting to fix weak IDE warnings
dw-0 Jan 18, 2022
7c4cee4
refactor: format code
dw-0 Jan 18, 2022
1145ad1
fix: add toString casting to fix weak IDE warnings
dw-0 Jan 18, 2022
c022b8a
feat: initial rough implementation of an extruder control panel
dw-0 Jan 23, 2022
7cc5426
fix: whitespaces
dw-0 Feb 2, 2022
4c7c779
fix: whitespaces
dw-0 Feb 2, 2022
7206a5f
feat: add extruder interface and getter
dw-0 Feb 2, 2022
95c6a56
feat: add `key` to extruder interface and getter
dw-0 Feb 6, 2022
20a2f75
merge: develop
dw-0 Mar 1, 2022
30f4bc0
chore: npm run format
dw-0 Mar 1, 2022
0dc90b8
refactor: make defaultValue for NumberInput optional
dw-0 Mar 2, 2022
e7a3f5d
merge: develop
dw-0 Mar 3, 2022
55fc4da
fix: NumberInput.vue remove unnecessary code
dw-0 Mar 4, 2022
b5bca97
refactor: kebab-case to camelCase
dw-0 Mar 4, 2022
28661b5
locale(en): english locales for ExtruderControlPanel.vue
dw-0 Mar 4, 2022
b5cb2a9
locale(de): german locales for ExtruderControlPanel.vue
dw-0 Mar 4, 2022
ba536d5
locale(de): update german locales
dw-0 Mar 4, 2022
796ced0
locale(en): update english locales
dw-0 Mar 4, 2022
1a3cebd
merge: develop
dw-0 Mar 7, 2022
7090e6b
fix: select input on focus
dw-0 Mar 8, 2022
0f7ee79
locales: rename "Hotend" to "Extruder"
dw-0 Mar 8, 2022
1d9c4ce
feat: make estimated extrusion info optional (enabled by default)
dw-0 Mar 8, 2022
bd4da70
feat: commit progress on ExtruderControlPanel
dw-0 Mar 8, 2022
7221b39
fix: add extruder-control-panel to index.ts and helpers.ts
dw-0 Mar 8, 2022
d8fc77d
refactor: make input section responsive
dw-0 Mar 8, 2022
a6eb7a8
fix: prevent invalid input on toolchange
dw-0 Mar 8, 2022
69386fb
refactor: improve subpanel visuals
dw-0 Mar 9, 2022
08def00
refactor: improve PressureAdvanceSettings responsive behaviour
dw-0 Mar 9, 2022
a653956
feat: move PressureAdvanceSettings from MachineSettingsPanel to Extru…
dw-0 Mar 9, 2022
70b266b
refactor: move extrusion factor slider above pressure advance settings
dw-0 Mar 10, 2022
93079b6
refactor: check for `printing` instead of `standby`
dw-0 Mar 11, 2022
9d4f128
refactor: remove debug code
dw-0 Mar 11, 2022
dc2f512
refactor: remove ControlPanelExtruder
dw-0 Mar 11, 2022
f35fcfd
refactor: remove ExtrusionFactor slider from PrintsettingsPanel
dw-0 Mar 11, 2022
8f3458b
locales: cleanup locales
dw-0 Mar 11, 2022
4d49af5
fix: search temperature_store_size in data_store and server (#705)
meteyou Mar 7, 2022
3ddd82a
fix: double defined variable viewport in SettingsDashboardTab.vue
meteyou Mar 8, 2022
bf6b3a2
fix: hide gcode thumbnail, if a webcam is active in printer farm (#706)
meteyou Mar 8, 2022
74561b0
refactor: remove deprecated code
dw-0 Mar 11, 2022
bf2dbc4
Merge branch 'develop' into feat/extruder-control-panel
dw-0 Mar 11, 2022
c79e926
fix: don't close 3-dot menu on button click
dw-0 Mar 13, 2022
f9a296b
locales: update all locales
dw-0 Mar 13, 2022
748b8d9
refactor: rename ControlPanel to ToolheadControlPanel
dw-0 Mar 12, 2022
0abc4f9
locales: update all locales
dw-0 Mar 12, 2022
abf4ba7
style(cross-control): clean up props and css
dw-0 Mar 13, 2022
6d8a7a9
refactor: reduce button group height
dw-0 Mar 13, 2022
f24c878
fix: add missing `mandatory` prop (fixes #653)
dw-0 Mar 13, 2022
99b4535
refactor: move speed factor slider into toolhead controls
dw-0 Mar 13, 2022
4f6ebf9
locales: update all locales
dw-0 Mar 13, 2022
aea84a3
refactor: make prop `unit` optional in NumberInput
dw-0 Mar 14, 2022
d82ab02
wip: wip push
dw-0 Mar 20, 2022
afdd50c
refactor: remove deprecated global getter
dw-0 Mar 21, 2022
e07ef60
wip: wip
dw-0 Mar 21, 2022
208bcff
wip: clean up
dw-0 Mar 23, 2022
d62130f
fix: changing labels don't overlap input border anymore
dw-0 Mar 23, 2022
ff6e852
locales: clean up
dw-0 Mar 24, 2022
8f8ac5e
wip: ¯\_(ツ)_/¯
dw-0 Mar 24, 2022
a62e51d
wip: \(0^◇^0)/
dw-0 Mar 24, 2022
c2e0af4
locales: more clean ups
dw-0 Mar 24, 2022
11ec945
fix: allow text overflow
dw-0 Mar 24, 2022
1d77e6c
locales: moar cleanup
dw-0 Mar 24, 2022
62e5a11
refactor(controls.ts): remove redundant code
dw-0 Mar 24, 2022
b6fc814
feat: setting to enable XY homing
dw-0 Mar 24, 2022
c458a1b
wip: wip
dw-0 Mar 24, 2022
7319ec3
refactor: circle control
dw-0 Mar 24, 2022
f2d92cf
wip: extend circle control features
dw-0 Mar 25, 2022
c86fbb5
fix: make ids unique
dw-0 Mar 25, 2022
5395d81
fix: condition
dw-0 Mar 25, 2022
2039d0f
refactor: add default value to action button overwrite (#2)
meteyou Mar 25, 2022
bdef4b5
style: remove debug code
dw-0 Mar 25, 2022
bb4751a
wip: wip
dw-0 Mar 25, 2022
eb87b34
wip: wip
dw-0 Mar 26, 2022
d3c2b61
fix: wrong getter path in defaultActionButton (#3)
meteyou Mar 26, 2022
3c724fe
style: clean up unused code
dw-0 Mar 26, 2022
2712618
refactor: default action button
dw-0 Mar 26, 2022
6ecd05e
refactor: SettingsControlTab
dw-0 Mar 26, 2022
11398c0
locales: update en & de
dw-0 Mar 26, 2022
b2a69b0
fix: weak eslint warnings
dw-0 Mar 26, 2022
1dcac80
fix: show additional actionButton in 3-dot menu
dw-0 Mar 27, 2022
4adc8fa
chore: remove debug code
dw-0 Mar 27, 2022
5378ddf
feat: add more default calibration buttons
dw-0 Mar 27, 2022
fbe69a6
refactor: better responsive behavior for move to controls
dw-0 Mar 27, 2022
65533a4
feat: always show z-offset controls
dw-0 Mar 27, 2022
0482a8c
fix: misalignment due to hyphen instead of minus
dw-0 Mar 27, 2022
b1354d7
fix: button padding
dw-0 Mar 27, 2022
5769369
todo: achieve full responsive toolhead panel content
dw-0 Mar 27, 2022
8d1142d
locals: update en & de
dw-0 Mar 27, 2022
0d3dea0
feat: disallow extrusion on too large extrusion request and show tooltip
dw-0 Mar 27, 2022
6e52472
merge: develop
dw-0 Mar 27, 2022
dba4467
fix: restore PrinterStateExtruder interface
dw-0 Mar 27, 2022
9da8579
fix: x direction padding to the panel edge 12px wide
dw-0 Mar 27, 2022
3803f7c
fix: tweak some more padding
dw-0 Mar 27, 2022
e8f908e
refactor: improve responsive behavior
dw-0 Mar 28, 2022
248dad4
༼ つ ◕_◕ ༽つ
dw-0 Mar 30, 2022
e87feb6
fix(responsive.ts): issue with wrong indication of height leading to …
dw-0 Apr 5, 2022
8263072
refactor(SubPanel.vue): `chevron-down` as default icon
dw-0 Apr 5, 2022
1de125b
Merge branch 'develop' into feat/extruder-control-panel
dw-0 Apr 5, 2022
1023469
Merge branch 'feat/extruder-control-panel' into feat/toolhead-control…
dw-0 Apr 5, 2022
e6f64fb
refactor(BarsControl): replace v-btn-toggle with v-item-group
dw-0 Apr 6, 2022
7752731
refactor(ZoffsetControl): replace v-btn-toggle with v-item-group
dw-0 Apr 6, 2022
4538ca4
feat(CrossControl): better responsiveness
dw-0 Apr 6, 2022
f1dda70
wip(ToolheadControlPanel): cross + bars control responsiveness
dw-0 Apr 6, 2022
a5446ed
wip
dw-0 Apr 6, 2022
36dcab2
Merge branch 'develop' into feat/extruder-control-panel
dw-0 Apr 6, 2022
449e067
Merge branch 'feat/extruder-control-panel' into feat/toolhead-control…
dw-0 Apr 6, 2022
0fb3f22
fix(ToolheadControlPanel.vue): fixed height for zoffset control in x-…
dw-0 Apr 7, 2022
3dbd399
refactor(ToolheadControlPanel.vue): full responsiveness of circle con…
dw-0 Apr 7, 2022
9af279d
mete: remove subpanel for collapsing pressure advance settings
dw-0 Apr 11, 2022
7da4a85
Merge branch 'feat/extruder-control-panel' into feat/toolhead-control…
dw-0 Apr 11, 2022
2436ad7
mete: remove full responsive behaviour of all control styles
dw-0 Apr 11, 2022
16da7f3
mete: apply requested changes
dw-0 Apr 11, 2022
50366e6
chore: typos in comments
dw-0 Apr 11, 2022
faa7329
fix: some small issues (#4)
meteyou Apr 24, 2022
13704b3
Merge branch 'develop' into feat/toolhead-control-panel
meteyou Apr 24, 2022
6951bdc
fix: fix some merge issues
meteyou Apr 24, 2022
92a4d2a
Merge remote-tracking branch 'th33xitus/feat/toolhead-control-panel' …
meteyou Apr 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions src/components/inputs/MoveToInput.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<template>
<v-text-field
v-model="position"
:label="`[ ${label} ]`"
:suffix="suffix"
:disabled="disabled"
:readonly="readonly"
:error="!validate"
hide-details="auto"
type="number"
hide-spin-buttons
outlined
reverse
dense
@blur="onBlur"
@focus="!readonly ? $event.target.select() : {}">
<template v-if="errorMsg.length" #append>
<v-tooltip top>
<template #activator="{ on, attrs }">
<v-icon color="error" v-bind="attrs" v-on="on">{{ mdiAlert }}</v-icon>
</template>
<span>{{ errorMsg.join(', ') }}</span>
</v-tooltip>
</template>
</v-text-field>
</template>

<script lang="ts">
import { Component, Mixins, Prop, VModel } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { mdiAlert } from '@mdi/js'

@Component({
components: {},
})
export default class MoveToInput extends Mixins(BaseMixin) {
mdiAlert = mdiAlert

@VModel({ type: String })
declare position: string

@Prop({ type: String, required: true })
declare readonly currentPos: string

@Prop({ type: String, required: false })
declare readonly label: string

@Prop({ type: String, required: false })
declare readonly suffix: string

@Prop({ type: Number, required: true })
declare readonly positionMax: number

@Prop({ type: Number, required: true })
declare readonly positionMin: number

@Prop({ type: Boolean, required: false })
declare readonly disabled: boolean

@Prop({ type: Boolean, required: false })
declare readonly readonly: boolean

onBlur() {
if (!this.validate && this.position !== this.currentPos) {
this.position = this.currentPos
this.$emit('validate', { axis: this.suffix.toLowerCase(), valid: true })
}
}

get validate(): boolean {
const isValid =
this.position !== '' &&
parseFloat(this.position) <= this.positionMax &&
parseFloat(this.position) >= this.positionMin
this.$emit('validate', { axis: this.suffix.toLowerCase(), valid: isValid })
return isValid
}

get errorMsg() {
const errors = []
if (this.position === '') errors.push(this.$t('Panels.ToolheadControlPanel.Invalid'))
if (parseFloat(this.position) > this.positionMax || parseFloat(this.position) < this.positionMin)
errors.push(this.$t('Panels.ToolheadControlPanel.OutOfRange'))

return errors
}
}
</script>

<style>
label {
font-size: 14px !important;
color: rgba(255, 255, 255, 0.5) !important;
}

.v-input.error--text .v-input__slot {
padding-left: 3px !important;
}

.v-input.error--text .v-input__append-inner {
margin-right: 5px !important;
}
</style>
2 changes: 1 addition & 1 deletion src/components/inputs/NumberInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default class NumberInput extends Mixins(BaseMixin) {
@Prop({ type: Number, required: false, default: 1 })
declare readonly step: number

@Prop({ type: String, required: true })
@Prop({ type: String, required: false })
declare readonly unit: string

// spinner related props
Expand Down
39 changes: 30 additions & 9 deletions src/components/mixins/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default class ControlMixin extends Vue {
return this.$store.state.printer?.toolhead?.homed_axes ?? ''
}

get enableXYHoming(): boolean {
return this.$store.state.gui.control.enableXYHoming
}

get feedrateXY() {
return this.$store.state.gui.control?.feedrateXY ?? 100
}
Expand All @@ -20,19 +24,27 @@ export default class ControlMixin extends Vue {
}

get existsQGL() {
if (!this.$store.state.printer.configfile?.settings) {
return false
}

return 'quad_gantry_level' in this.$store.state.printer.configfile.settings ?? false
return this.$store.getters['printer/existsQGL']
}

get existsZtilt() {
if (!this.$store.state.printer.configfile?.settings) {
return false
}
return this.$store.getters['printer/existsZtilt']
}

get existsBedTilt() {
return this.$store.getters['printer/existsBedTilt']
}

get existsBedScrews() {
return this.$store.getters['printer/existsBedScrews']
}

get existsDeltaCalibrate() {
return this.$store.getters['printer/existsDeltaCalibrate']
}

return 'z_tilt' in this.$store.state.printer.configfile.settings ?? false
get existsScrewsTilt() {
return this.$store.getters['printer/existsScrewsTilt']
}

get colorQuadGantryLevel() {
Expand All @@ -47,6 +59,10 @@ export default class ControlMixin extends Vue {
return status ? 'primary' : 'warning'
}

get defaultActionButton() {
return this.$store.getters['gui/getDefaultControlActionButton']
}

doHome() {
this.$store.dispatch('server/addEvent', { message: 'G28', type: 'command' })
this.$socket.emit('printer.gcode.script', { script: 'G28' }, { loading: 'homeAll' })
Expand All @@ -62,6 +78,11 @@ export default class ControlMixin extends Vue {
this.$socket.emit('printer.gcode.script', { script: 'G28 Y' }, { loading: 'homeY' })
}

doHomeXY() {
this.$store.dispatch('server/addEvent', { message: 'G28 X Y', type: 'command' })
this.$socket.emit('printer.gcode.script', { script: 'G28 X Y' }, { loading: 'homeXY' })
}

doHomeZ() {
this.$store.dispatch('server/addEvent', { message: 'G28 Z', type: 'command' })
this.$socket.emit('printer.gcode.script', { script: 'G28 Z' }, { loading: 'homeZ' })
Expand Down
39 changes: 0 additions & 39 deletions src/components/panels/ControlPanel.vue
Original file line number Diff line number Diff line change
@@ -1,39 +0,0 @@
<template>
<panel
v-if="klipperReadyForGui && ['standby', 'paused', 'complete', 'cancelled', 'error'].includes(printer_state)"
:icon="mdiGamepad"
:title="$t('Panels.ControlPanel.Headline').toString()"
:collapsible="true"
card-class="control-panel">
<v-container>
<control-panel-cross-control v-if="controlStyle === 'cross'"></control-panel-cross-control>
<control-panel-circle-control v-else-if="controlStyle === 'circle'"></control-panel-circle-control>
<control-panel-bars-control v-else></control-panel-bars-control>
</v-container>
</panel>
</template>

<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator'
import BaseMixin from '../mixins/base'
import ControlPanelCrossControl from '@/components/panels/ControlPanelCrossControl.vue'
import ControlPanelBarsControl from '@/components/panels/ControlPanelBarsControl.vue'
import ControlPanelCircleControl from '@/components/panels/ControlPanelCircleControl.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiGamepad } from '@mdi/js'
@Component({
components: {
Panel,
ControlPanelCircleControl,
ControlPanelBarsControl,
ControlPanelCrossControl,
},
})
export default class ControlPanel extends Mixins(BaseMixin) {
mdiGamepad = mdiGamepad

get controlStyle() {
return this.$store.state.gui.control.style ?? 'bars'
}
}
</script>
Loading