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

manager: Move autostart for matcher and bridges to module groups

parent b6dc9170
No related branches found
No related tags found
1 merge request!12Snapshot: field test deployed version as of end of run 202201
...@@ -167,10 +167,16 @@ class ModuleGroupRow(Configurable): ...@@ -167,10 +167,16 @@ class ModuleGroupRow(Configurable):
displayedName='Device server') displayedName='Device server')
withMatcher = Bool( withMatcher = Bool(
displayedName='Matcher?') displayedName='Include matcher?')
startMatcher = Bool(
displayedName='Start matcher?')
withBridge = Bool( withBridge = Bool(
displayedName='Bridge?') displayedName='Include bridge?')
startBridge = Bool(
displayedName='Start bridge?')
bridgePort = UInt16( bridgePort = UInt16(
displayedName='Bridge port', displayedName='Bridge port',
...@@ -255,22 +261,6 @@ class RestoredConfigurationRow(Configurable): ...@@ -255,22 +261,6 @@ class RestoredConfigurationRow(Configurable):
displayedName='Key pattern') displayedName='Key pattern')
class InstantiationOptionsNode(Configurable):
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)
class ManagedKeysNode(Configurable): class ManagedKeysNode(Configurable):
pass pass
...@@ -400,11 +390,6 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -400,11 +390,6 @@ class CalibrationManager(DeviceClientBase, Device):
for enabled, member_pattern, key_pattern in new_configs.value for enabled, member_pattern, key_pattern in new_configs.value
if enabled} if enabled}
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,
...@@ -656,7 +641,7 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -656,7 +641,7 @@ class CalibrationManager(DeviceClientBase, Device):
""" """
correction_device_servers = [ correction_device_servers = [
server for _, server, _, _, _, _ in self.moduleGroups.value] server for _, server, _, _, _, _, _, _ in self.moduleGroups.value]
up_corr_servers = await self._get_servers_in_state( up_corr_servers = await self._get_servers_in_state(
'up', servers=correction_device_servers) 'up', servers=correction_device_servers)
...@@ -1157,7 +1142,7 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -1157,7 +1142,7 @@ class CalibrationManager(DeviceClientBase, Device):
getattr(self.deviceIds, f'{role}Suffix') getattr(self.deviceIds, f'{role}Suffix')
# Servers by group and layer. # Servers by group and layer.
server_by_group = {group: server for group, server, _, _, _, _ server_by_group = {group: server for group, server, _, _, _, _, _, _
in self.moduleGroups.value} in self.moduleGroups.value}
server_by_layer = {layer: server for layer, _, server server_by_layer = {layer: server for layer, _, server
in self.previewLayers.value} in self.previewLayers.value}
...@@ -1220,8 +1205,8 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -1220,8 +1205,8 @@ class CalibrationManager(DeviceClientBase, Device):
# Instantiate group matchers and bridges. # Instantiate group matchers and bridges.
for row in self.moduleGroups.value: for row in self.moduleGroups.value:
group, server, with_matcher, with_bridge, bridge_port, \ group, server, with_matcher, start_matcher, with_bridge, \
bridge_pattern = row start_bridge, bridge_port, bridge_pattern = row
# Group matcher, if applicable. # Group matcher, if applicable.
if with_matcher: if with_matcher:
...@@ -1242,7 +1227,7 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -1242,7 +1227,7 @@ class CalibrationManager(DeviceClientBase, Device):
matcher_device_id, config matcher_device_id, config
): ):
return return
elif self.instantiationOptions.autoActivateGroupMatchers: elif start_matcher:
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)
...@@ -1267,7 +1252,7 @@ class CalibrationManager(DeviceClientBase, Device): ...@@ -1267,7 +1252,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.instantiationOptions.autoActivateGroupBridges: elif start_bridge:
# 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