feature: limit requested_speed wiht current max_velocity
cleanup StatusPanel.vue Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
@@ -133,7 +133,7 @@
|
||||
<v-row class="text-center py-5" align="center">
|
||||
<v-col class="col-3 pa-0">
|
||||
<strong>{{ $t("Panels.StatusPanel.Speed") }}</strong><br />
|
||||
<span class="text-no-wrap">{{ (requested_speed / 60 * speed_factor).toFixed(0) }} mm/s</span>
|
||||
<span class="text-no-wrap">{{ requested_speed.toFixed(0) }} mm/s</span>
|
||||
</v-col>
|
||||
<v-col class="col-3 pa-0">
|
||||
<v-tooltip top>
|
||||
@@ -271,15 +271,12 @@
|
||||
position: state => state.printer.gcode_move.position,
|
||||
gcode_position: state => state.printer.gcode_move.gcode_position,
|
||||
|
||||
requested_speed: state => state.printer.gcode_move.speed,
|
||||
speed_factor: state => state.printer.gcode_move.speed_factor,
|
||||
filament_used: state => state.printer.print_stats.filament_used,
|
||||
current_file: state => state.printer.current_file,
|
||||
print_time: state => state.printer.print_stats.print_duration,
|
||||
print_time_total: state => state.printer.print_stats.total_duration,
|
||||
}),
|
||||
printerStateOutput: {
|
||||
get() {
|
||||
printerStateOutput() {
|
||||
if (this.$store.state.printer.print_stats.state !== "") {
|
||||
const printer_state = this.$store.state.printer.print_stats.state
|
||||
|
||||
@@ -296,10 +293,8 @@
|
||||
}
|
||||
|
||||
return this.$t("Panels.StatusPanel.Unknown")
|
||||
}
|
||||
},
|
||||
toolbarButtons: {
|
||||
get() {
|
||||
toolbarButtons() {
|
||||
return [
|
||||
{
|
||||
text: this.$t("Panels.StatusPanel.PausePrint"),
|
||||
@@ -338,22 +333,26 @@
|
||||
click: this.btnReprintJob
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
filteredToolbarButtons: {
|
||||
get() {
|
||||
filteredToolbarButtons() {
|
||||
return this.toolbarButtons.filter((button) => {
|
||||
return button.status.includes(this.printer_state)
|
||||
})
|
||||
}
|
||||
},
|
||||
printPercent: {
|
||||
get() {
|
||||
return this.$store.getters["printer/getPrintPercent"];
|
||||
}
|
||||
printPercent() {
|
||||
return this.$store.getters["printer/getPrintPercent"]
|
||||
},
|
||||
max_layers: {
|
||||
get() {
|
||||
requested_speed() {
|
||||
const requested_speed = this.$store.state.printer.gcode_move.speed
|
||||
const speed_factor = this.$store.state.printer.gcode_move.speed_factor
|
||||
const max_velocity = this.$store.state.printer.toolhead.max_velocity
|
||||
|
||||
const speed = requested_speed / 60 * speed_factor
|
||||
if (speed > max_velocity) return max_velocity
|
||||
|
||||
return speed
|
||||
},
|
||||
max_layers() {
|
||||
if (
|
||||
'first_layer_height' in this.current_file &&
|
||||
'layer_height' in this.current_file &&
|
||||
@@ -364,10 +363,8 @@
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
},
|
||||
current_layer: {
|
||||
get() {
|
||||
current_layer() {
|
||||
if (
|
||||
this.print_time > 0 &&
|
||||
'first_layer_height' in this.current_file &&
|
||||
@@ -382,45 +379,29 @@
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
},
|
||||
estimated_time_file: {
|
||||
get() {
|
||||
estimated_time_file() {
|
||||
return this.$store.getters["printer/getEstimatedTimeFile"]
|
||||
}
|
||||
},
|
||||
estimated_time_filament: {
|
||||
get() {
|
||||
estimated_time_filament() {
|
||||
return this.$store.getters["printer/getEstimatedTimeFilament"]
|
||||
}
|
||||
},
|
||||
estimated_time_slicer: {
|
||||
get() {
|
||||
estimated_time_slicer() {
|
||||
return this.$store.getters["printer/getEstimatedTimeSlicer"]
|
||||
}
|
||||
},
|
||||
estimated_time_avg: {
|
||||
get() {
|
||||
estimated_time_avg() {
|
||||
return this.$store.getters["printer/getEstimatedTimeAvg"]
|
||||
}
|
||||
},
|
||||
eta: {
|
||||
get() {
|
||||
eta() {
|
||||
return this.$store.getters["printer/getEstimatedTimeETA"]
|
||||
}
|
||||
},
|
||||
filament_diameter: {
|
||||
get() {
|
||||
filament_diameter() {
|
||||
return this.$store.state.printer.configfile.settings.extruder?.filament_diameter || 1.75
|
||||
}
|
||||
},
|
||||
basicUrl: {
|
||||
get() {
|
||||
basicUrl() {
|
||||
return this.$store.getters["socket/getUrl"]
|
||||
}
|
||||
},
|
||||
thumbnailSmall: {
|
||||
get() {
|
||||
thumbnailSmall() {
|
||||
if (
|
||||
"thumbnails" in this.current_file &&
|
||||
this.current_file.thumbnails.length
|
||||
@@ -441,10 +422,8 @@
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
},
|
||||
thumbnailBig: {
|
||||
get() {
|
||||
thumbnailBig() {
|
||||
if (
|
||||
"thumbnails" in this.current_file &&
|
||||
this.current_file.thumbnails.length
|
||||
@@ -463,7 +442,6 @@
|
||||
|
||||
return ""
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
btnPauseJob() {
|
||||
|
Reference in New Issue
Block a user