Move stage control preferences to settings
This commit is contained in:
parent
f9020fc6a0
commit
e2c2db3d17
4 changed files with 92 additions and 82 deletions
|
|
@ -2,50 +2,6 @@
|
||||||
<div id="paneControl" class="uk-padding-small">
|
<div id="paneControl" class="uk-padding-small">
|
||||||
<div v-if="stageAvailable">
|
<div v-if="stageAvailable">
|
||||||
<ul uk-accordion="multiple: true">
|
<ul uk-accordion="multiple: true">
|
||||||
<li>
|
|
||||||
<a class="uk-accordion-title" href="#">Configure</a>
|
|
||||||
<div class="uk-accordion-content">
|
|
||||||
<b>Keyboard Step Size</b>
|
|
||||||
<div class="uk-grid-small uk-child-width-1-3" uk-grid>
|
|
||||||
<div>
|
|
||||||
<label class="uk-form-label" for="form-stacked-text">x</label>
|
|
||||||
<div class="uk-form-controls">
|
|
||||||
<input v-model="stepSize.x" class="uk-input uk-form-small" type="number" />
|
|
||||||
</div>
|
|
||||||
<label class="uk-margin-small-right"
|
|
||||||
><input v-model="invert.x" class="uk-checkbox" type="checkbox" /> Invert x</label
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label class="uk-form-label" for="form-stacked-text">y</label>
|
|
||||||
<div class="uk-form-controls">
|
|
||||||
<input v-model="stepSize.y" class="uk-input uk-form-small" type="number" />
|
|
||||||
</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" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<action-button
|
|
||||||
thing="stage"
|
|
||||||
action="set_zero_position"
|
|
||||||
submit-label="Zero Coordinates"
|
|
||||||
:can-terminate="false"
|
|
||||||
@finished="updatePosition"
|
|
||||||
@error="modalError"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="uk-open">
|
<li class="uk-open">
|
||||||
<a class="uk-accordion-title" href="#">Position</a>
|
<a class="uk-accordion-title" href="#">Position</a>
|
||||||
<div class="uk-accordion-content">
|
<div class="uk-accordion-content">
|
||||||
|
|
@ -80,9 +36,16 @@
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
<action-button
|
||||||
|
thing="stage"
|
||||||
|
action="set_zero_position"
|
||||||
|
submit-label="Zero Coordinates"
|
||||||
|
:can-terminate="false"
|
||||||
|
@finished="updatePosition"
|
||||||
|
@error="modalError"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!--Show autofocus if default plugin is enabled-->
|
<!--Show autofocus if default plugin is enabled-->
|
||||||
<li class="uk-open">
|
<li class="uk-open">
|
||||||
<a class="uk-accordion-title" href="#">Autofocus</a>
|
<a class="uk-accordion-title" href="#">Autofocus</a>
|
||||||
|
|
@ -170,15 +133,6 @@ export default {
|
||||||
stageAvailable() {
|
stageAvailable() {
|
||||||
return this.thingAvailable("stage");
|
return this.thingAvailable("stage");
|
||||||
},
|
},
|
||||||
// Note that as stepSize and invert are set based on internals we can use
|
|
||||||
// get() and set() to interact with the store. Instead use a deep watcher to
|
|
||||||
// update the store (see ``watch:`` below)
|
|
||||||
stepSize() {
|
|
||||||
return this.$store.state.navigationStepSize;
|
|
||||||
},
|
|
||||||
invert() {
|
|
||||||
return this.$store.state.navigationInvert;
|
|
||||||
},
|
|
||||||
baseUri: function () {
|
baseUri: function () {
|
||||||
return this.$store.getters.baseUri;
|
return this.$store.getters.baseUri;
|
||||||
},
|
},
|
||||||
|
|
@ -190,21 +144,6 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
|
||||||
stepSize: {
|
|
||||||
deep: true,
|
|
||||||
handler(newVal) {
|
|
||||||
this.$store.commit("changeNavigationStepSize", newVal);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
invert: {
|
|
||||||
deep: true,
|
|
||||||
handler(newVal) {
|
|
||||||
this.$store.commit("changeNavigationInvert", newVal);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
let self = this;
|
let self = this;
|
||||||
// A global signal listener to perform a move action
|
// A global signal listener to perform a move action
|
||||||
|
|
@ -215,13 +154,12 @@ 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.$root.$emit(
|
const navigationStepSize = this.$store.state.navigationStepSize;
|
||||||
"globalMoveEvent",
|
const navigationInvert = this.$store.state.navigationInvert;
|
||||||
x_steps * this.stepSize.x * (this.invert.x ? -1 : 1),
|
const x = x_steps * navigationStepSize.x * (navigationInvert.x ? -1 : 1);
|
||||||
y_steps * this.stepSize.y * (this.invert.y ? -1 : 1),
|
const y = y_steps * navigationStepSize.y * (navigationInvert.y ? -1 : 1);
|
||||||
z_steps * this.stepSize.z * (this.invert.z ? -1 : 1),
|
const z = z_steps * navigationStepSize.z * (navigationInvert.z ? -1 : 1);
|
||||||
false,
|
this.$root.$emit("globalMoveEvent", x, y, z, false);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
// Update the current position in text boxes
|
// Update the current position in text boxes
|
||||||
await this.updatePosition();
|
await this.updatePosition();
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import streamSettings from "./displaySetttingsComponents/streamSettings.vue";
|
||||||
|
|
||||||
// Export main app
|
// Export main app
|
||||||
export default {
|
export default {
|
||||||
name: "SettingsContent",
|
name: "DisplaySettings",
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
streamSettings,
|
streamSettings,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<a class="uk-accordion-title" href="#">Configure</a>
|
||||||
|
<div class="uk-accordion-content">
|
||||||
|
<b>Keyboard Step Size</b>
|
||||||
|
<div class="uk-grid-small uk-child-width-1-3" uk-grid>
|
||||||
|
<div>
|
||||||
|
<label class="uk-form-label" for="form-stacked-text">x</label>
|
||||||
|
<div class="uk-form-controls">
|
||||||
|
<input v-model="stepSize.x" class="uk-input uk-form-small" type="number" />
|
||||||
|
</div>
|
||||||
|
<label class="uk-margin-small-right"
|
||||||
|
><input v-model="invert.x" class="uk-checkbox" type="checkbox" /> Invert x</label
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="uk-form-label" for="form-stacked-text">y</label>
|
||||||
|
<div class="uk-form-controls">
|
||||||
|
<input v-model="stepSize.y" class="uk-input uk-form-small" type="number" />
|
||||||
|
</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" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "SatgeControlSettings",
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
// Note that as stepSize and invert are set based on internals we can use
|
||||||
|
// get() and set() to interact with the store. Instead use a deep watcher to
|
||||||
|
// update the store (see ``watch:`` below)
|
||||||
|
stepSize() {
|
||||||
|
return this.$store.state.navigationStepSize;
|
||||||
|
},
|
||||||
|
invert() {
|
||||||
|
return this.$store.state.navigationInvert;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
stepSize: {
|
||||||
|
deep: true,
|
||||||
|
handler(newVal) {
|
||||||
|
this.$store.commit("changeNavigationStepSize", newVal);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
invert: {
|
||||||
|
deep: true,
|
||||||
|
handler(newVal) {
|
||||||
|
this.$store.commit("changeNavigationInvert", newVal);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -59,6 +59,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import displaySettings from "./settingsComponents/displaySettings.vue";
|
import displaySettings from "./settingsComponents/displaySettings.vue";
|
||||||
|
import stageControlSettings from "./settingsComponents/stageControlSettings.vue";
|
||||||
import calibrationWizard from "../modalComponents/calibrationWizard.vue";
|
import calibrationWizard from "../modalComponents/calibrationWizard.vue";
|
||||||
import cameraSettings from "./settingsComponents/cameraSettings.vue";
|
import cameraSettings from "./settingsComponents/cameraSettings.vue";
|
||||||
import CSMSettings from "./settingsComponents/CSMSettings.vue";
|
import CSMSettings from "./settingsComponents/CSMSettings.vue";
|
||||||
|
|
@ -72,10 +73,6 @@ export default {
|
||||||
name: "SettingsContent",
|
name: "SettingsContent",
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
displaySettings,
|
|
||||||
cameraSettings,
|
|
||||||
stageSettings,
|
|
||||||
CSMSettings,
|
|
||||||
tabIcon,
|
tabIcon,
|
||||||
tabContent,
|
tabContent,
|
||||||
calibrationWizard,
|
calibrationWizard,
|
||||||
|
|
@ -93,6 +90,13 @@ export default {
|
||||||
component: displaySettings,
|
component: displaySettings,
|
||||||
requiredThings: [],
|
requiredThings: [],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "stage-control",
|
||||||
|
title: "Stage Control Preferences",
|
||||||
|
requireConnection: false,
|
||||||
|
component: stageControlSettings,
|
||||||
|
requiredThings: ["stage"],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
coreCalibrationTabs: [
|
coreCalibrationTabs: [
|
||||||
{
|
{
|
||||||
|
|
@ -125,7 +129,6 @@ export default {
|
||||||
return [...this.appTabs, ...this.calibrationTabs];
|
return [...this.appTabs, ...this.calibrationTabs];
|
||||||
},
|
},
|
||||||
appTabs() {
|
appTabs() {
|
||||||
console.log(this.coreAppTabs);
|
|
||||||
// Filter core top tabs based on available Things.
|
// Filter core top tabs based on available Things.
|
||||||
return this.coreAppTabs.filter((tab) => {
|
return this.coreAppTabs.filter((tab) => {
|
||||||
if (!tab.requiredThings || tab.requiredThings.length === 0) return true;
|
if (!tab.requiredThings || tab.requiredThings.length === 0) return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue