Merge branch 'navigation-invert-config' into 'master'

Navigation invert config

See merge request openflexure/openflexure-microscope-server!93
This commit is contained in:
Joel Collins 2020-11-23 17:44:09 +00:00
commit ac446dcd42
3 changed files with 78 additions and 16 deletions

View file

@ -5,33 +5,66 @@
<li> <li>
<a class="uk-accordion-title" href="#">Configure</a> <a class="uk-accordion-title" href="#">Configure</a>
<div class="uk-accordion-content"> <div class="uk-accordion-content">
<div class="uk-child-width-1-2" uk-grid> <b>STEP SIZE</b>
<div class="uk-grid-small uk-child-width-1-3" uk-grid>
<div> <div>
<label class="uk-form-label" for="form-stacked-text" <label class="uk-form-label" for="form-stacked-text">x</label>
>x-y step size</label
>
<div class="uk-form-controls"> <div class="uk-form-controls">
<input <input
v-model="stepXy" v-model="stepSize.x"
class="uk-input uk-form-width-medium uk-form-small" class="uk-input uk-form-small"
type="number" type="number"
name="inputStepXy" name="inputStepXy"
/> />
</div> </div>
<label class="uk-margin-small-right"
><input
v-model="invert.x"
class="uk-checkbox"
type="checkbox"
/>
Invert x</label
>
</div> </div>
<div> <div>
<label class="uk-form-label" for="form-stacked-text" <label class="uk-form-label" for="form-stacked-text">y</label>
>z step size</label
>
<div class="uk-form-controls"> <div class="uk-form-controls">
<input <input
v-model="stepZz" v-model="stepSize.y"
class="uk-input uk-form-width-medium uk-form-small" class="uk-input uk-form-small"
type="number"
name="inputStepY"
/>
</div>
<label class="uk-margin-small-right"
><input
v-model="invert.y"
class="uk-checkbox"
type="checkbox"
/>
Invert y</label
>
</div>
<div>
<label class="uk-form-label" for="form-stacked-text">z</label>
<div class="uk-form-controls">
<input
v-model="stepSize.z"
class="uk-input uk-form-small"
type="number" type="number"
name="inputStepZz" name="inputStepZz"
/> />
</div> </div>
<label
><input
v-model="invert.z"
class="uk-checkbox"
type="checkbox"
/>
Invert z</label
>
</div> </div>
</div> </div>
@ -172,6 +205,16 @@ export default {
return { return {
stepXy: 200, stepXy: 200,
stepZz: 50, stepZz: 50,
stepSize: {
x: 200,
y: 200,
z: 50
},
invert: {
x: false,
y: false,
z: false
},
setPosition: null, setPosition: null,
isAutofocusing: 0, isAutofocusing: 0,
moveLock: false, 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() { 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 // A global signal listener to perform a move action
this.$root.$on("globalMoveEvent", (x, y, z, absolute) => { this.$root.$on("globalMoveEvent", (x, y, z, absolute) => {
this.moveRequest(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 // 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.$on("globalMoveStepEvent", (x_steps, y_steps, z_steps) => {
this.moveRequest( this.moveRequest(
x_steps * this.stepXy, x_steps * this.stepSize.x * (this.invert.x ? -1 : 1),
y_steps * this.stepXy, y_steps * this.stepSize.y * (this.invert.y ? -1 : 1),
z_steps * this.stepZz, z_steps * this.stepSize.z * (this.invert.z ? -1 : 1),
false false
); );
}); });

View file

@ -35,7 +35,7 @@ export default {
}, },
watch: { watch: {
appTheme() { appTheme: function() {
this.setLocalStorageObj("appTheme", this.appTheme); this.setLocalStorageObj("appTheme", this.appTheme);
} }
}, },

View file

@ -39,7 +39,7 @@ export default {
}, },
watch: { watch: {
IHIEnabled() { IHIEnabled: function() {
this.setLocalStorageObj("IHIEnabled", this.IHIEnabled); this.setLocalStorageObj("IHIEnabled", this.IHIEnabled);
} }
}, },