From 8d9a33d03cb401ffa7a6c847158b936c27c07c2c Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Thu, 4 Jan 2024 21:41:55 +0530 Subject: [PATCH] added gcode viewer in macros (maded it editable ), --- src/js/gcode-viewer.js | 2 +- src/js/macros.js | 13 ------------- src/pug/templates/macros.pug | 8 ++++---- src/stylus/style.styl | 20 ++++++++++---------- 4 files changed, 15 insertions(+), 28 deletions(-) diff --git a/src/js/gcode-viewer.js b/src/js/gcode-viewer.js index 66c1f73..db2ef44 100644 --- a/src/js/gcode-viewer.js +++ b/src/js/gcode-viewer.js @@ -72,7 +72,7 @@ module.exports = { } else { const lines = escapeHTML(text.trimRight()) .split(/[\r\n]/) - .map((line, i) => `
  • ${i + 1}${line}
  • `); + .map((line, i) => `
  • ${i + 1}${line}
  • `); this.clusterize.update(lines); } diff --git a/src/js/macros.js b/src/js/macros.js index 800b5de..cb9e4ff 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -39,22 +39,9 @@ module.exports = { }, load: function () { const file_time = this.state.selected_time; - console.log("file_time", file_time); const file = this.state.selected; - console.log("file: ", file); - // console.log("last_file: ", this.last_file); - // console.log("last_file_time: ", this.last_file_time); - // if (this.last_file == file && this.last_file_time == file_time) { - // return; - // } - - // this.last_file = file; - // this.last_file_time = file_time; - this.$broadcast("gcode-load", file); this.$broadcast("gcode-line", this.state.line); - // this.toolpath_progress = 0; - // this.load_toolpath(file, file_time); }, upload: function (e) { const files = e.target.files || e.dataTransfer.files; diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index 7378fd7..9b8c41c 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -11,12 +11,12 @@ script#macros-template(type="text/x-template") | Upload h1 Macros Configuration button.pure-button(title="Print config.", @click="resetConfig", - style="height:50px;width:170px;font-weight:normal;color:#fff;background-color:#5a9ad7") Reset Macros + style="height:50px;width:170px;font-weight:normal;color:#fff;background-color:#5a9ad7;display:flex;align-items:center;justify-content:space-around") Reset Macros .fa.fa-rotate-right .warning-box p - u Note: - | Reset the macros to default macros recommended by Onefinity CNC. + u Note: + | Reset the macros to default macros recommended by Onefinity CNC. .tabs input#tab1(type="radio", name="tabs",checked="" @click="tab = '1'") label(for="tab1",style="height:50px;width:100px") Macros 1 @@ -44,7 +44,7 @@ script#macros-template(type="text/x-template") input.input-name(type="text",minlength='1',maxlength='15',id="macros-name-0") p.title G-Code select(title="Select previously uploaded GCode programs.", - v-model="state.selected", @change="load", :disabled="!is_ready", + @change="load", :disabled="!is_ready", style="max-width:100%;height:40px;border-radius:5px") option(v-for="file in state.files", :value="file") {{file}} diff --git a/src/stylus/style.styl b/src/stylus/style.styl index b23a4fd..5abdca3 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -631,16 +631,16 @@ span.unit .macros width 90% - .warning-box - display flex - background-color #ced512 - border-radius 5px - border 0 - padding 4px - margin-top 5px - margin-bottom 10px - margin-top 10px - align-items center +.warning-box + display flex + background-color #ced512 + border-radius 5px + border 0 + padding 4px + margin-top 5px + margin-bottom 10px + margin-top 10px + align-items center .tabs margin-top 5px