From 93757c2103219dd4b5940daea51b01755946150c Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Fri, 15 Dec 2023 00:15:23 +0000 Subject: [PATCH] Improve responsiveness and reliability of moves Fixed a bug where incorrect values in the position control caused incorrect relative moves. Decreased the polling interval to make moves more responsive. --- .../navigateComponents/paneNavigate.vue | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/webapp/src/components/tabContentComponents/navigateComponents/paneNavigate.vue b/webapp/src/components/tabContentComponents/navigateComponents/paneNavigate.vue index 7a2975d6..70e4b15b 100644 --- a/webapp/src/components/tabContentComponents/navigateComponents/paneNavigate.vue +++ b/webapp/src/components/tabContentComponents/navigateComponents/paneNavigate.vue @@ -78,7 +78,7 @@
  • - Move-to + Position
    @@ -102,6 +102,7 @@ :submit-data="setPosition" :submit-label="'Move'" :canTerminate="false" + :pollInterval="0.05" @taskStarted="moveLock = true" @finished="moveLock = false" @error="modalError" @@ -293,6 +294,7 @@ export default { if (absolute){ this.setPosition = {"x": x, "y": y, "z": z} }else{ + await this.updatePosition(); this.setPosition = { "x": this.setPosition.x + x, "y": this.setPosition.y + y, @@ -300,10 +302,10 @@ export default { } } await this.timeout(1); // Wait for Vue to update the position - this.startMoveTask(); + await this.startMoveTask(); }, - startMoveTask() { - this.$refs.moveTaskSubmitter.startTask(); + async startMoveTask() { + await this.$refs.moveTaskSubmitter.startTask(); }, moveInImageCoordinatesRequest: function(x, y) { // If not movement-locked @@ -347,15 +349,8 @@ export default { }); }, - updatePosition: function() { - axios - .get(this.positionStatusUri) - .then(response => { - this.setPosition = response.data; - }) - .catch(error => { - this.modalError(error); // Let mixin handle error - }); + async updatePosition() { + this.setPosition = await this.readThingProperty("stage", "position") }, handleCaptureResponse: async function(response) {