diff --git a/src/components/widgets/status/StatusTab.vue b/src/components/widgets/status/StatusTab.vue index 1d2aa9f0ac..0b3a00a9fd 100644 --- a/src/components/widgets/status/StatusTab.vue +++ b/src/components/widgets/status/StatusTab.vue @@ -71,7 +71,7 @@ - {{ $filters.getReadableLengthString(filament_used) }} + {{ $filters.getReadableLengthString(filament_used) }} / {{ $filters.getReadableLengthString(filament_total) }}
remaining: {{filament_weight_needed.toFixed(2)}} g
@@ -341,6 +341,18 @@ export default class StatusTab extends Mixins(StateMixin, FilesMixin) { return this.$store.state.printer.printer.current_file.filament_total || 0 } + /** + * Total filament weight according to the current file / slicer. + */ + get filament_weight_needed () { + const filament_weight_total = this.$store.state.printer.printer.current_file.filament_weight_total || 0 + if (this.filament_used > 0 && this.filament_total > 0 && filament_weight_total > 0) { + return (1 - this.filament_used / this.filament_total) * filament_weight_total + } else { + return 0 + } + } + /** * Work out flow provided our used filament changed, and we've not calculated * within a given delta (2sec).