Commit c043c4d7 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

PathComp component - FrontEnd:

- Updated retrieval of device controller
- Updated deepness level of microwave devices/controllers
parent 8e898979
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -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: