diff --git a/src/calng/DetectorAssembler.py b/src/calng/DetectorAssembler.py index 75a11b87b3e2b27bbc2569bcb87ffbf685909a47..4659cc6abac2e1c3867ca97f557a014ff4935709 100644 --- a/src/calng/DetectorAssembler.py +++ b/src/calng/DetectorAssembler.py @@ -3,6 +3,7 @@ import pickle import re import threading import time +from pkg_resources import parse_version import numpy as np from karabo.bound import ( @@ -31,6 +32,7 @@ from karabo.bound import ( ) from TrainMatcher import TrainMatcher +from karabo import version as karaboVersion from . import scenes from ._version import version as deviceVersion @@ -205,18 +207,23 @@ class DetectorAssembler(TrainMatcher.TrainMatcher): for i in range(max_tries): time.sleep(np.random.random() * 10) if self.geometry is None: - missing_connections = set( - self.get("geometryInput.missingConnections") + geometry_device_list = list( + self.get("geometryInput.connectedOutputChannels") ) - # note: connectedOutputChannels not necessarily connected... - geometry_device_list = [ - channel - for channel in self.get("geometryInput.connectedOutputChannels") - if channel not in missing_connections - ] - if not geometry_device_list: - self.log.INFO("No geometry device connected") - continue + # first check if geometry device not even connected + if parse_version(karaboVersion) >= parse_version("2.11"): + # missingConnections apparently not a thing on 2.10 + missing_connections = set( + self.get("geometryInput.missingConnections") + ) + geometry_device_list = [ + channel + for channel in geometry_device_list + if channel not in missing_connections + ] + if not geometry_device_list: + self.log.INFO("No geometry device connected") + continue geometry_device = geometry_device_list[0].split(":")[0] self.log.INFO(f"Asking {geometry_device} for a geometry") self.signalSlotable.call(geometry_device, "pleaseSendYourGeometry")