changed it to computed

This commit is contained in:
sanjayk03-dev
2024-01-22 14:57:47 +05:30
parent a4bab325e1
commit adf51d4cd4

View File

@@ -202,15 +202,12 @@ module.exports = {
const p = this.plan_time / this.toolpath.time; const p = this.plan_time / this.toolpath.time;
return Math.min(1, p); return Math.min(1, p);
}, },
isMacrosPresent: function(val){ gcode_files: function (){
try{ const files=this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item));
const res = this.config.macros[val].name!="" || this.config.macros[val].gcode!=""; console.log(files);
console.log("result: ",val," : res"); console.log(this.config.gcodeList);
return res; return files;
}catch(err){ }
console.log("Error for macros present: ",err);
}
},
}, },
events: { events: {
@@ -376,8 +373,9 @@ module.exports = {
} }
console.log(file.name); console.log(file.name);
if(this.state.macrosList.some(obj => obj.gcode_file_name == files.name)){ if(this.config.macrosList.some(obj => obj.gcode_file_name == files.name)){
console.log("It is a macros, remove it from macrosList") console.log("It is a macros, remove it from macrosList")
this.config.gcodeList.push(file.name);
} }
SvelteComponents.showDialog("Upload", { SvelteComponents.showDialog("Upload", {
@@ -522,11 +520,6 @@ module.exports = {
console.warn("Error running program: ",error); console.warn("Error running program: ",error);
} }
}, },
gcode_files: function (){
console.log(this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item)));
console.log(this.state.gcodeList);
return this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name == item))
}
}, },
mixins: [ require("./axis-vars") ] mixins: [ require("./axis-vars") ]