Stitch all scans button, and refresh scan tab when closing modals
This commit is contained in:
parent
37a28af04a
commit
7ac77c3e89
4 changed files with 41 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,6 +10,22 @@
|
|||
<!-- Right side buttons -->
|
||||
<div class="uk-navbar-right">
|
||||
<div class="uk-grid">
|
||||
<div style="margin-top:5px;margin-bottom: 2px">
|
||||
<action-button
|
||||
class="uk-width-1-1"
|
||||
thing="smart_scan"
|
||||
action="stitch_all_scans"
|
||||
submit-label="Stitch All Remaining"
|
||||
:can-terminate="true"
|
||||
:button-primary="false"
|
||||
:modal-progress="true"
|
||||
:requires-confirmation="true"
|
||||
:confirmation-message="
|
||||
'<h3>Stitch all unstitched scans?</h3><br>Depending on the number and size of scans, this may be slow, and your microscope should not be used during the stitching.'
|
||||
"
|
||||
@error="modalError"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
class="uk-button uk-button-default uk-width-1-1"
|
||||
|
|
@ -117,12 +133,11 @@
|
|||
thing="smart_scan"
|
||||
action="stitch_scan"
|
||||
v-if="item.can_stitch | (item.stitch_available & !item.dzi)"
|
||||
:can-terminate="false"
|
||||
:can-terminate="true"
|
||||
:submit-data="{ scan_name: item.name }"
|
||||
:button-primary="false"
|
||||
:modal-progress="true"
|
||||
@error="modalError"
|
||||
@response="updateScans"
|
||||
/>
|
||||
<button
|
||||
v-if="item.dzi" class="uk-button uk-button-default uk-width-1-1"
|
||||
|
|
@ -200,6 +215,10 @@ export default {
|
|||
this.$root.$on("globalUpdateScans", () => {
|
||||
this.updateScans();
|
||||
});
|
||||
this.$root.$on("modalClosed", () => {
|
||||
// Handle the modal closed event here
|
||||
this.updateScans();
|
||||
});
|
||||
},
|
||||
|
||||
created: function() {
|
||||
|
|
@ -228,6 +247,7 @@ export default {
|
|||
this.unwatchStoreFunction();
|
||||
this.unwatchStoreFunction = null;
|
||||
}
|
||||
this.$root.$off("modalClosed"); // Clean up event listener
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ Vue.mixin({
|
|||
if (context.$store.state.autoGpuPreview) {
|
||||
context.$root.$emit("globalTogglePreview", true);
|
||||
}
|
||||
context.$root.$emit("modalClosed");
|
||||
});
|
||||
};
|
||||
return new Promise(showModal);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue