From d49b34ef6c7f8b28bc0499b55f319fe4465a82dc Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Mon, 23 Nov 2020 17:32:00 +0000 Subject: [PATCH] Added options to invert navigation steps --- .../navigateComponents/paneNavigate.vue | 90 ++++++++++++++++--- 1 file changed, 76 insertions(+), 14 deletions(-) diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/navigateComponents/paneNavigate.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/navigateComponents/paneNavigate.vue index d22b045e..9d291f16 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/navigateComponents/paneNavigate.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/navigateComponents/paneNavigate.vue @@ -5,33 +5,66 @@
  • Configure
    -
    + STEP SIZE +
    - +
    +
    - +
    +
    + +
    + +
    + +
    +
    +
    @@ -172,6 +205,16 @@ export default { return { stepXy: 200, stepZz: 50, + stepSize: { + x: 200, + y: 200, + z: 50 + }, + invert: { + x: false, + y: false, + z: false + }, setPosition: null, isAutofocusing: 0, moveLock: false, @@ -196,7 +239,26 @@ export default { } }, + watch: { + stepSize: { + deep: true, + handler() { + this.setLocalStorageObj("navigation_stepSize", this.stepSize); + } + }, + invert: { + deep: true, + handler() { + this.setLocalStorageObj("navigation_invert", this.invert); + } + } + }, + mounted() { + // Reload saved settings + this.stepSize = + this.getLocalStorageObj("navigation_stepSize") || this.stepSize; + this.invert = this.getLocalStorageObj("navigation_invert") || this.invert; // A global signal listener to perform a move action this.$root.$on("globalMoveEvent", (x, y, z, absolute) => { this.moveRequest(x, y, z, absolute); @@ -208,9 +270,9 @@ 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.moveRequest( - x_steps * this.stepXy, - y_steps * this.stepXy, - z_steps * this.stepZz, + 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), false ); });