diff --git a/src/components/panels/MachineSettingsPanel.vue b/src/components/panels/MachineSettingsPanel.vue index f2fc497dd..73319a34a 100644 --- a/src/components/panels/MachineSettingsPanel.vue +++ b/src/components/panels/MachineSettingsPanel.vue @@ -87,11 +87,12 @@ :output-error-msg="true" :has-spinner="true" :spinner-factor="5" - :step="0.01" - :min="0.0" - :max="0.99" - :dec="2" - @submit="sendCmd" /> + :step="1" + :min="0" + :max="99" + :dec="0" + unit="%" + @submit="sendCruiseRatioCmd" /> @@ -144,7 +145,7 @@ export default class MachineSettingsPanel extends Mixins(BaseMixin) { if (value === null) return null - return Math.round(value * 100) / 100 + return Math.round(value * 100) } get squareCornerVelocity(): number { @@ -166,7 +167,7 @@ export default class MachineSettingsPanel extends Mixins(BaseMixin) { get defaultMinimumCruiseRatio(): number { const value = this.configPrinter.minimum_cruise_ratio ?? 0.5 - return Math.round(value / 10) * 10 + return Math.round(value * 100) } get defaultSquareCornerVelocity(): number { @@ -175,6 +176,12 @@ export default class MachineSettingsPanel extends Mixins(BaseMixin) { return Math.floor(value * 10) / 10 } + sendCruiseRatioCmd(params: { name: string; value: number }): void { + params.value = params.value / 100 + + this.sendCmd(params) + } + @Debounce(500) sendCmd(params: { name: string; value: number }): void { const gcode = `SET_VELOCITY_LIMIT ${params.name}=${params.value}`