Skip to content

Commit

Permalink
fix: don't use separator for gcode macros (#1483)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas authored Aug 15, 2024
1 parent e3ed531 commit 7ec4626
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/widgets/macros/MacroBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export default class MacroBtn extends Mixins(StateMixin) {
return ['m117', 'm118'].includes(this.macro.name)
}
get isMacroForGcodeCommand () {
return /^[gm]\d+$/i.test(this.macro.name)
}
get filteredListeners () {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { click, ...listeners } = this.$listeners
Expand All @@ -114,12 +118,15 @@ export default class MacroBtn extends Mixins(StateMixin) {
*/
get runCommand () {
const command = this.macro.name.toUpperCase()
const paramSeparator = this.isMacroForGcodeCommand
? ''
: '='
if (this.params) {
const params = this.isMacroWithRawParam
? this.params.message.value.toString()
: Object.entries(this.params)
.map(([key, param]) => `${key.toUpperCase()}=${param.value}`)
.map(([key, param]) => `${key.toUpperCase()}${paramSeparator}${param.value}`)
.join(' ')
if (params) {
Expand Down

0 comments on commit 7ec4626

Please sign in to comment.