alertbox for macros

This commit is contained in:
sanjayk03-dev
2024-01-30 02:36:26 +05:30
parent da2362b987
commit 362b3605fc
3 changed files with 16 additions and 3 deletions

View File

@@ -43,6 +43,7 @@ module.exports = {
ask_home: true,
showGcodeMessage: false,
showNoGcodeMessage: false,
macrosLoading: false,
};
},
@@ -292,6 +293,8 @@ module.exports = {
this.last_file = file;
this.last_file_time = file_time;
console.log("loading file: ", file);
this.$broadcast("gcode-load", file);
this.$broadcast("gcode-line", this.state.line);
this.toolpath_progress = 0;
@@ -545,7 +548,7 @@ module.exports = {
SvelteComponents.showDialog("Probe", { probeType });
},
runMacros: function (id) {
console.log("index",id);
console.log("index", id);
if (this.config.macros[id].file_name == "default") {
this.showNoGcodeMessage = true;
} else {
@@ -554,7 +557,8 @@ module.exports = {
}
try {
this.load();
this.start_pause();
this.macrosLoading = true;
// this.start_pause();
} catch (error) {
console.warn("Error running program: ", error);
}

View File

@@ -18,6 +18,15 @@ script#control-view-template(type="text/x-template")
div(slot="footer")
button.pure-button(@click="showNoGcodeMessage=false") OK
message(:show.sync="macrosLoading")
h3(slot="header") Run Macros?
div(slot="body")
p The selected macros is being loaded.
div(slot="footer")
button.pure-button(@click="macrosLoading=false") Cancel
button.pure-button.pure-button-primary(@click="start_pause") Run
table(style="table-layout: fixed; width: 100%;")
tr(style="height: fit-content;")
td(style="white-space: nowrap; width: 410px;", rowspan="2")

View File

@@ -169,7 +169,7 @@ class State(object):
self.set('files', files)
if self.get('selected', filename) == filename:
if len(files): self.select_file(files[0])
if len(files): self.select_file('')
else: self.select_file('')