changed func names in macros,

This commit is contained in:
sanjayk03-dev
2024-01-22 21:04:50 +05:30
parent 1143b22f95
commit 49880824a9
3 changed files with 22 additions and 35 deletions

View File

@@ -205,6 +205,7 @@ module.exports = {
gcodeFiles: function () {
const filesWithNoMacros=this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item));
console.log('filesWithNoMacros: ',filesWithNoMacros);
console.log("this.config.gcodeList",this.config.gcodeList)
const unionSet = new Set([...filesWithNoMacros, ...this.config.gcodeList]);
const files = [...unionSet];
console.log("files: ",files);
@@ -536,20 +537,6 @@ module.exports = {
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") ]

View File

@@ -40,7 +40,7 @@ module.exports = {
return this.mach_state == "READY";
},
updateNewGcode: function (event) {
this.newGcode[this.tab - 1] = event.target.value;
return this.newGcode[this.tab - 1] = event.target.value;
},
macrosList: function () {
return this.config.macrosList.map((el) => el.gcode_file_name);
@@ -50,7 +50,7 @@ module.exports = {
open: function () {
utils.clickFileInput("gcode-file-input");
},
load: async function () {
loadMacrosGcode: async function () {
const file = this.selectedValues[this.tab - 1];
if (this.selectedValues[this.tab - 1] != "default") {
const response = await fetch(`/api/file/${file}`, {
@@ -67,7 +67,7 @@ module.exports = {
}
console.log("newGcode: ",this.newGcode[this.tab - 1]);
},
upload:async function (e) {
uploadMacrosGcode:async function (e) {
const files = e.target.files || e.dataTransfer.files;
if (!files.length) {
return;
@@ -162,7 +162,7 @@ module.exports = {
console.log(" this.state.selected && time: ",this.state.selected, this.state.selected_time);
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];
this.uploadGCode(macrosName, file);
}
@@ -170,7 +170,7 @@ module.exports = {
this.config.macros[this.tab - 1].name = macrosName;
this.config.macros[this.tab - 1].color = macrosColor;
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.state.selected_time;
console.log("config.macros[this.tab - 1].gcode_file_name",this.config.macros[this.tab - 1].gcode_file_name);