diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index 839d64b5..819a1a3b 100644 --- a/src/openflexure_microscope_server/things/smart_scan.py +++ b/src/openflexure_microscope_server/things/smart_scan.py @@ -76,6 +76,7 @@ class ScanInfo(BaseModel): created: datetime modified: datetime number_of_images: int + stitch_available: bool DOWNLOADABLE_SCAN_FILES = ( @@ -780,12 +781,17 @@ class SmartScanThing(Thing): # scans in the GUI or choosing a new scan name, should be ignored # A function to delete empty scan folders from the disk achieves all of this + + stitch_available=( + len([i for i in os.listdir(images_folder) if i.endswith("_stitched.jpg")]) > 0 + ) scans.append( ScanInfo( name=f, created=os.path.getctime(path), modified=modified, number_of_images=number_of_images, + stitch_available=stitch_available, ) ) return scans diff --git a/webapp/src/components/tabContentComponents/scanListContent.vue b/webapp/src/components/tabContentComponents/scanListContent.vue index 3d018826..60a29998 100644 --- a/webapp/src/components/tabContentComponents/scanListContent.vue +++ b/webapp/src/components/tabContentComponents/scanListContent.vue @@ -41,8 +41,7 @@ class="uk-padding-remove-top" uk-lightbox="toggle: .lightbox-link" > - - + @@ -198,6 +193,7 @@ export default { scans.forEach(scan => { scan.modified = Date.parse(scan.modified); scan.created = Date.parse(scan.created); + scan.can_stitch = !scan.stitch_available && scan.number_of_images > 3; }); scans.sort((a, b) => { return b.modified - a.modified;