diff --git a/src/components/paneNavigate.vue b/src/components/paneNavigate.vue
index 22a9f9cd..42130fbf 100644
--- a/src/components/paneNavigate.vue
+++ b/src/components/paneNavigate.vue
@@ -72,7 +72,7 @@
-
+
@@ -238,6 +238,32 @@ export default {
this.$store.commit('changeMoveLock', false); // Release the move lock
})
}
+ },
+
+ runFastAutofocus: function(dz, backlash) {
+ if (!this.$store.state.moveLock) {
+ // Lock move requests
+ this.$store.commit('changeMoveLock', true);
+ this.isAutofocusing = true
+ axios.post(this.fastAutofocusApiUri, {dz: dz, backlash: backlash})
+ .then(response => {
+ console.log("Autofocus Task ID: " + response.data.id)
+ // Start the store polling TaskId for success
+ return this.$store.dispatch('pollTask', [response.data.id, null, null])
+ })
+ .then(() => {
+ console.log("Successfully finished autofocus")
+ })
+ .catch(error => {
+ UIkit.notification({message: ` ${error}`, status: 'danger'})
+ this.$store.dispatch('handleHTTPError', error); // Let store handle error
+ })
+ .finally(() => {
+ console.log("Cleaning up after autofocus.")
+ this.isAutofocusing = false;
+ this.$store.commit('changeMoveLock', false); // Release the move lock
+ })
+ }
}
},
@@ -254,6 +280,9 @@ export default {
},
autofocusApiUri: function () {
return this.$store.getters.uri + "/plugin/default/autofocus/autofocus"
+ },
+ fastAutofocusApiUri: function () {
+ return this.$store.getters.uri + "/plugin/default/fast_autofocus/fast_autofocus"
}
}