diff --git a/data/ecss-template/ecss-e-st-40c_4_1_software_static_architecture.tmplt b/data/ecss-template/ecss-e-st-40c_4_1_software_static_architecture.tmplt index a8274c2..e4a5689 100644 --- a/data/ecss-template/ecss-e-st-40c_4_1_software_static_architecture.tmplt +++ b/data/ecss-template/ecss-e-st-40c_4_1_software_static_architecture.tmplt @@ -18,6 +18,8 @@ for func in interface_view.functions: funcs.sort(key=lambda f: f.name.lower()) # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -29,6 +31,9 @@ for node in deployment_view.nodes: target_node = node target_partition = partition +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) + deployed_func_names = [f.name for f in target_partition.functions] for fun in funcs: if fun.name in deployed_func_names: diff --git a/data/ecss-template/ecss-e-st-40c_4_2_software_dynamic_architecture.tmplt b/data/ecss-template/ecss-e-st-40c_4_2_software_dynamic_architecture.tmplt index adbfb7b..52b012f 100644 --- a/data/ecss-template/ecss-e-st-40c_4_2_software_dynamic_architecture.tmplt +++ b/data/ecss-template/ecss-e-st-40c_4_2_software_dynamic_architecture.tmplt @@ -18,6 +18,8 @@ for func in interface_view.functions: funcs.sort(key=lambda f: f.name.lower()) # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -27,6 +29,9 @@ for node in deployment_view.nodes: if partition.name == target_partition_name: target_partition = partition +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) + deployed_func_names = [f.name for f in target_partition.functions] for fun in funcs: if fun.name in deployed_func_names: diff --git a/data/ecss-template/ecss-e-st-40c_4_3_software_behaviour.tmplt b/data/ecss-template/ecss-e-st-40c_4_3_software_behaviour.tmplt index 7e8d1b9..32f977c 100644 --- a/data/ecss-template/ecss-e-st-40c_4_3_software_behaviour.tmplt +++ b/data/ecss-template/ecss-e-st-40c_4_3_software_behaviour.tmplt @@ -18,6 +18,8 @@ for func in interface_view.functions: funcs.sort(key=lambda f: f.name.lower()) # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -26,6 +28,9 @@ for node in deployment_view.nodes: for partition in node.partitions: if partition.name == target_partition_name: target_partition = partition + +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) deployed_func_names = [f.name for f in target_partition.functions] for fun in funcs: diff --git a/data/ecss-template/ecss-e-st-40c_4_4_interfaces_context.tmplt b/data/ecss-template/ecss-e-st-40c_4_4_interfaces_context.tmplt index bfc8968..1e52236 100644 --- a/data/ecss-template/ecss-e-st-40c_4_4_interfaces_context.tmplt +++ b/data/ecss-template/ecss-e-st-40c_4_4_interfaces_context.tmplt @@ -24,6 +24,8 @@ for func in interface_view.functions: funcs.sort(key=lambda f: f.name.lower()) # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -32,6 +34,9 @@ for node in deployment_view.nodes: for partition in node.partitions: if partition.name == target_partition_name: target_partition = partition + +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) deployed_func_names = [f.name for f in target_partition.functions] for fun in funcs: diff --git a/data/ecss-template/ecss-e-st-40c_4_6_memory.tmplt b/data/ecss-template/ecss-e-st-40c_4_6_memory.tmplt index 8fd1367..a53964a 100644 --- a/data/ecss-template/ecss-e-st-40c_4_6_memory.tmplt +++ b/data/ecss-template/ecss-e-st-40c_4_6_memory.tmplt @@ -1,8 +1,15 @@ <% -memories = system_object_types["on_board_memory"] +try: + memories = system_object_types["on_board_memory"] +except Exception: + memories = None %> +% if memories is None: +No on-board memories +% else: | ID | Name | Size | Alignment | | - | - | - | - | % for idx, memory in enumerate(memories.instances): |${memory.values["ID"]}|${memory.values["Name"]}|${memory.values["Size"]}|${memory.values["Alignment"]}| -% endfor \ No newline at end of file +% endfor +% endif \ No newline at end of file diff --git a/data/ecss-template/ecss-e-st-40c_5_2_overall_architecture.tmplt b/data/ecss-template/ecss-e-st-40c_5_2_overall_architecture.tmplt index 7ad8a05..2893a98 100644 --- a/data/ecss-template/ecss-e-st-40c_5_2_overall_architecture.tmplt +++ b/data/ecss-template/ecss-e-st-40c_5_2_overall_architecture.tmplt @@ -18,6 +18,8 @@ for func in interface_view.functions: funcs.sort(key=lambda f: f.name.lower()) # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -28,6 +30,9 @@ for node in deployment_view.nodes: if partition.name == target_partition_name: target_node = node target_partition = partition + +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) deployed_func_names = [f.name for f in target_partition.functions] for fun in funcs: diff --git a/data/ecss-template/ecss-e-st-40c_5_3_software_components_design.tmplt b/data/ecss-template/ecss-e-st-40c_5_3_software_components_design.tmplt index 467b979..bd46a5a 100644 --- a/data/ecss-template/ecss-e-st-40c_5_3_software_components_design.tmplt +++ b/data/ecss-template/ecss-e-st-40c_5_3_software_components_design.tmplt @@ -18,6 +18,8 @@ for func in interface_view.functions: funcs.sort(key=lambda f: f.name.lower()) # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -26,6 +28,9 @@ for node in deployment_view.nodes: for partition in node.partitions: if partition.name == target_partition_name: target_partition = partition + +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) deployed_func_names = [f.name for f in target_partition.functions] for fun in funcs: diff --git a/data/ecss-template/ecss-e-st-40c_5_4_aspects_of_each_component.tmplt b/data/ecss-template/ecss-e-st-40c_5_4_aspects_of_each_component.tmplt index d878524..1d4c523 100644 --- a/data/ecss-template/ecss-e-st-40c_5_4_aspects_of_each_component.tmplt +++ b/data/ecss-template/ecss-e-st-40c_5_4_aspects_of_each_component.tmplt @@ -18,6 +18,8 @@ for func in interface_view.functions: funcs.sort(key=lambda f: f.name.lower()) # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -26,6 +28,9 @@ for node in deployment_view.nodes: for partition in node.partitions: if partition.name == target_partition_name: target_partition = partition + +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) deployed_func_names = [f.name for f in target_partition.functions] for fun in funcs: diff --git a/data/ecss-template/ecss-e-st-40c_5_5_internal_interface_design.tmplt b/data/ecss-template/ecss-e-st-40c_5_5_internal_interface_design.tmplt index 4467a50..067a9dc 100644 --- a/data/ecss-template/ecss-e-st-40c_5_5_internal_interface_design.tmplt +++ b/data/ecss-template/ecss-e-st-40c_5_5_internal_interface_design.tmplt @@ -25,6 +25,8 @@ for func in interface_view.functions: funcs.sort(key=lambda f: f.name.lower() if f is not None and hasattr(f, 'name') else '') # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -34,6 +36,9 @@ for node in deployment_view.nodes: if partition is not None and hasattr(partition, 'name') and partition.name == target_partition_name: target_partition = partition +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) + if target_partition is None: print(f"WARNING: Target partition '{target_partition_name}' not found") deployed_func_names = [] diff --git a/data/ecss-template/ecss-e-st-40c_6_requirement_traceability.tmplt b/data/ecss-template/ecss-e-st-40c_6_requirement_traceability.tmplt index 816aee3..a5ac8b6 100644 --- a/data/ecss-template/ecss-e-st-40c_6_requirement_traceability.tmplt +++ b/data/ecss-template/ecss-e-st-40c_6_requirement_traceability.tmplt @@ -16,6 +16,8 @@ for func in interface_view.functions: funcs.extend(get_function_children(func)) # Get functions deployed to the target partition +if "TARGET" not in values or not values["TARGET"]: + raise Exception("This template requires TARGET to be defined and pointing to the desired partition name") target_partition_name = values["TARGET"] deployed_funcs = [] @@ -24,6 +26,9 @@ for node in deployment_view.nodes: for partition in node.partitions: if partition.name == target_partition_name: target_partition = partition + +if target_partition is None: + raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name)) deployed_func_names = [f.name for f in target_partition.functions] for fun in funcs: