From 4e9a483b9523cd44064c41a8fc5ce5bb307ba781 Mon Sep 17 00:00:00 2001 From: Joseph Coffland Date: Tue, 9 Oct 2018 13:24:14 -0700 Subject: [PATCH] Plan timer and progress fixes --- CHANGELOG.md | 4 ++++ src/js/control-view.js | 6 +++--- src/pug/templates/control-view.pug | 4 ++-- src/py/bbctrl/PlanTimer.py | 3 ++- src/stylus/style.styl | 6 +++++- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c8da4a..1bb79d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ Buildbotics CNC Controller Firmware Changelog - Click to switch through three video sizes. - Automount/unmount USB drives. - Automatically install ``buildbotics.gc`` when no other GCode exists. + - Preplan GCode and check for errors. + - Display 3D view of program tool paths in browser. + - Display accurate time remaining, ETA and progress during run. + - Automatically collapase moves in planner which are too short in time. ## v0.3.28 - Show step rate on motor configuration page. diff --git a/src/js/control-view.js b/src/js/control-view.js index 1e38a21..ea3daba 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -53,7 +53,7 @@ module.exports = { files: [], last_file: undefined, toolpath: {}, - progress: 0, + toolpath_progress: 0, axes: 'xyzabc', history: [], speed_override: 1, @@ -248,7 +248,7 @@ module.exports = { if (typeof file != 'undefined') this.$broadcast('gcode-load', file); this.$broadcast('gcode-line', this.state.line); - this.progress = 0; + this.toolpath_progress = 0; this.load_toolpath(file); }, @@ -263,7 +263,7 @@ module.exports = { if (typeof toolpath.progress == 'undefined') this.toolpath = toolpath; else { - this.progress = toolpath.progress; + this.toolpath_progress = toolpath.progress; this.load_toolpath(file); // Try again } }.bind(this)); diff --git a/src/pug/templates/control-view.pug b/src/pug/templates/control-view.pug index e965f55..47db80c 100644 --- a/src/pug/templates/control-view.pug +++ b/src/pug/templates/control-view.pug @@ -161,7 +161,7 @@ script#control-view-template(type="text/x-template") | {{toolpath.time | time}} tr th ETA - td {{eta}} + td.eta {{eta}} tr th Line td @@ -250,7 +250,7 @@ script#control-view-template(type="text/x-template") v-model="state.selected", @change="load", :disabled="!is_ready") option(v-for="file in files", :value="file") {{file}} - path-viewer(:toolpath="toolpath", :progress="progress", + path-viewer(:toolpath="toolpath", :progress="toolpath_progress", :x="get_position('x')", :y="get_position('y')", :z="get_position('z')") gcode-viewer diff --git a/src/py/bbctrl/PlanTimer.py b/src/py/bbctrl/PlanTimer.py index 997fb6d..4968fc4 100644 --- a/src/py/bbctrl/PlanTimer.py +++ b/src/py/bbctrl/PlanTimer.py @@ -79,7 +79,8 @@ class PlanTimer(object): self.reset() elif state == 'HOLDING': self.hold_start = time.time() - elif state == 'RUNNING' and self.hold_start is not None: + elif (state == 'RUNNING' and self.hold_start is not None and + self.move_start is not None): self.move_start += time.time() - self.hold_start self.hold_start = None diff --git a/src/stylus/style.styl b/src/stylus/style.styl index 56d5a65..913a7be 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -313,7 +313,8 @@ span.unit height 1.75em padding 3px text-align right - white-space normal + overflow hidden + text-overflow ellipsis th min-width 5.25em @@ -334,6 +335,9 @@ span.unit padding 3px text-align right + .eta + font-size 90% + .progress height 1.75em -- 2.27.0