From: Joseph Coffland Date: Thu, 15 Feb 2018 05:29:30 +0000 (-0800) Subject: - Allow blocking error dialog for a period of time X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=3faab101ad01f2875d30f63f79c92e37dbfd2b06;p=bbctrl-firmware - Allow blocking error dialog for a period of time - Show actual error message on planner errors - Reset planner on serious error - Fixed console clear - Added helful info to Video tab - Changed Console tab to Messages - Removed spin up/down velocity options, they don't do anything --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a2516e..b215cbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ Buildbotics CNC Controller Firmware Change Log ============================================== +## v0.3.7 + - Allow blocking error dialog for a period of time + - Show actual error message on planner errors + - Reset planner on serious error + - Fixed console clear + - Added helful info to Video tab + - Changed "Console" tab to "Messages" + - Removed spin up/down velocity options, they don't do anything + ## v0.3.6 - Set max_usb_current=1 in /boot/config.txt from installer #103 diff --git a/package.json b/package.json index ef0b0a3..b6fd328 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bbctrl", - "version": "0.3.6", + "version": "0.3.7", "homepage": "http://buildbotics.com/", "repository": "https://github.com/buildbotics/bbctrl-firmware", "license": "GPL-3.0+", diff --git a/src/avr/LICENSE b/src/avr/LICENSE index b08b657..ac86d6d 100644 --- a/src/avr/LICENSE +++ b/src/avr/LICENSE @@ -16,9 +16,6 @@ Portions of this software are copyrighted by the following entities: Copyright (c) 2015 - 2016 Buildbotics LLC Copyright (c) 2014 Thomas Nixon, Jonathan Heathcote (cpp_magic.h) - Copyright (c) 2013 - 2015 Robert Giseburt - Copyright (c) 2010 - 2015 Alden S. Hart, Jr. - Copyright (c) 2008 Atmel Corporation (part of clock.c) All rights reserved. Each source code file lists the entities which claim copyright to diff --git a/src/avr/src/huanyang.c b/src/avr/src/huanyang.c index 39d2278..84c2055 100644 --- a/src/avr/src/huanyang.c +++ b/src/avr/src/huanyang.c @@ -63,11 +63,14 @@ enum { }; +// See VFD manual pg57 3.1.3.d enum { HUANYANG_TARGET_FREQ, HUANYANG_ACTUAL_FREQ, HUANYANG_ACTUAL_CURRENT, HUANYANG_ACTUAL_RPM, + HUANYANG_DCV, + HUANYANG_ACV, HUANYANG_CONT, HUANYANG_TEMPERATURE, }; diff --git a/src/jade/index.jade b/src/jade/index.jade index fc38c53..1a2e637 100644 --- a/src/jade/index.jade +++ b/src/jade/index.jade @@ -85,6 +85,16 @@ html(lang="en") div(slot="body") console + button.pure-button(@click="block_error_dialog") + .fa.fa-ban + |  Stop + label showing errors for + input(style="width: 50px", v-model="errorTimeout", number) + label seconds. + + div(slot="footer") + button.pure-button.pure-button-primary(@click="errorShow = false") Ok + message(:show.sync="confirmUpgrade") h3(slot="header") Upgrade Firmware? div(slot="body") diff --git a/src/jade/templates/console.jade b/src/jade/templates/console.jade index e546e2e..93bf3b3 100644 --- a/src/jade/templates/console.jade +++ b/src/jade/templates/console.jade @@ -3,6 +3,7 @@ script#console-template(type="text/x-template") .toolbar button.pure-button(title="Clear console.", @click="clear") .fa.fa-trash + |  Clear table tr diff --git a/src/jade/templates/control-view.jade b/src/jade/templates/control-view.jade index 0e8ddcc..2133843 100644 --- a/src/jade/templates/control-view.jade +++ b/src/jade/templates/control-view.jade @@ -161,7 +161,7 @@ script#control-view-template(type="text/x-template") label(for="tab3") Jog input#tab4(type="radio", name="tabs") - label(for="tab4") Console + label(for="tab4") Messages input#tab5(type="radio", name="tabs") label(for="tab5") Indicators @@ -251,3 +251,10 @@ script#control-view-template(type="text/x-template") img.reload(src="/images/reload.png", @click="load_video", title="Reload video") img.mjpeg(:src="video_url") + + p(style="padding:0 1em") + | Plug in a USB video camera to monitor your machine remotely. + | If it's not working, try clicking the reload button or unplugging + | and replugging the the camera. + | Here + | is a list of USB cameras that should work. diff --git a/src/js/app.js b/src/js/app.js index 5d39577..9459264 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -33,6 +33,8 @@ module.exports = new Vue({ config: {motors: [{}]}, state: {}, messages: [], + errorTimeout: 30, + errorTimeoutStart: 0, errorShow: false, errorMessage: '', confirmUpgrade: false, @@ -95,6 +97,14 @@ module.exports = new Vue({ error: function (msg) { + // Honor user error blocking + if (Date.now() - this.errorTimeoutStart < this.errorTimeout * 1000) + return; + + // Wait at least 1 sec to pop up repeated errors + if (1 < msg.repeat && Date.now() - msg.ts < 1000) return; + + // Popup error dialog this.errorShow = true; this.errorMessage = msg.msg; } @@ -108,6 +118,12 @@ module.exports = new Vue({ methods: { + block_error_dialog: function () { + this.errorTimeoutStart = Date.now(); + this.errorShow = false; + }, + + estop: function () { if (this.state.xx == 'ESTOPPED') api.put('clear'); else api.put('estop'); diff --git a/src/js/console.js b/src/js/console.js index 62b90eb..e4bc5ed 100644 --- a/src/js/console.js +++ b/src/js/console.js @@ -37,6 +37,7 @@ module.exports = { msg.repeat = 1; messages.unshift(msg); } + msg.ts = Date.now(); // Write message to browser console for debugging var text = JSON.stringify(msg); @@ -46,13 +47,13 @@ module.exports = { else console.log(text); // Event on errors - if (!repeat && (msg.level == 'error' || msg.level == 'critical')) + if (msg.level == 'error' || msg.level == 'critical') this.$dispatch('error', msg); } }, methods: { - clear: function () {messages.length = 0;}, + clear: function () {messages.splice(0, messages.length);}, } } diff --git a/src/pwr/config.h b/src/pwr/config.h index 0da6d6c..fa2d8ce 100644 --- a/src/pwr/config.h +++ b/src/pwr/config.h @@ -95,7 +95,7 @@ enum { #define VOLTAGE_REF_R2 1000 #define CURRENT_REF_MUL 1970 - // Addresses 0x60 to 0x67 +// Addresses 0x60 to 0x67 #define I2C_ADDR 0x60 #define I2C_MASK 0b00000111 diff --git a/src/py/bbctrl/Planner.py b/src/py/bbctrl/Planner.py index cd9a987..a383e6e 100644 --- a/src/py/bbctrl/Planner.py +++ b/src/py/bbctrl/Planner.py @@ -206,9 +206,14 @@ class Planner(): def next(self): - while self.planner.has_more(): - cmd = self.planner.next() - cmd = self.encode(cmd) - if cmd is not None: return cmd + try: + while self.planner.has_more(): + cmd = self.planner.next() + cmd = self.encode(cmd) + if cmd is not None: return cmd - if not self.is_running(): self.mode = 'idle' + if not self.is_running(): self.mode = 'idle' + + except Exception as e: + self.reset() + log.exception(e) diff --git a/src/resources/config-template.json b/src/resources/config-template.json index fa754ba..bd76c71 100644 --- a/src/resources/config-template.json +++ b/src/resources/config-template.json @@ -192,20 +192,6 @@ "default": 99.99, "code": "md" }, - "spin-up-velocity": { - "type": "float", - "unit": "rev/min²", - "min": 0, - "default": 48000, - "code": "su" - }, - "spin-down-velocity": { - "type": "float", - "unit": "rev/min²", - "min": 0, - "default": 48000, - "code": "sd" - }, "pwm-freq": { "type": "int", "unit": "Hz", diff --git a/src/stylus/style.styl b/src/stylus/style.styl index 420befc..06a0d8a 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -315,6 +315,7 @@ body .tabs section + min-height 250px max-height 610px overflow-x hidden overflow-y auto @@ -376,6 +377,7 @@ body td, th border 1px solid #ddd + padding 2px tr > td