Skip to content

Commit

Permalink
Merge pull request #62 from DSD-DBS/exchange-trace-pa
Browse files Browse the repository at this point in the history
Exchange trace pa
  • Loading branch information
vik378 authored Feb 17, 2022
2 parents 36f0615 + 3c8703b commit c5798c5
Show file tree
Hide file tree
Showing 4 changed files with 1,463 additions and 1,235 deletions.
34 changes: 0 additions & 34 deletions capellambse/model/crosslayer/fa.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,6 @@ class FunctionalExchange(AbstractExchange):
def owner(self) -> ComponentExchange | None:
return self.allocating_component_exchange

@owner.setter
def owner(self, exchange: ComponentExchange | None) -> None:
if not isinstance(exchange, (ComponentExchange, type(None))):
raise ValueError(
"Owner needs to be of type 'ComponentExchange' or 'NoneType'"
)
self.allocating_component_exchange = exchange

@owner.deleter
def owner(self) -> None:
self.allocating_component_exchange = None


@c.xtype_handler(None)
class FunctionalChain(c.GenericElement):
Expand Down Expand Up @@ -212,28 +200,6 @@ class ComponentExchange(AbstractExchange):
def owner(self) -> cs.PhysicalLink | cs.PhysicalPath | None:
return self.allocating_physical_link or self.allocating_physical_path

@owner.setter
def owner(
self: ComponentExchange,
exchange: cs.PhysicalLink | cs.PhysicalPath | None,
) -> None:
if isinstance(exchange, cs.PhysicalLink):
self.allocating_physical_link = exchange
elif isinstance(exchange, cs.PhysicalPath):
self.allocating_physical_path = exchange
elif exchange is None:
del self.owner

raise ValueError(
"Owner needs to be either of type 'PhysicalLink', 'PhysicalPath'"
" or 'NoneType'"
)

@owner.deleter
def owner(self) -> None:
del self.allocating_physical_path
del self.allocating_physical_link

@property
def func_exchanges(self) -> c.ElementList[FunctionalExchange]:
import warnings
Expand Down
Loading

0 comments on commit c5798c5

Please sign in to comment.