From c043c4d7d59cd9a98f5fb24aa288007361428a09 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Fri, 19 May 2023 09:58:00 +0000 Subject: [PATCH] PathComp component - FrontEnd: - Updated retrieval of device controller - Updated deepness level of microwave devices/controllers --- .../service/algorithms/tools/ResourceGroups.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pathcomp/frontend/service/algorithms/tools/ResourceGroups.py b/src/pathcomp/frontend/service/algorithms/tools/ResourceGroups.py index e56d436dd..c1591dbeb 100644 --- a/src/pathcomp/frontend/service/algorithms/tools/ResourceGroups.py +++ b/src/pathcomp/frontend/service/algorithms/tools/ResourceGroups.py @@ -36,8 +36,8 @@ DEVICE_TYPE_TO_DEEPNESS = { DeviceTypeEnum.EMULATED_XR_CONSTELLATION.value : 40, DeviceTypeEnum.XR_CONSTELLATION.value : 40, - DeviceTypeEnum.EMULATED_MICROWAVE_RADIO_SYSTEM.value : 30, - DeviceTypeEnum.MICROWAVE_RADIO_SYSTEM.value : 30, + DeviceTypeEnum.EMULATED_MICROWAVE_RADIO_SYSTEM.value : 40, + DeviceTypeEnum.MICROWAVE_RADIO_SYSTEM.value : 40, DeviceTypeEnum.EMULATED_OPEN_LINE_SYSTEM.value : 30, DeviceTypeEnum.OPEN_LINE_SYSTEM.value : 30, @@ -57,11 +57,13 @@ IGNORED_DEVICE_TYPES = {DeviceTypeEnum.EMULATED_OPTICAL_SPLITTER} def get_device_controller_uuid( device : Device ) -> Optional[str]: - for config_rule in device.device_config.config_rules: - if config_rule.WhichOneof('config_rule') != 'custom': continue - if config_rule.custom.resource_key != '_controller': continue - device_controller_id = json.loads(config_rule.custom.resource_value) - return device_controller_id['uuid'] + controller_uuid = device.controller_id.device_uuid.uuid + if len(controller_uuid) > 0: return controller_uuid + #for config_rule in device.device_config.config_rules: + # if config_rule.WhichOneof('config_rule') != 'custom': continue + # if config_rule.custom.resource_key != '_controller': continue + # device_controller_id = json.loads(config_rule.custom.resource_value) + # return device_controller_id['uuid'] return None def _map_device_type(device : Device) -> DeviceTypeEnum: -- GitLab