From 7ac77c3e89a67ca5d482ee0023136d35afdba326 Mon Sep 17 00:00:00 2001 From: jaknapper Date: Fri, 25 Jul 2025 16:52:37 +0100 Subject: [PATCH 1/2] Stitch all scans button, and refresh scan tab when closing modals --- .../things/smart_scan.py | 16 +++++++++++++ .../labThingsComponents/actionButton.vue | 2 ++ .../tabContentComponents/scanListContent.vue | 24 +++++++++++++++++-- webapp/src/main.js | 1 + 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index f7e5d675..c295896e 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -977,3 +977,19 @@ class SmartScanThing(lt.Thing): """ zip_fname = self._scan_dir_manager.zip_scan(scan_name, final_version=True) return ZipBlob.from_file(zip_fname) + + @lt.thing_action + def stitch_all_scans( + self, logger: lt.deps.InvocationLogger, cancel: lt.deps.CancelHook + ): + """Check the list of scans, and stitch any that don't have a DZI associated with it. + + Raises: + RuntimeError if the microscope is currently running a scan + + """ + if self._scan_logger is not None: + raise RuntimeError("Can't stitch previous scans while a scan is ongoing") + for scan in self._scan_dir_manager.all_scans_info(): + if scan.dzi is None: + self.stitch_scan(logger=logger, cancel=cancel, scan_name=scan.name) diff --git a/webapp/src/components/labThingsComponents/actionButton.vue b/webapp/src/components/labThingsComponents/actionButton.vue index 1defd4dd..73ca9537 100644 --- a/webapp/src/components/labThingsComponents/actionButton.vue +++ b/webapp/src/components/labThingsComponents/actionButton.vue @@ -344,10 +344,12 @@ export default { hideModal() { UIkit.modal(this.$refs.statusModal).hide(); + this.$root.$emit("modalClosed"); }, terminateTask: function() { axios.delete(this.taskUrl, { baseURL: this.$store.getters.baseUri }); + this.$root.$emit("modalClosed"); } } }; diff --git a/webapp/src/components/tabContentComponents/scanListContent.vue b/webapp/src/components/tabContentComponents/scanListContent.vue index 5446a933..65363c43 100644 --- a/webapp/src/components/tabContentComponents/scanListContent.vue +++ b/webapp/src/components/tabContentComponents/scanListContent.vue @@ -10,6 +10,22 @@
+
+ +