From 0ec763bdb433979eae86a8dcbadfc222ddcf0e8a Mon Sep 17 00:00:00 2001 From: PAJohnson Date: Sat, 26 Sep 2020 23:04:05 -0400 Subject: [PATCH] Axis error work again now, fixed top level .gitignore --- .gitignore | 6 ++++++ GUI/README.md | 2 +- GUI/server/odrive_server.py | 4 +++- GUI/src/App.vue | 2 +- GUI/src/components/Axis.vue | 39 +++++++++++++++++++++++++++---------- GUI/src/store.js | 2 -- 6 files changed, 40 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 66a8990f..cbbbfd24 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,9 @@ ODrive\.files ODrive\.includes Firmware/Tests/bin/ + +# Electron-builder output +GUI/dist_electron + +# Node Modules +GUI/node_modules diff --git a/GUI/README.md b/GUI/README.md index 58c7b6d5..6849cc57 100644 --- a/GUI/README.md +++ b/GUI/README.md @@ -1,6 +1,6 @@ # odrive_gui -Python requirements: `pip install python-socketio eventlet odrive` +Python requirements: `pip install flask flask_socketio flask_cors odrive` If the default odrive python package is not desired, the path to the modules can be passed as command line arguments. diff --git a/GUI/server/odrive_server.py b/GUI/server/odrive_server.py index 5d03c604..d0fa533b 100644 --- a/GUI/server/odrive_server.py +++ b/GUI/server/odrive_server.py @@ -20,7 +20,7 @@ app.config.update( SESSION_COOKIE_SAMESITE='None' ) CORS(app, support_credentials=True) -socketio = SocketIO(app, cors_allowed_origins="*") +socketio = SocketIO(app, cors_allowed_origins="*", async_mode = "threading") def get_all_odrives(): globals()['odrives'] = [] @@ -98,6 +98,8 @@ def set_property(message): globals()['inUse'] = True print("From setProperty event handler: " + str(message)) postVal(globals()['odrives'], message["path"].split('.'), message["val"], message["type"]) + val = getVal(globals()['odrives'], message["path"].split('.')) + emit('ODriveProperty', json.dumps({"path": message["path"], "val": val})) globals()['inUse'] = False @socketio.on('callFunction') diff --git a/GUI/src/App.vue b/GUI/src/App.vue index 94693e3f..4b1f98d8 100644 --- a/GUI/src/App.vue +++ b/GUI/src/App.vue @@ -61,7 +61,7 @@ diff --git a/GUI/src/components/Axis.vue b/GUI/src/components/Axis.vue index acbaab1c..73509d0c 100644 --- a/GUI/src/components/Axis.vue +++ b/GUI/src/components/Axis.vue @@ -4,9 +4,9 @@ @click.self="showError = !showError;" :class="{ noError: !error, error: error}" > - {{ axis.name }} + {{ axis }}
- + axis: {{axisErrorMsg}}
motor: @@ -26,6 +26,7 @@ diff --git a/GUI/src/store.js b/GUI/src/store.js index 134ca9ca..de0ef06a 100644 --- a/GUI/src/store.js +++ b/GUI/src/store.js @@ -272,13 +272,11 @@ export default new Vuex.Store({ if ('axis0' in context.state.odrives[odrive]) { axes.push({ name: `${odrive}.axis0`, - ref: context.state.odrives[odrive]['axis0'] }); } if ('axis1' in context.state.odrives[odrive]) { axes.push({ name: `${odrive}.axis1`, - ref: context.state.odrives[odrive]['axis1'] }); } }