Skip to content

Commit

Permalink
fix(extruderPanel): add speed_factor to estimate extrusion calculation
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
(cherry picked from commit 4b17999)
  • Loading branch information
meteyou committed Jun 16, 2024
1 parent b5599ef commit ad29458
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/components/panels/Extruder/EstimatedExtrusionOutput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
{{ mdiDiameterVariant }}
</v-icon>
{{ nozzleDiameter }} mm
<v-tooltip v-if="showTooltip" top>
<template #activator="{ on, attrs }">
<v-icon small color="red" v-bind="attrs" v-on="on">
{{ mdiInformationOutline }}
</v-icon>
</template>
<span>
<div v-if="speed_factor !== 1">
{{ $t('Panels.ToolheadControlPanel.SpeedFactor') }}: {{ speed_factor * 100 }} %
</div>
<div v-if="extrudeFactor !== 1">
{{ $t('Panels.ExtruderControlPanel.ExtrusionFactor') }}: {{ extrudeFactor * 100 }} %
</div>
</span>
</v-tooltip>
</span>
</div>
</v-container>
Expand All @@ -16,12 +31,13 @@
<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { mdiDiameterVariant } from '@mdi/js'
import { mdiDiameterVariant, mdiInformationOutline } from '@mdi/js'
import ExtruderMixin from '@/components/mixins/extruder'
@Component({})
export default class PressureAdvanceSettings extends Mixins(BaseMixin, ExtruderMixin) {
mdiDiameterVariant = mdiDiameterVariant
mdiInformationOutline = mdiInformationOutline
get showEstimatedExtrusion() {
return this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo ?? true
Expand All @@ -35,8 +51,18 @@ export default class PressureAdvanceSettings extends Mixins(BaseMixin, ExtruderM
)
}
get speed_factor() {
return this.$store.state.printer.gcode_move?.speed_factor ?? 1
}
get volumetricFlow(): number {
return Math.round(Math.pow(this.filamentDiameter / 2, 2) * Math.PI * this.feedrate * 10) / 10
return (
Math.round(Math.pow(this.filamentDiameter / 2, 2) * Math.PI * this.feedrate * this.speed_factor * 10) / 10
)
}
get showTooltip() {
return this.speed_factor !== 1 || this.extrudeFactor !== 1
}
}
</script>

0 comments on commit ad29458

Please sign in to comment.