Skip to content

Commit 9a73df4

Browse files
authored
Merge pull request #8 from n7space/feature-mbep#345-fixes-and-tweaks
Feature MBEP#345 Fixes and tweaks
2 parents faf723c + bf9507a commit 9a73df4

10 files changed

Lines changed: 54 additions & 2 deletions

data/ecss-template/ecss-e-st-40c_4_1_software_static_architecture.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ for func in interface_view.functions:
1818
funcs.sort(key=lambda f: f.name.lower())
1919

2020
# Get functions deployed to the target partition
21+
if "TARGET" not in values or not values["TARGET"]:
22+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
2123
target_partition_name = values["TARGET"]
2224

2325
deployed_funcs = []
@@ -29,6 +31,9 @@ for node in deployment_view.nodes:
2931
target_node = node
3032
target_partition = partition
3133

34+
if target_partition is None:
35+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
36+
3237
deployed_func_names = [f.name for f in target_partition.functions]
3338
for fun in funcs:
3439
if fun.name in deployed_func_names:

data/ecss-template/ecss-e-st-40c_4_2_software_dynamic_architecture.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ for func in interface_view.functions:
1818
funcs.sort(key=lambda f: f.name.lower())
1919

2020
# Get functions deployed to the target partition
21+
if "TARGET" not in values or not values["TARGET"]:
22+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
2123
target_partition_name = values["TARGET"]
2224

2325
deployed_funcs = []
@@ -27,6 +29,9 @@ for node in deployment_view.nodes:
2729
if partition.name == target_partition_name:
2830
target_partition = partition
2931

32+
if target_partition is None:
33+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
34+
3035
deployed_func_names = [f.name for f in target_partition.functions]
3136
for fun in funcs:
3237
if fun.name in deployed_func_names:

data/ecss-template/ecss-e-st-40c_4_3_software_behaviour.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ for func in interface_view.functions:
1818
funcs.sort(key=lambda f: f.name.lower())
1919

2020
# Get functions deployed to the target partition
21+
if "TARGET" not in values or not values["TARGET"]:
22+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
2123
target_partition_name = values["TARGET"]
2224

2325
deployed_funcs = []
@@ -26,6 +28,9 @@ for node in deployment_view.nodes:
2628
for partition in node.partitions:
2729
if partition.name == target_partition_name:
2830
target_partition = partition
31+
32+
if target_partition is None:
33+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
2934

3035
deployed_func_names = [f.name for f in target_partition.functions]
3136
for fun in funcs:

data/ecss-template/ecss-e-st-40c_4_4_interfaces_context.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ for func in interface_view.functions:
2424
funcs.sort(key=lambda f: f.name.lower())
2525

2626
# Get functions deployed to the target partition
27+
if "TARGET" not in values or not values["TARGET"]:
28+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
2729
target_partition_name = values["TARGET"]
2830

2931
deployed_funcs = []
@@ -32,6 +34,9 @@ for node in deployment_view.nodes:
3234
for partition in node.partitions:
3335
if partition.name == target_partition_name:
3436
target_partition = partition
37+
38+
if target_partition is None:
39+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
3540

3641
deployed_func_names = [f.name for f in target_partition.functions]
3742
for fun in funcs:
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
<%
2-
memories = system_object_types["on_board_memory"]
2+
try:
3+
memories = system_object_types["on_board_memory"]
4+
except Exception:
5+
memories = None
36
%>
7+
% if memories is None:
8+
No on-board memories
9+
% else:
410
| ID | Name | Size | Alignment |
511
| - | - | - | - |
612
% for idx, memory in enumerate(memories.instances):
713
|${memory.values["ID"]}|${memory.values["Name"]}|${memory.values["Size"]}|${memory.values["Alignment"]}|
8-
% endfor
14+
% endfor
15+
% endif

data/ecss-template/ecss-e-st-40c_5_2_overall_architecture.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ for func in interface_view.functions:
1818
funcs.sort(key=lambda f: f.name.lower())
1919

2020
# Get functions deployed to the target partition
21+
if "TARGET" not in values or not values["TARGET"]:
22+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
2123
target_partition_name = values["TARGET"]
2224

2325
deployed_funcs = []
@@ -28,6 +30,9 @@ for node in deployment_view.nodes:
2830
if partition.name == target_partition_name:
2931
target_node = node
3032
target_partition = partition
33+
34+
if target_partition is None:
35+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
3136

3237
deployed_func_names = [f.name for f in target_partition.functions]
3338
for fun in funcs:

data/ecss-template/ecss-e-st-40c_5_3_software_components_design.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ for func in interface_view.functions:
1818
funcs.sort(key=lambda f: f.name.lower())
1919

2020
# Get functions deployed to the target partition
21+
if "TARGET" not in values or not values["TARGET"]:
22+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
2123
target_partition_name = values["TARGET"]
2224

2325
deployed_funcs = []
@@ -26,6 +28,9 @@ for node in deployment_view.nodes:
2628
for partition in node.partitions:
2729
if partition.name == target_partition_name:
2830
target_partition = partition
31+
32+
if target_partition is None:
33+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
2934

3035
deployed_func_names = [f.name for f in target_partition.functions]
3136
for fun in funcs:

data/ecss-template/ecss-e-st-40c_5_4_aspects_of_each_component.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ for func in interface_view.functions:
1818
funcs.sort(key=lambda f: f.name.lower())
1919

2020
# Get functions deployed to the target partition
21+
if "TARGET" not in values or not values["TARGET"]:
22+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
2123
target_partition_name = values["TARGET"]
2224

2325
deployed_funcs = []
@@ -26,6 +28,9 @@ for node in deployment_view.nodes:
2628
for partition in node.partitions:
2729
if partition.name == target_partition_name:
2830
target_partition = partition
31+
32+
if target_partition is None:
33+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
2934

3035
deployed_func_names = [f.name for f in target_partition.functions]
3136
for fun in funcs:

data/ecss-template/ecss-e-st-40c_5_5_internal_interface_design.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ for func in interface_view.functions:
2525
funcs.sort(key=lambda f: f.name.lower() if f is not None and hasattr(f, 'name') else '')
2626

2727
# Get functions deployed to the target partition
28+
if "TARGET" not in values or not values["TARGET"]:
29+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
2830
target_partition_name = values["TARGET"]
2931

3032
deployed_funcs = []
@@ -34,6 +36,9 @@ for node in deployment_view.nodes:
3436
if partition is not None and hasattr(partition, 'name') and partition.name == target_partition_name:
3537
target_partition = partition
3638

39+
if target_partition is None:
40+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
41+
3742
if target_partition is None:
3843
print(f"WARNING: Target partition '{target_partition_name}' not found")
3944
deployed_func_names = []

data/ecss-template/ecss-e-st-40c_6_requirement_traceability.tmplt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ for func in interface_view.functions:
1616
funcs.extend(get_function_children(func))
1717

1818
# Get functions deployed to the target partition
19+
if "TARGET" not in values or not values["TARGET"]:
20+
raise Exception("This template requires TARGET to be defined and pointing to the desired partition name")
1921
target_partition_name = values["TARGET"]
2022

2123
deployed_funcs = []
@@ -24,6 +26,9 @@ for node in deployment_view.nodes:
2426
for partition in node.partitions:
2527
if partition.name == target_partition_name:
2628
target_partition = partition
29+
30+
if target_partition is None:
31+
raise Exception("TARGET partition not found, please check your Deployment View and TARGET definition ({})".format(target_partition_name))
2732

2833
deployed_func_names = [f.name for f in target_partition.functions]
2934
for fun in funcs:

0 commit comments

Comments
 (0)