From 2cc69ba1ea8dcb745b8d6b2f129c19e246b3cd44 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Sun, 7 Apr 2019 19:51:08 +0100 Subject: [PATCH 1/2] Changed coarse autofocus button to run fast autofocus --- src/components/paneNavigate.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/paneNavigate.vue b/src/components/paneNavigate.vue index 22a9f9cd..9278ecad 100644 --- a/src/components/paneNavigate.vue +++ b/src/components/paneNavigate.vue @@ -72,7 +72,7 @@
- +
@@ -214,16 +214,16 @@ export default { } }, - runAutofocus: function(dz) { + runFastAutofocus: function(dz, backlash) { if (!this.$store.state.moveLock) { // Lock move requests this.$store.commit('changeMoveLock', true); this.isAutofocusing = true - axios.post(this.autofocusApiUri, {dz: dz}) + axios.post(this.fastAutofocusApiUri, {dz: dz, backlash: backlash}) .then(response => { - console.log("Autofocus Task ID: " + response.data[0].id) + console.log("Autofocus Task ID: " + response.data.id) // Start the store polling TaskId for success - return this.$store.dispatch('pollTask', [response.data[0].id, null, null]) + return this.$store.dispatch('pollTask', [response.data.id, null, null]) }) .then(() => { console.log("Successfully finished autofocus") @@ -254,6 +254,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" } } From 3579fe32ead01fcccb649471f5764cd362b80b60 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Sun, 7 Apr 2019 21:00:50 +0100 Subject: [PATCH 2/2] Reinstated runAutofocus (deleted by accident) --- src/components/paneNavigate.vue | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/components/paneNavigate.vue b/src/components/paneNavigate.vue index 9278ecad..42130fbf 100644 --- a/src/components/paneNavigate.vue +++ b/src/components/paneNavigate.vue @@ -214,6 +214,32 @@ export default { } }, + runAutofocus: function(dz) { + if (!this.$store.state.moveLock) { + // Lock move requests + this.$store.commit('changeMoveLock', true); + this.isAutofocusing = true + axios.post(this.autofocusApiUri, {dz: dz}) + .then(response => { + console.log("Autofocus Task ID: " + response.data[0].id) + // Start the store polling TaskId for success + return this.$store.dispatch('pollTask', [response.data[0].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 + }) + } + }, + runFastAutofocus: function(dz, backlash) { if (!this.$store.state.moveLock) { // Lock move requests