From 3cdfd52a770767c0652950a95a6f8dd21f075417 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 25 Jul 2021 09:14:33 +0100 Subject: [PATCH 1/3] Added controls for smart stack --- .../captureComponents/paneCapture.vue | 102 +++++++++++++++++- 1 file changed, 99 insertions(+), 3 deletions(-) diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue index 1db6f96b..2670734b 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue @@ -244,10 +244,70 @@ + +
  • + Smart Stack +
    +
    + +
    +

    + Smart stacking is an experimental closed-loop Z stack, that checks + the Z stack is centred on the focus. It requires Z stacking to be + enabled above (we recommend 9 images in Z) and you must select + "fast" autofocus. +

    +
    +
    + + +
    +
    + + +
    +
    +
    +
  • + + { this.modalError(error); // Let mixin handle error }); + + axios + .get(this.pluginsUri) // Get a list of plugins + .then(response => { + var plugins = response.data; + var foundExtension = plugins.find( + e => e.title === "org.openflexure.smart-stack" + ); + if (foundExtension) { + // Get plugin action link + this.smartScanUri = foundExtension.links.tile.href; + } + }) + .catch(error => { + this.modalError(error); // Let mixin handle error + }); }, onScanResponse: function() { From 332ecad19b41238f51d9bfe06db0dd320fa89990 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 2 Aug 2021 10:31:07 +0100 Subject: [PATCH 2/3] Update caniuse-lite --- .../api/static/package-lock.json | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/openflexure_microscope/api/static/package-lock.json b/openflexure_microscope/api/static/package-lock.json index eb4170dd..47792e84 100644 --- a/openflexure_microscope/api/static/package-lock.json +++ b/openflexure_microscope/api/static/package-lock.json @@ -2971,12 +2971,6 @@ "unique-filename": "^1.1.1" } }, - "caniuse-lite": { - "version": "1.0.30001165", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001165.tgz", - "integrity": "sha512-8cEsSMwXfx7lWSUMA2s08z9dIgsnR5NAqjXP23stdsU3AUWkCr/rr4s4OFtHXn5XXr6+7kam3QFVoYyXNPdJPA==", - "dev": true - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3902,12 +3896,6 @@ "node-releases": "^1.1.67" } }, - "caniuse-lite": { - "version": "1.0.30001165", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001165.tgz", - "integrity": "sha512-8cEsSMwXfx7lWSUMA2s08z9dIgsnR5NAqjXP23stdsU3AUWkCr/rr4s4OFtHXn5XXr6+7kam3QFVoYyXNPdJPA==", - "dev": true - }, "electron-to-chromium": { "version": "1.3.615", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.615.tgz", @@ -4724,9 +4712,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001020", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001020.tgz", - "integrity": "sha512-yWIvwA68wRHKanAVS1GjN8vajAv7MBFshullKCeq/eKpK7pJBVDgFFEqvgWTkcP2+wIDeQGYFRXECjKZnLkUjA==", + "version": "1.0.30001249", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001249.tgz", + "integrity": "sha512-vcX4U8lwVXPdqzPWi6cAJ3FnQaqXbBqy/GZseKNQzRj37J7qZdGcBtxq/QLFNLLlfsoXLUdHw8Iwenri86Tagw==", "dev": true }, "case-sensitive-paths-webpack-plugin": { From b7c15886e9275e188c1622511937f1bc235fd5cb Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 9 Aug 2021 21:57:52 +0100 Subject: [PATCH 3/3] Use neater spread operator to copy objects Rather than Object.assign, I now use the ... operator to ensure that dictionaries don't pollute each other in computed properties. --- .../captureComponents/paneCapture.vue | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue b/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue index 2670734b..75e87d8d 100644 --- a/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue +++ b/openflexure_microscope/api/static/src/components/tabContentComponents/captureComponents/paneCapture.vue @@ -441,18 +441,6 @@ export default { }, scanPayload: function() { - var payload = Object.assign({}, this.basePayload); - - // Scan params - payload.grid = [this.scanSteps.x, this.scanSteps.y, this.scanSteps.z]; - payload.stride_size = [ - this.scanStepSize.x, - this.scanStepSize.y, - this.scanStepSize.z - ]; - payload.style = this.scanStyle.toLowerCase(); - payload.namemode = this.namingStyle.toLowerCase(); - // Convert AF selector to dz var afDeltas = { Off: 0, @@ -461,22 +449,32 @@ export default { Fine: 10, Fast: 2000 }; - - payload.autofocus_dz = afDeltas[this.scanDeltaZ]; - payload.fast_autofocus = this.scanDeltaZ == "Fast"; - - return payload; + return { + ...this.basePayload, + // Scan params + grid: [this.scanSteps.x, this.scanSteps.y, this.scanSteps.z], + stride_size: [ + this.scanStepSize.x, + this.scanStepSize.y, + this.scanStepSize.z + ], + style: this.scanStyle.toLowerCase(), + namemode: this.namingStyle.toLowerCase(), + autofocus_dz: afDeltas[this.scanDeltaZ], + fast_autofocus: this.scanDeltaZ == "Fast" + }; }, smartScanPayload: function() { - var payload = Object.assign({}, this.scanPayload); - payload.threshold = this.smartStackThreshold; - payload.width = this.smartStackPeakWidth; - payload.align_dist = this.smartStackAlignDist; - payload.backlash = this.smartStackBacklash; - payload.fit_style = this.smartStackFitStyle; - payload.m_and_m_index = this.smartStackMAndMIndex; - payload.autofocus_dz = this.smartStackAutofocusDz; - return payload; + return { + ...this.scanPayload, + threshold: this.smartStackThreshold, + width: this.smartStackPeakWidth, + align_dist: this.smartStackAlignDist, + backlash: this.smartStackBacklash, + fit_style: this.smartStackFitStyle, + m_and_m_index: this.smartStackMAndMIndex, + autofocus_dz: this.smartStackAutofocusDz + }; } },