Skip to content
Snippets Groups Projects
Commit 422e4ad5 authored by David Hammer's avatar David Hammer
Browse files

Handle 2.10.0 not having missingConnections

parent ec2c4d83
No related branches found
No related tags found
1 merge request!12Snapshot: field test deployed version as of end of run 202201
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment