diff --git a/src/openflexure_microscope_server/things/smart_scan.py b/src/openflexure_microscope_server/things/smart_scan.py index d180364c..962310fb 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 = ( @@ -809,22 +810,24 @@ class SmartScanThing(Thing): images_folder = os.path.join(path, IMG_DIR_NAME) if os.path.isdir(images_folder): folder_contents = os.listdir(images_folder) - scan_images = [x for x in folder_contents if IMAGE_REGEX.search(x)] + scan_images = [i for i in folder_contents if IMAGE_REGEX.search(i)] + stitches = [ + i for i in folder_contents if i.endswith("_stitched.jpg") + ] number_of_images = len(scan_images) + stitch_available = len(stitches) > 0 else: number_of_images = 0 + stitch_available = False modified = max(os.stat(root).st_mtime for root, _, _ in os.walk(path)) - # If number of images is 0, should the scan be appended or ignored? - # When deleting images, empty scans should be deleted. When displaying - # 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 scans.append( ScanInfo( name=f, created=os.path.getctime(path), modified=modified, number_of_images=number_of_images, + stitch_available=stitch_available, ) ) return scans @@ -998,12 +1001,9 @@ class SmartScanThing(Thing): def log_buffer(buffer): """A short internal function to read everything in the buffer to - a multiline string and log""" - lines = [] + the log""" while line := buffer.readline(): - lines.append(line) - if lines: - logger.info("".join(lines)) + logger.info(line) # Run the command piping stdout into the process for reading and # forwarding the stdrerr to stdout diff --git a/webapp/public/titleiconpink.svg b/webapp/public/titleiconpink.svg index 5ef0d260..8300e4e5 100644 --- a/webapp/public/titleiconpink.svg +++ b/webapp/public/titleiconpink.svg @@ -3,7 +3,7 @@ diff --git a/webapp/src/App.vue b/webapp/src/App.vue index 632d2056..b972bec4 100644 --- a/webapp/src/App.vue +++ b/webapp/src/App.vue @@ -438,6 +438,7 @@ html { .thumbnail-fit { max-height: 120px; + max-width: 240px; object-fit: contain; overflow-y: hidden; } diff --git a/webapp/src/assets/less/theme.less b/webapp/src/assets/less/theme.less index 4a7d9134..df88729b 100644 --- a/webapp/src/assets/less/theme.less +++ b/webapp/src/assets/less/theme.less @@ -207,7 +207,8 @@ h4, .uk-h4 { } .uk-card-body { - padding: 20px 16px 8px 16px;; + padding: 20px 16px 8px 16px; + width: 240px; } .uk-card-media-top img { diff --git a/webapp/src/components/tabContentComponents/scanListContent.vue b/webapp/src/components/tabContentComponents/scanListContent.vue index 3d018826..20f4d461 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" > - - +