feature: dynamic max of machine limits
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
@@ -5,13 +5,13 @@
|
|||||||
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>{{ $t('Settings.LimitsPanel.MachineLimits')}}</span>
|
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>{{ $t('Settings.LimitsPanel.MachineLimits')}}</span>
|
||||||
</v-toolbar-title>
|
</v-toolbar-title>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
<tool-slider :label="$t('Settings.LimitsPanel.Velocity')" unit="mm/s" :target="current_velocity" :max="max_velocity" :default-value="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
|
<tool-slider :label="$t('Settings.LimitsPanel.Velocity')" unit="mm/s" :target="current_velocity" :max="max_velocity" :default-value="max_velocity" :step="50" :dynamic-range="true" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<tool-slider :label="$t('Settings.LimitsPanel.Acceleration')" unit="mm/s²" :target="current_accel" :max="max_accel" :default-value="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
|
<tool-slider :label="$t('Settings.LimitsPanel.Acceleration')" unit="mm/s²" :target="current_accel" :max="max_accel" :default-value="max_accel" :step="100" :dynamic-range="true" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<tool-slider :label="$t('Settings.LimitsPanel.Deceleration')" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" :default-value="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
|
<tool-slider :label="$t('Settings.LimitsPanel.Deceleration')" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" :default-value="max_accel_to_decel" :step="100" :dynamic-range="true" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<tool-slider :label="$t('Settings.LimitsPanel.SquareCornerVelocity')" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" :default-value="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
<tool-slider :label="$t('Settings.LimitsPanel.SquareCornerVelocity')" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" :default-value="max_square_corner_velocity" :step="1" :dynamic-range="true" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -33,7 +33,6 @@
|
|||||||
current_accel: state => state.printer.toolhead.max_accel,
|
current_accel: state => state.printer.toolhead.max_accel,
|
||||||
current_accel_to_decel: state => state.printer.toolhead.max_accel_to_decel,
|
current_accel_to_decel: state => state.printer.toolhead.max_accel_to_decel,
|
||||||
current_square_corner_velocity: state => state.printer.toolhead.square_corner_velocity,
|
current_square_corner_velocity: state => state.printer.toolhead.square_corner_velocity,
|
||||||
config: state => state.printer.configfile.settings,
|
|
||||||
max_velocity: state => state.printer.configfile.settings.printer.max_velocity || 0,
|
max_velocity: state => state.printer.configfile.settings.printer.max_velocity || 0,
|
||||||
max_accel: state => state.printer.configfile.settings.printer.max_accel || 0,
|
max_accel: state => state.printer.configfile.settings.printer.max_accel || 0,
|
||||||
max_accel_to_decel: state => state.printer.configfile.settings.printer.max_accel_to_decel || 0,
|
max_accel_to_decel: state => state.printer.configfile.settings.printer.max_accel_to_decel || 0,
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
:max="processedMax"
|
:max="processedMax"
|
||||||
@start="sliding = true"
|
@start="sliding = true"
|
||||||
@end="sendCmd()"
|
@end="sendCmd()"
|
||||||
|
:color="colorBar"
|
||||||
hide-details>
|
hide-details>
|
||||||
|
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
@@ -139,7 +140,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
colorBar() {
|
||||||
|
return this.max < this.value ? "warning" : "primary"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
target: {
|
target: {
|
||||||
@@ -154,18 +157,18 @@
|
|||||||
this.processingTimer = null;
|
this.processingTimer = null;
|
||||||
}
|
}
|
||||||
if (this.value >= this.processedMax) {
|
if (this.value >= this.processedMax) {
|
||||||
this.processingTimer = setTimeout(() => {
|
//this.processingTimer = setTimeout(() => {
|
||||||
const [min, max] = this.dynamicClamp;
|
//const [min, max] = this.dynamicClamp;
|
||||||
this.processedMin = Math.max(min, this.value - this.dynamicStep);
|
this.processedMin = Math.min(this.min, this.value - this.dynamicStep);
|
||||||
this.processedMax = Math.min(max, this.value + this.dynamicStep);
|
this.processedMax = Math.max(this.max, this.value + this.dynamicStep, newVal);
|
||||||
}, this.dynamicDebounceTime);
|
//}, this.dynamicDebounceTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
max: {
|
max: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
this.processedMax = newVal
|
this.processedMax = newVal > this.value ? newVal : Math.ceil(this.value / this.step) * this.step
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -183,7 +186,7 @@
|
|||||||
this.sendCmd(true);
|
this.sendCmd(true);
|
||||||
},
|
},
|
||||||
increment() {
|
increment() {
|
||||||
this.value = this.value < this.processedMax ? Math.round(this.value + this.step) : this.processedMax
|
this.value = this.value < this.processedMax || this.dynamicRange ? Math.round(this.value + this.step) : this.processedMax
|
||||||
this.sendCmd(true);
|
this.sendCmd(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user