diff --git a/webapp/src/components/tabContentComponents/navigateComponents/paneNavigate.vue b/webapp/src/components/tabContentComponents/navigateComponents/paneNavigate.vue index 75a9be8d..71440df3 100644 --- a/webapp/src/components/tabContentComponents/navigateComponents/paneNavigate.vue +++ b/webapp/src/components/tabContentComponents/navigateComponents/paneNavigate.vue @@ -71,7 +71,18 @@ + @@ -102,8 +113,8 @@ :submit-url="absoluteMoveUri" :submit-data="setPosition" :submit-label="'Move'" - :canTerminate="false" - :pollInterval="0.05" + :can-terminate="false" + :poll-interval="0.05" @taskStarted="moveLock = true" @finished="moveLock = false" @error="modalError" @@ -216,6 +227,9 @@ export default { zeroActionUri: function() { return this.thingActionUrl("stage", "set_zero_position"); }, + recentreActionUri: function() { + return this.thingActionUrl("auto_recentre_stage", "recentre"); + }, positionStatusUri: function() { return `${this.baseUri}/stage/position`; }, @@ -263,7 +277,7 @@ export default { // A global signal listener to perform a move in multiples of a step size this.$root.$on("globalMoveStepEvent", (x_steps, y_steps, z_steps) => { this.$root.$emit( - "globalMoveEvent", + "globalMoveEvent", x_steps * this.stepSize.x * (this.invert.x ? -1 : 1), y_steps * this.stepSize.y * (this.invert.y ? -1 : 1), z_steps * this.stepSize.z * (this.invert.z ? -1 : 1), @@ -288,21 +302,21 @@ export default { async move(x, y, z, absolute) { // Move the stage, by updating the controls and starting a move task // This is equivalent to clicking the "move" button. - if (this.moveLock) return; // Discard move requests if we're already moving + if (this.moveLock) return; // Discard move requests if we're already moving // NB moveLock is just boolean flag - it's not as safe as a "proper" lock. - this.moveLock = true; // This will also be set by the task submitter, but + this.moveLock = true; // This will also be set by the task submitter, but // setting it here avoids multiple moves being requested simultaneously. - if (absolute){ - this.setPosition = {"x": x, "y": y, "z": z} - }else{ + 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, - "z": this.setPosition.z + z - } + x: this.setPosition.x + x, + y: this.setPosition.y + y, + z: this.setPosition.z + z + }; } - await this.timeout(1); // Wait for Vue to update the position + await this.timeout(1); // Wait for Vue to update the position await this.startMoveTask(); }, async startMoveTask() { @@ -351,7 +365,7 @@ export default { }, async updatePosition() { - this.setPosition = await this.readThingProperty("stage", "position") + this.setPosition = await this.readThingProperty("stage", "position"); }, handleCaptureResponse: async function(response) { @@ -375,7 +389,6 @@ export default { }; -