Skip to content

Commit

Permalink
fix: change Min Cruise Ratio to percent in MachineSettingsPanel
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <[email protected]>
  • Loading branch information
meteyou committed Sep 4, 2024
1 parent 7785c21 commit 7d4db8c
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/components/panels/MachineSettingsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
</v-col>
</v-row>
</v-card-text>
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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}`
Expand Down

0 comments on commit 7d4db8c

Please sign in to comment.