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): ...@@ -226,8 +226,29 @@ class WebserverApiNode(Configurable):
accessMode=AccessMode.RECONFIGURABLE) accessMode=AccessMode.RECONFIGURABLE)
class RuntimeParametersNode(Configurable): class InstantiationOptionsNode(Configurable):
# Queried from CorrectionsDevices via slot? 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): def _device(self):
# Pretty sure this is not supposed to work like this. # Pretty sure this is not supposed to work like this.
...@@ -403,6 +424,11 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -403,6 +424,11 @@ class CalibrationManager(DeviceClientBase, Device):
description='Configurations for the webserver API to control device ' description='Configurations for the webserver API to control device '
'servers.') 'servers.')
instantiationOptions = Node(
InstantiationOptionsNode,
displayedName='Instantiation options',
description='Optional flags controlling the pipeline instantiation.')
doNotCompressEvents = Bool( doNotCompressEvents = Bool(
requiredAccessLevel=AccessLevel.GOD, requiredAccessLevel=AccessLevel.GOD,
accessMode=AccessMode.READONLY, accessMode=AccessMode.READONLY,
...@@ -424,28 +450,6 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -424,28 +450,6 @@ class CalibrationManager(DeviceClientBase, Device):
self.state = State.CHANGING self.state = State.CHANGING
background(self._instantiate_pipeline()) 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( outputAxisOrder = String(
displayedName='Output axis order', displayedName='Output axis order',
description='Axes of main data output can be reordered after correction. ' description='Axes of main data output can be reordered after correction. '
...@@ -954,7 +958,7 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -954,7 +958,7 @@ class CalibrationManager(DeviceClientBase, Device):
'fsSource', input_source_by_module[vname]) 'fsSource', input_source_by_module[vname])
for vname in modules_by_group[group]] for vname in modules_by_group[group]]
if self.restoreMatcherSources: if self.instantiationOptions.restoreMatcherSources:
try: try:
old_config = await getConfigurationFromPast( old_config = await getConfigurationFromPast(
matcher_device_id, datetime.now().isoformat()) matcher_device_id, datetime.now().isoformat())
...@@ -970,7 +974,7 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -970,7 +974,7 @@ class CalibrationManager(DeviceClientBase, Device):
matcher_device_id, config matcher_device_id, config
): ):
return return
elif self.autoActivateGroupMatchers: elif self.instantiationOptions.autoActivateGroupMatchers:
async def _activate_matcher(device_id): async def _activate_matcher(device_id):
with await getDevice(device_id) as device: with await getDevice(device_id) as device:
await sleep(3) await sleep(3)
...@@ -995,7 +999,7 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -995,7 +999,7 @@ class CalibrationManager(DeviceClientBase, Device):
server, class_ids['bridge'], bridge_device_id, config server, class_ids['bridge'], bridge_device_id, config
): ):
return return
elif self.autoActivateBridges: elif self.instantiationOptions.autoActivateGroupBridges:
# Delay the slot a bit since it will get lost during # Delay the slot a bit since it will get lost during
# instantation. # 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