Fixed the controller UI from hanging after estop

This commit is contained in:
David Carley
2022-09-13 00:24:31 +00:00
parent fcc4ed8b03
commit 1a44fe3c8e
4 changed files with 17 additions and 7 deletions

View File

@@ -327,9 +327,12 @@ module.exports = new Vue({
return; return;
} }
if ("log" in e.data) { if (e.data.log && e.data.log.msg !== "Switch not found") {
if (e.data.log.msg !== "Switch not found") {
this.$broadcast("log", e.data.log); this.$broadcast("log", e.data.log);
if (Object.keys(e.data).length === 1) {
// If there's only log data, we're done
return;
} }
} }

View File

@@ -43,6 +43,11 @@ module.exports = {
messages.pop(); messages.pop();
} }
} }
if (messages[0].repeat > 1) {
return;
}
msg.ts = Date.now(); msg.ts = Date.now();
// Write message to browser console for debugging // Write message to browser console for debugging

View File

@@ -133,7 +133,7 @@ class Comm(object):
if level == 'error': self.comm_error() if level == 'error': self.comm_error()
# Treat machine alarmed warning as an error # Treat machine alarmed warning as an error
if level == 'warning' and 'code' in msg and msg['code'] == 11: if level == 'warning' and 'code' in msg and msg['code'] == 12:
self.comm_error() self.comm_error()
def _log_motor_flags(self, update): def _log_motor_flags(self, update):

View File

@@ -126,7 +126,9 @@ class Log(object):
def _log(self, msg, level=INFO, prefix='', where=None): def _log(self, msg, level=INFO, prefix='', where=None):
if not msg: return if not msg: return
hdr = '%s:%s:' % ('DIMWE'[level], prefix) timestamp = datetime.datetime.now().strftime("%H:%M:%S")
hdr = '%s:%s:%s:' % ('DIMWE'[level], prefix, timestamp)
s = hdr + ('\n' + hdr).join(msg.split('\n')) s = hdr + ('\n' + hdr).join(msg.split('\n'))
if self.f is not None: if self.f is not None: