filtering Gcodes

This commit is contained in:
sanjayk03-dev
2024-01-22 09:56:48 +05:30
parent 45f3ed687e
commit 96657f3cb1
4 changed files with 14 additions and 10 deletions

View File

@@ -41,7 +41,9 @@ module.exports = {
deleteGCode: false,
tab: "auto",
ask_home: true,
showGcodeMessage: false
showGcodeMessage: false,
gcode_files:this.state.files.filter(item => !this.config.macrosList.some(compareItem => compareItem.gcode_file_name === item.gcode_file_name))
.map(item => item.gcode_file_name)
};
},
@@ -285,6 +287,8 @@ module.exports = {
return;
}
console.log(file,file_time);
this.last_file = file;
this.last_file_time = file_time;

View File

@@ -23,7 +23,7 @@ module.exports = {
"default",
],
newGcode: ["", "", "", "", "", "", "", ""],
macrosList: this.config.macros.map((item) => item.gcode_file_name),
macrosList: this.config.macrosList.map((el) => el.gcode_file_name),
};
},
computed: {
@@ -63,7 +63,7 @@ module.exports = {
} else {
this.newGcode[this.tab - 1] = "";
}
console.log(this.newGcode[this.tab-1]);
console.log(this.newGcode[this.tab - 1]);
},
upload: function (e) {
const files = e.target.files || e.dataTransfer.files;

View File

@@ -297,7 +297,7 @@ script#control-view-template(type="text/x-template")
select(title="Select previously uploaded GCode programs.",
v-model="state.selected", @change="load", :disabled="!is_ready",
style="max-width:100%")
option(v-for="file in state.files", :value="file") {{file}}
option(v-for="file in gcode_files", :value="file") {{file}}
.progress(v-if="toolpath_progress && toolpath_progress < 1",
title="Simulating GCode to check for errors, calculate ETA and " +

View File

@@ -125,7 +125,7 @@ script#macros-template(type="text/x-template")
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option(selected='' value='default') Create G-Code
option(v-for="file in state.files", :value="file") {{file}}
option(v-for="file in macrosList", :value="file") {{file}}
button.pure-button(title="Upload a new GCode program.", @click="open",
:disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload
@@ -155,7 +155,7 @@ script#macros-template(type="text/x-template")
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option(selected='' value='default') Create G-Code
option(v-for="file in state.files", :value="file") {{file}}
option(v-for="file in macrosList", :value="file") {{file}}
button.pure-button(title="Upload a new GCode program.", @click="open",
:disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload
@@ -185,7 +185,7 @@ script#macros-template(type="text/x-template")
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option(selected='' value='default') Create G-Code
option(v-for="file in state.files", :value="file") {{file}}
option(v-for="file in macrosList", :value="file") {{file}}
button.pure-button(title="Upload a new GCode program.", @click="open",
:disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload
@@ -215,7 +215,7 @@ script#macros-template(type="text/x-template")
v-model="selectedValues[tab - 1]", @change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option(selected='' value='default') Create G-Code
option(v-for="file in state.files", :value="file") {{file}}
option(v-for="file in macrosList", :value="file") {{file}}
button.pure-button(title="Upload a new GCode program.", @click="open",
:disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload
@@ -245,7 +245,7 @@ script#macros-template(type="text/x-template")
v-model="selectedValues[tab - 1]",@change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option(selected='' value='default') Create G-Code
option(v-for="file in state.files", :value="file") {{file}}
option(v-for="file in macrosList", :value="file") {{file}}
button.pure-button(title="Upload a new GCode program.", @click="open",
:disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload
@@ -275,7 +275,7 @@ script#macros-template(type="text/x-template")
v-model="selectedValues[tab - 1]",@change="load", :disabled="!is_ready",
style="max-width:100%;height:40px;border-radius:5px")
option(selected='' value='default') Create G-Code
option(v-for="file in state.files", :value="file") {{file}}
option(v-for="file in macrosList", :value="file") {{file}}
button.pure-button(title="Upload a new GCode program.", @click="open",
:disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px;margin-left:4px;background-color:#5a9ad7;color:#fff;display:flex;align-items:center;justify-content:space-around") Upload