bugfix: gcode_position unknown fixed in StatusPanel.vue

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej
2021-01-16 02:25:16 +01:00
parent 354f6e9250
commit 5fd89c2600

View File

@@ -129,7 +129,7 @@
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on">{{ position.length ? position[2].toFixed(2) : "--" }}</span>
</template>
<span v-if="gcode_position.length >= 3">G-Code: {{ gcode_position[2].toFixed(2) }}mm</span>
<span v-if="gcode_position !== undefined && gcode_position.length >= 3">G-Code: {{ gcode_position[2].toFixed(2) }}mm</span>
</v-tooltip>
</v-col>
</v-row>
@@ -271,6 +271,7 @@
if (
'first_layer_height' in this.current_file &&
'layer_height' in this.current_file &&
this.gcode_position !== undefined &&
this.gcode_position.length >= 3
) {
const current_layer = Math.ceil((this.gcode_position[2] - this.current_file.first_layer_height) / this.current_file.layer_height + 1)