From 4713383c39d58191b41167ea95ca71acb3bd71ee Mon Sep 17 00:00:00 2001 From: Matheus Bernardi Date: Thu, 28 May 2026 16:03:10 +0200 Subject: [PATCH] extend abstract collect classes to allow custom diffraction viewer --- .../HardwareObjects/abstract/AbstractCollect.py | 11 +++++++++++ .../abstract/AbstractMultiCollect.py | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mxcubecore/HardwareObjects/abstract/AbstractCollect.py b/mxcubecore/HardwareObjects/abstract/AbstractCollect.py index 10db993828..f9e65f5eb8 100644 --- a/mxcubecore/HardwareObjects/abstract/AbstractCollect.py +++ b/mxcubecore/HardwareObjects/abstract/AbstractCollect.py @@ -935,3 +935,14 @@ def adxv_notify(self, image_filename: str, image_num: int = 1): ) except OSError: self.log.exception("ADXV: Failed to load image '%s'", image_filename) + + def display_image(self, image_filename: str, image_num: int = 1): + """ + Site specific call to a diffraction viewer, defaults to adxv notify + + Args: + image_filename: full path to image file + image_num: image number within image file to open (if it contains + multiple images i.e HDF5) + """ + self.adxv_notify(image_filename=image_filename, image_num=image_num) diff --git a/mxcubecore/HardwareObjects/abstract/AbstractMultiCollect.py b/mxcubecore/HardwareObjects/abstract/AbstractMultiCollect.py index 92587b403f..9871b76dc2 100644 --- a/mxcubecore/HardwareObjects/abstract/AbstractMultiCollect.py +++ b/mxcubecore/HardwareObjects/abstract/AbstractMultiCollect.py @@ -471,7 +471,7 @@ def do_collect(self, owner, data_collect_parameters): data_collect_parameters["status"] = "failed" logging.getLogger("user_level_log").info("Storing data collection in LIMS") - (self.collection_id, detector_id) = HWR.beamline.lims.store_data_collection( + self.collection_id, detector_id = HWR.beamline.lims.store_data_collection( data_collect_parameters, self.bl_config ) @@ -1342,3 +1342,14 @@ def set_mesh_scan_parameters( self.mesh_total_nb_frames = total_nb_frames self.mesh_range = mesh_range_param self.mesh_center = mesh_center_param + + def display_image(self, image_filename: str, image_num: int = 1): + """ + Site specific call to a diffraction viewer, defaults to adxv notify + + Args: + image_filename: full path to image file + image_num: image number within image file to open (if it contains + multiple images i.e HDF5) + """ + self.adxv_notify(image_filename=image_filename, image_num=image_num)