err handling
This commit is contained in:
@@ -304,23 +304,27 @@ module.exports = {
|
|||||||
this.showGcodeMessage = true;
|
this.showGcodeMessage = true;
|
||||||
|
|
||||||
while (this.showGcodeMessage) {
|
while (this.showGcodeMessage) {
|
||||||
const toolpath = await api.get(`path/${file}`);
|
try {
|
||||||
this.toolpath_progress = toolpath.progress;
|
const toolpath = await api.get(`path/${file}`);
|
||||||
|
this.toolpath_progress = toolpath.progress;
|
||||||
|
|
||||||
if (toolpath.progress === 1 || typeof toolpath.progress == "undefined") {
|
if (toolpath.progress === 1 || typeof toolpath.progress == "undefined") {
|
||||||
this.showGcodeMessage = false;
|
this.showGcodeMessage = false;
|
||||||
|
|
||||||
if (toolpath.bounds) {
|
if (toolpath.bounds) {
|
||||||
toolpath.filename = file;
|
toolpath.filename = file;
|
||||||
this.toolpath_progress = 1;
|
this.toolpath_progress = 1;
|
||||||
this.toolpath = toolpath;
|
this.toolpath = toolpath;
|
||||||
|
|
||||||
const state = this.$root.state;
|
const state = this.$root.state;
|
||||||
for (const axis of "xyzabc") {
|
for (const axis of "xyzabc") {
|
||||||
Vue.set(state, `path_min_${axis}`, toolpath.bounds.min[axis]);
|
Vue.set(state, `path_min_${axis}`, toolpath.bounds.min[axis]);
|
||||||
Vue.set(state, `path_max_${axis}`, toolpath.bounds.max[axis]);
|
Vue.set(state, `path_max_${axis}`, toolpath.bounds.max[axis]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -445,7 +449,9 @@ module.exports = {
|
|||||||
delete_current: function () {
|
delete_current: function () {
|
||||||
if (this.config.macros_list.find(item => item.file_name == this.state.selected) == undefined) {
|
if (this.config.macros_list.find(item => item.file_name == this.state.selected) == undefined) {
|
||||||
if (this.state.selected) {
|
if (this.state.selected) {
|
||||||
this.config.non_macros_list = this.config.non_macros_list.filter(item => item.file_name != this.state.selected);
|
this.config.non_macros_list = this.config.non_macros_list.filter(
|
||||||
|
item => item.file_name != this.state.selected,
|
||||||
|
);
|
||||||
api.delete(`file/${this.state.selected}`);
|
api.delete(`file/${this.state.selected}`);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ script#control-view-template(type="text/x-template")
|
|||||||
h3(slot="header") Run Macro?
|
h3(slot="header") Run Macro?
|
||||||
div(slot="body")
|
div(slot="body")
|
||||||
p
|
p
|
||||||
| The macro file
|
| The macro file
|
||||||
strong {{state.selected}}
|
strong {{state.selected}}
|
||||||
| is being loaded.
|
| is being loaded.
|
||||||
|
|
||||||
div(slot="footer")
|
div(slot="footer")
|
||||||
button.pure-button(@click="macrosLoading=false") Cancel
|
button.pure-button(@click="macrosLoading=false") Cancel
|
||||||
|
|||||||
Reference in New Issue
Block a user