Added global event listeners to task submitters
This commit is contained in:
parent
2b9bec24f1
commit
9cf491aeb0
2 changed files with 27 additions and 2 deletions
|
|
@ -111,6 +111,8 @@
|
||||||
:submit-url="fastAutofocusUri"
|
:submit-url="fastAutofocusUri"
|
||||||
:submit-data="{ dz: 2000 }"
|
:submit-data="{ dz: 2000 }"
|
||||||
:submit-label="'Fast'"
|
:submit-label="'Fast'"
|
||||||
|
:button-primary="false"
|
||||||
|
:submit-on-event="'globalFastAutofocusEvent'"
|
||||||
@taskStarted="isAutofocusing = 1"
|
@taskStarted="isAutofocusing = 1"
|
||||||
@finished="isAutofocusing = 0"
|
@finished="isAutofocusing = 0"
|
||||||
></taskSubmitter>
|
></taskSubmitter>
|
||||||
|
|
@ -122,6 +124,7 @@
|
||||||
:submit-url="normalAutofocusUri"
|
:submit-url="normalAutofocusUri"
|
||||||
:submit-data="{ dz: [-60, -30, 0, 30, 60] }"
|
:submit-data="{ dz: [-60, -30, 0, 30, 60] }"
|
||||||
:submit-label="'Medium'"
|
:submit-label="'Medium'"
|
||||||
|
:button-primary="false"
|
||||||
@taskStarted="isAutofocusing = 2"
|
@taskStarted="isAutofocusing = 2"
|
||||||
@finished="isAutofocusing = 0"
|
@finished="isAutofocusing = 0"
|
||||||
></taskSubmitter>
|
></taskSubmitter>
|
||||||
|
|
@ -133,6 +136,7 @@
|
||||||
:submit-url="normalAutofocusUri"
|
:submit-url="normalAutofocusUri"
|
||||||
:submit-data="{ dz: [-20, -10, 0, 10, 20] }"
|
:submit-data="{ dz: [-20, -10, 0, 10, 20] }"
|
||||||
:submit-label="'Fine'"
|
:submit-label="'Fine'"
|
||||||
|
:button-primary="false"
|
||||||
@taskStarted="isAutofocusing = 3"
|
@taskStarted="isAutofocusing = 3"
|
||||||
@finished="isAutofocusing = 0"
|
@finished="isAutofocusing = 0"
|
||||||
></taskSubmitter>
|
></taskSubmitter>
|
||||||
|
|
@ -201,6 +205,7 @@ export default {
|
||||||
this.$root.$on("globalMoveInImageCoordinatesEvent", (x, y, absolute) => {
|
this.$root.$on("globalMoveInImageCoordinatesEvent", (x, y, absolute) => {
|
||||||
this.moveInImageCoordinatesRequest(x, y, absolute);
|
this.moveInImageCoordinatesRequest(x, y, absolute);
|
||||||
});
|
});
|
||||||
|
// 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.stepXy,
|
||||||
|
|
@ -219,6 +224,8 @@ export default {
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
// Remove global signal listener to perform a move action
|
// Remove global signal listener to perform a move action
|
||||||
this.$root.$off("globalMoveEvent");
|
this.$root.$off("globalMoveEvent");
|
||||||
|
this.$root.$off("globalMoveInImageCoordinatesEvent");
|
||||||
|
this.$root.$off("globalMoveStepEvent");
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,12 @@ export default {
|
||||||
buttonPrimary: {
|
buttonPrimary: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: false
|
default: true
|
||||||
|
},
|
||||||
|
submitOnEvent: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -101,7 +106,20 @@ export default {
|
||||||
|
|
||||||
created() {},
|
created() {},
|
||||||
|
|
||||||
beforeDestroy() {},
|
mounted() {
|
||||||
|
// A global signal listener to perform a move action
|
||||||
|
if (this.submitOnEvent) {
|
||||||
|
this.$root.$on(this.submitOnEvent, () => {
|
||||||
|
this.bootstrapTask();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
if (this.submitOnEvent) {
|
||||||
|
this.$root.$off(this.submitOnEvent);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
bootstrapTask: function() {
|
bootstrapTask: function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue