Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions converter/lib/create_xmls.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def formatSCD(rp, ports):

for si in supports_list:
all_interfaces.add_interface(scd.interface(repid=si.id, name=si.name, inheritsinterface=si.inherits))
sup_interfaces.add_supportsinterface(scd.supportsInterface(repid=si.id, supportsname=si.name))
# 2020-June-15 - Deactivate redundant support list
#sup_interfaces.add_supportsinterface(scd.supportsInterface(repid=si.id, supportsname=si.name))

for interface in all_interfaces.get_interface():
if "Resource" in interface.name:
Expand Down Expand Up @@ -116,7 +117,7 @@ def formatPRF(rp, props, docker_image, docker_volumes):
for i in range(0, len(props)):
new_id = "gr::" + props[i].name
new_name = "gr_" + props[i].name
rp.addSimpleProperty(id=new_id, value=props[i].value, complex=False, type=props[i].type, kindtypes=["property"])
rp.addSimpleProperty(id=new_id, value=str(props[i].value), complex=False, type=props[i].type, kindtypes=["property"])
rp.prf.simple[i].set_name(new_name)

def docker_execparam(name, value, description):
Expand Down
21 changes: 17 additions & 4 deletions converter/lib/xml_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,23 @@ def from_xml(block):
param_key = param.find('key').text.lower()
param_value = param.find('value').text

if param_key == "_enabled" and "true" != param_value.lower():
# Skip disabled blocks
# EARLY RETURN
return None
"""
2020-06-15
Swap to support numeric booleans
Tested with GNU Radio 3.7.14
"""
#if param_key == "_enabled" and "true" != param_value.lower():
# # Skip disabled blocks
# # EARLY RETURN
# return None
if param_key == "_enabled":
if param_value.lower() == "true":
continue # enabled with true
elif param_value.lower() in ["false", "none"]:
return None # disabled with false or None
elif not bool(int(param_value)):
return None # disabled component, return None

# Map other known keys to fields or treat any unknowns as possible
# references to variable IDs (if the key starts with an alpha char)
elif param_key == "id":
Expand Down