Skip to content
Snippets Groups Projects
Commit c8f59f47 authored by Philipp Schmidt's avatar Philipp Schmidt
Browse files

manager: Move properties for pipeline instantation to their own node

parent e3ebc723
No related branches found
No related tags found
2 merge requests!12Snapshot: field test deployed version as of end of run 202201,!3Base correction device, CalCat interaction, DSSC and AGIPD devices
......@@ -226,8 +226,29 @@ class WebserverApiNode(Configurable):
accessMode=AccessMode.RECONFIGURABLE)
class RuntimeParametersNode(Configurable):
# Queried from CorrectionsDevices via slot?
class InstantiationOptionsNode(Configurable):
restoreMatcherSources = Bool(
displayedName='Restore matcher sources',
description='Attempt to retrieve and restore the last known '
'configuration for slow and fast sources of matcher '
'devices when the pipeline is instantiated.',
defaultValue=False,
accessMode=AccessMode.RECONFIGURABLE)
autoActivateGroupBridges = Bool(
displayedName='Activate bridges automatically',
description='Whether to activate all group bridges immediately after '
'instantation.',
defaultValue=False,
accessMode=AccessMode.RECONFIGURABLE)
autoActivateGroupMatchers = Bool(
displayedName='Activate group matchers automatically',
description='Whether to activate all group matchers immediately after '
'instantation.',
defaultValue=False,
accessMode=AccessMode.RECONFIGURABLE)
def _device(self):
# Pretty sure this is not supposed to work like this.
......@@ -403,6 +424,11 @@ class CalibrationManager(DeviceClientBase, Device):
description='Configurations for the webserver API to control device '
'servers.')
instantiationOptions = Node(
InstantiationOptionsNode,
displayedName='Instantiation options',
description='Optional flags controlling the pipeline instantiation.')
doNotCompressEvents = Bool(
requiredAccessLevel=AccessLevel.GOD,
accessMode=AccessMode.READONLY,
......@@ -424,28 +450,6 @@ class CalibrationManager(DeviceClientBase, Device):
self.state = State.CHANGING
background(self._instantiate_pipeline())
restoreMatcherSources = Bool(
displayedName='Restore matcher sources',
description='Attempt to retrieve and restore the last known '
'configuration for slow and fast sources of matcher '
'devices when the pipeline is instantiated.',
defaultValue=False,
accessMode=AccessMode.RECONFIGURABLE)
autoActivateBridges = Bool(
displayedName='Activate bridges automatically',
description='Whether to activate all group bridges immediately '
'after instantation',
defaultValue=True,
accessMode=AccessMode.RECONFIGURABLE)
autoActivateGroupMatchers = Bool(
displayedName='Activate group matchers automatically',
description='Whether to activate all group matchers (feeding group bridges) '
'immediately after instantation',
defaultValue=True,
accessMode=AccessMode.RECONFIGURABLE)
outputAxisOrder = String(
displayedName='Output axis order',
description='Axes of main data output can be reordered after correction. '
......@@ -954,7 +958,7 @@ class CalibrationManager(DeviceClientBase, Device):
'fsSource', input_source_by_module[vname])
for vname in modules_by_group[group]]
if self.restoreMatcherSources:
if self.instantiationOptions.restoreMatcherSources:
try:
old_config = await getConfigurationFromPast(
matcher_device_id, datetime.now().isoformat())
......@@ -970,7 +974,7 @@ class CalibrationManager(DeviceClientBase, Device):
matcher_device_id, config
):
return
elif self.autoActivateGroupMatchers:
elif self.instantiationOptions.autoActivateGroupMatchers:
async def _activate_matcher(device_id):
with await getDevice(device_id) as device:
await sleep(3)
......@@ -995,7 +999,7 @@ class CalibrationManager(DeviceClientBase, Device):
server, class_ids['bridge'], bridge_device_id, config
):
return
elif self.autoActivateBridges:
elif self.instantiationOptions.autoActivateGroupBridges:
# Delay the slot a bit since it will get lost during
# instantation.
......
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