"use strict"; // Program tab — file management, run/stop, gcode listing and 3D // toolpath preview. Reuses the shared mixin (program-mixin) that also // powers the legacy bits of control-view; this view does not host the // jog grid or the DRO. module.exports = { template: "#program-view-template", props: ["config", "template", "state"], components: { "path-viewer": require("./path-viewer"), "gcode-viewer": require("./gcode-viewer"), }, data: function () { return {}; }, watch: { "state.metric": { handler: function () {}, immediate: true, }, }, computed: { display_units: { cache: false, get: function () { return this.$root.display_units; }, set: function (value) { this.config.settings.units = value; this.$root.display_units = value; this.$dispatch("config-changed"); }, }, metric: function () { return this.display_units === "METRIC"; }, mach_state: function () { const cycle = this.state.cycle; const xx = this.state.xx; if (xx != "ESTOPPED" && (cycle == "jogging" || cycle == "homing")) { return cycle.toUpperCase(); } return xx || ""; }, can_set_axis: function () { return this.state.cycle == "idle"; }, }, ready: function () { this.load(); }, mixins: [require("./program-mixin")], };