fix: calc multiplicator for set_pin gcode (#1870)

Co-authored-by: Patrick Stainbrook <patrick.stainbrook@cde-systems.de>
This commit is contained in:
rackrick
2024-05-03 18:44:13 +02:00
committed by GitHub
parent d7a9abe992
commit d1344f2b63

View File

@@ -199,9 +199,10 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
sendCmd(newVal: number): void {
if (this.value === newVal) return
let gcode = `SET_PIN PIN=${this.name} VALUE=${newVal.toFixed(2)}`
if (newVal < this.min) newVal = 0
newVal = newVal * this.multi
let gcode = `SET_PIN PIN=${this.name} VALUE=${newVal.toFixed(2)}`
if (this.type === 'fan') gcode = `M106 S${newVal.toFixed(0)}`
if (this.type === 'fan_generic') gcode = `SET_FAN_SPEED FAN=${this.name} SPEED=${newVal}`
if (this.type === 'led')