changed func names in macros,
This commit is contained in:
@@ -205,6 +205,7 @@ module.exports = {
|
|||||||
gcodeFiles: function () {
|
gcodeFiles: function () {
|
||||||
const filesWithNoMacros=this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item));
|
const filesWithNoMacros=this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item));
|
||||||
console.log('filesWithNoMacros: ',filesWithNoMacros);
|
console.log('filesWithNoMacros: ',filesWithNoMacros);
|
||||||
|
console.log("this.config.gcodeList",this.config.gcodeList)
|
||||||
const unionSet = new Set([...filesWithNoMacros, ...this.config.gcodeList]);
|
const unionSet = new Set([...filesWithNoMacros, ...this.config.gcodeList]);
|
||||||
const files = [...unionSet];
|
const files = [...unionSet];
|
||||||
console.log("files: ",files);
|
console.log("files: ",files);
|
||||||
@@ -536,20 +537,6 @@ module.exports = {
|
|||||||
console.warn("Error running program: ",error);
|
console.warn("Error running program: ",error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// gcode_files: async function (){
|
|
||||||
// const files=this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item));
|
|
||||||
// console.log(files);
|
|
||||||
// this.config.gcodeList=files;
|
|
||||||
// try {
|
|
||||||
// await api.put("config/save", this.config);
|
|
||||||
// console.log("Successfully saved");
|
|
||||||
// this.$dispatch("update");
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error("Restore Failed: ", error);
|
|
||||||
// alert("Restore failed");
|
|
||||||
// }
|
|
||||||
// return files;
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [ require("./axis-vars") ]
|
mixins: [ require("./axis-vars") ]
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ module.exports = {
|
|||||||
return this.mach_state == "READY";
|
return this.mach_state == "READY";
|
||||||
},
|
},
|
||||||
updateNewGcode: function (event) {
|
updateNewGcode: function (event) {
|
||||||
this.newGcode[this.tab - 1] = event.target.value;
|
return this.newGcode[this.tab - 1] = event.target.value;
|
||||||
},
|
},
|
||||||
macrosList: function () {
|
macrosList: function () {
|
||||||
return this.config.macrosList.map((el) => el.gcode_file_name);
|
return this.config.macrosList.map((el) => el.gcode_file_name);
|
||||||
@@ -50,7 +50,7 @@ module.exports = {
|
|||||||
open: function () {
|
open: function () {
|
||||||
utils.clickFileInput("gcode-file-input");
|
utils.clickFileInput("gcode-file-input");
|
||||||
},
|
},
|
||||||
load: async function () {
|
loadMacrosGcode: async function () {
|
||||||
const file = this.selectedValues[this.tab - 1];
|
const file = this.selectedValues[this.tab - 1];
|
||||||
if (this.selectedValues[this.tab - 1] != "default") {
|
if (this.selectedValues[this.tab - 1] != "default") {
|
||||||
const response = await fetch(`/api/file/${file}`, {
|
const response = await fetch(`/api/file/${file}`, {
|
||||||
@@ -67,7 +67,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
console.log("newGcode: ",this.newGcode[this.tab - 1]);
|
console.log("newGcode: ",this.newGcode[this.tab - 1]);
|
||||||
},
|
},
|
||||||
upload:async function (e) {
|
uploadMacrosGcode:async function (e) {
|
||||||
const files = e.target.files || e.dataTransfer.files;
|
const files = e.target.files || e.dataTransfer.files;
|
||||||
if (!files.length) {
|
if (!files.length) {
|
||||||
return;
|
return;
|
||||||
@@ -162,7 +162,7 @@ module.exports = {
|
|||||||
console.log(" this.state.selected && time: ",this.state.selected, this.state.selected_time);
|
console.log(" this.state.selected && time: ",this.state.selected, this.state.selected_time);
|
||||||
console.log("selectedValues: ",this.selectedValues[this.tab - 1]);
|
console.log("selectedValues: ",this.selectedValues[this.tab - 1]);
|
||||||
|
|
||||||
if (this.state.selected == "default") {
|
if (this.selectedValues[this.tab - 1] == "default") {
|
||||||
var file = this.newGcode[this.tab - 1];
|
var file = this.newGcode[this.tab - 1];
|
||||||
this.uploadGCode(macrosName, file);
|
this.uploadGCode(macrosName, file);
|
||||||
}
|
}
|
||||||
@@ -170,7 +170,7 @@ module.exports = {
|
|||||||
this.config.macros[this.tab - 1].name = macrosName;
|
this.config.macros[this.tab - 1].name = macrosName;
|
||||||
this.config.macros[this.tab - 1].color = macrosColor;
|
this.config.macros[this.tab - 1].color = macrosColor;
|
||||||
this.config.macros[this.tab - 1].gcode_file_name =
|
this.config.macros[this.tab - 1].gcode_file_name =
|
||||||
this.state.selected == "default" ? macrosName+'.ngc' : this.state.selected;
|
this.selectedValues[this.tab - 1] == "default" ? macrosName+'.ngc' : this.selectedValues[this.tab - 1] ;
|
||||||
this.config.macros[this.tab - 1].gcode_file_time =
|
this.config.macros[this.tab - 1].gcode_file_time =
|
||||||
this.state.selected_time;
|
this.state.selected_time;
|
||||||
console.log("config.macros[this.tab - 1].gcode_file_name",this.config.macros[this.tab - 1].gcode_file_name);
|
console.log("config.macros[this.tab - 1].gcode_file_name",this.config.macros[this.tab - 1].gcode_file_name);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title G-Code
|
p.title G-Code
|
||||||
.select-upload-gcode
|
.select-upload-gcode
|
||||||
select#gcodeSelect-0(title="Select previously uploaded GCode programs.",selected
|
select#gcodeSelect-0(title="Select previously uploaded GCode programs.",selected
|
||||||
v-model="selectedValues[tab - 1]",@change="load", :disabled="!is_ready",
|
v-model="selectedValues[tab - 1]",@change="loadMacrosGcode", :disabled="!is_ready",
|
||||||
style="max-width:100%;height:40px;border-radius:5px")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option( selected='' value='default') Create G-Code
|
option( selected='' value='default') Create G-Code
|
||||||
option(v-for="file in macrosList", :value="file") {{file}}
|
option(v-for="file in macrosList", :value="file") {{file}}
|
||||||
@@ -71,7 +71,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.fa.fa-upload
|
.fa.fa-upload
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
br
|
br
|
||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
@@ -92,7 +92,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title G-Code
|
p.title G-Code
|
||||||
.select-upload-gcode
|
.select-upload-gcode
|
||||||
select#gcodeSelect-1(title="Select previously uploaded GCode programs.",
|
select#gcodeSelect-1(title="Select previously uploaded GCode programs.",
|
||||||
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
|
v-model="selectedValues[tab - 1]", @change="loadMacrosGcode", :disabled="!is_ready",
|
||||||
style="max-width:100%;height:40px;border-radius:5px")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option(selected='' value='default') Create G-Code
|
option(selected='' value='default') Create G-Code
|
||||||
option(v-for="file in macrosList", :value="file") {{file}}
|
option(v-for="file in macrosList", :value="file") {{file}}
|
||||||
@@ -102,7 +102,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.fa.fa-upload
|
.fa.fa-upload
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
br
|
br
|
||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
@@ -122,7 +122,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title G-Code
|
p.title G-Code
|
||||||
.select-upload-gcode
|
.select-upload-gcode
|
||||||
select#gcodeSelect-2(title="Select previously uploaded GCode programs.",
|
select#gcodeSelect-2(title="Select previously uploaded GCode programs.",
|
||||||
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
|
v-model="selectedValues[tab - 1]", @change="loadMacrosGcode", :disabled="!is_ready",
|
||||||
style="max-width:100%;height:40px;border-radius:5px")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option(selected='' value='default') Create G-Code
|
option(selected='' value='default') Create G-Code
|
||||||
option(v-for="file in macrosList", :value="file") {{file}}
|
option(v-for="file in macrosList", :value="file") {{file}}
|
||||||
@@ -132,7 +132,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.fa.fa-upload
|
.fa.fa-upload
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
br
|
br
|
||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
@@ -152,7 +152,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title G-Code
|
p.title G-Code
|
||||||
.select-upload-gcode
|
.select-upload-gcode
|
||||||
select#gcodeSelect-3(title="Select previously uploaded GCode programs.",
|
select#gcodeSelect-3(title="Select previously uploaded GCode programs.",
|
||||||
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
|
v-model="selectedValues[tab - 1]", @change="loadMacrosGcode", :disabled="!is_ready",
|
||||||
style="max-width:100%;height:40px;border-radius:5px")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option(selected='' value='default') Create G-Code
|
option(selected='' value='default') Create G-Code
|
||||||
option(v-for="file in macrosList", :value="file") {{file}}
|
option(v-for="file in macrosList", :value="file") {{file}}
|
||||||
@@ -162,7 +162,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.fa.fa-upload
|
.fa.fa-upload
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
br
|
br
|
||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
@@ -182,7 +182,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title G-Code
|
p.title G-Code
|
||||||
.select-upload-gcode
|
.select-upload-gcode
|
||||||
select#gcodeSelect-4(title="Select previously uploaded GCode programs.",
|
select#gcodeSelect-4(title="Select previously uploaded GCode programs.",
|
||||||
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
|
v-model="selectedValues[tab - 1]", @change="loadMacrosGcode", :disabled="!is_ready",
|
||||||
style="max-width:100%;height:40px;border-radius:5px")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option(selected='' value='default') Create G-Code
|
option(selected='' value='default') Create G-Code
|
||||||
option(v-for="file in macrosList", :value="file") {{file}}
|
option(v-for="file in macrosList", :value="file") {{file}}
|
||||||
@@ -192,7 +192,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.fa.fa-upload
|
.fa.fa-upload
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
br
|
br
|
||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
@@ -212,7 +212,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title G-Code
|
p.title G-Code
|
||||||
.select-upload-gcode
|
.select-upload-gcode
|
||||||
select#gcodeSelect-5(title="Select previously uploaded GCode programs.",
|
select#gcodeSelect-5(title="Select previously uploaded GCode programs.",
|
||||||
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
|
v-model="selectedValues[tab - 1]", @change="loadMacrosGcode", :disabled="!is_ready",
|
||||||
style="max-width:100%;height:40px;border-radius:5px")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option(selected='' value='default') Create G-Code
|
option(selected='' value='default') Create G-Code
|
||||||
option(v-for="file in macrosList", :value="file") {{file}}
|
option(v-for="file in macrosList", :value="file") {{file}}
|
||||||
@@ -222,7 +222,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.fa.fa-upload
|
.fa.fa-upload
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
br
|
br
|
||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
@@ -242,7 +242,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title G-Code
|
p.title G-Code
|
||||||
.select-upload-gcode
|
.select-upload-gcode
|
||||||
select#gcodeSelect-6(title="Select previously uploaded GCode programs.",selected
|
select#gcodeSelect-6(title="Select previously uploaded GCode programs.",selected
|
||||||
v-model="selectedValues[tab - 1]",@change="load", :disabled="!is_ready",
|
v-model="selectedValues[tab - 1]",@change="loadMacrosGcode", :disabled="!is_ready",
|
||||||
style="max-width:100%;height:40px;border-radius:5px")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option(selected='' value='default') Create G-Code
|
option(selected='' value='default') Create G-Code
|
||||||
option(v-for="file in macrosList", :value="file") {{file}}
|
option(v-for="file in macrosList", :value="file") {{file}}
|
||||||
@@ -252,7 +252,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.fa.fa-upload
|
.fa.fa-upload
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
br
|
br
|
||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
@@ -272,7 +272,7 @@ script#macros-template(type="text/x-template")
|
|||||||
p.title G-Code
|
p.title G-Code
|
||||||
.select-upload-gcode
|
.select-upload-gcode
|
||||||
select#gcodeSelect-7(title="Select previously uploaded GCode programs.",selected
|
select#gcodeSelect-7(title="Select previously uploaded GCode programs.",selected
|
||||||
v-model="selectedValues[tab - 1]",@change="load", :disabled="!is_ready",
|
v-model="selectedValues[tab - 1]",@change="loadMacrosGcode", :disabled="!is_ready",
|
||||||
style="max-width:100%;height:40px;border-radius:5px")
|
style="max-width:100%;height:40px;border-radius:5px")
|
||||||
option(selected='' value='default') Create G-Code
|
option(selected='' value='default') Create G-Code
|
||||||
option(v-for="file in macrosList", :value="file") {{file}}
|
option(v-for="file in macrosList", :value="file") {{file}}
|
||||||
@@ -282,7 +282,7 @@ script#macros-template(type="text/x-template")
|
|||||||
.fa.fa-upload
|
.fa.fa-upload
|
||||||
|
|
||||||
form.gcode-file-input.file-upload
|
form.gcode-file-input.file-upload
|
||||||
input(type="file", @change="upload", :disabled="!is_ready",
|
input(type="file", @change="uploadMacrosGcode", :disabled="!is_ready",
|
||||||
accept=".nc,.ngc,.gcode,.gc")
|
accept=".nc,.ngc,.gcode,.gc")
|
||||||
br
|
br
|
||||||
.gcodeContainer
|
.gcodeContainer
|
||||||
|
|||||||
Reference in New Issue
Block a user