Skip to content
Snippets Groups Projects
Commit 4ab6906c authored by angloth's avatar angloth
Browse files

Add deepcopy implementation, however doesn't user input_sources argument so is...

Add deepcopy implementation, however doesn't user input_sources argument so is not fully complete yet
parent b0dbf845
No related branches found
No related tags found
5 merge requests!31Resolve "Specify internal input/output dependencies of an Operation",!25Resolve "System tests iteration 1",!24Resolve "System tests iteration 1",!23Resolve "Simulate SFG",!21Resolve "Print SFG"
Pipeline #12263 passed
......@@ -66,6 +66,7 @@ class SFG(AbstractOperation):
self._added_components_mapping = {}
self._original_input_signals_indexes = {}
self._original_output_signals_indexes = {}
self._id_number_offset = id_number_offset
# Setup input signals.
for input_index, sig in enumerate(input_signals):
......@@ -207,6 +208,13 @@ class SFG(AbstractOperation):
"""
return self._components_by_name.get(name, [])
def deep_copy(self) -> "SFG":
"""Returns a deep copy of self."""
copy = SFG(inputs=self._input_operations,
outputs=self._output_operations, id_number_offset=self._id_number_offset, name=super().name)
return copy
def _add_component_copy_unconnected(self, original_comp: GraphComponent) -> GraphComponent:
assert original_comp not in self._added_components_mapping, "Tried to add duplicate SFG component"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment