Skip to content
Snippets Groups Projects
Commit 79a285cc authored by angloth's avatar angloth
Browse files

Rename connect_destination_port to connect_destination and connect_source_port to connect_source

parent f9e6dc7e
No related branches found
No related tags found
1 merge request!9Resolve #1 "Port Interface", #8 "Port Coupling"
......@@ -122,7 +122,7 @@ class InputPort(Port):
self._signal = signal
if not signal.port_is_destination(self):
# Connect this inputport as destination for this signal if it isn't already.
signal.connect_destination_port(self)
signal.connect_destination(self)
def disconnect_signal(self, i: int = 0) -> None:
assert 0 <= i < self.signal_count(), "Signal Index out of range."
......@@ -174,7 +174,7 @@ class OutputPort(Port):
self._signals.append(signal)
if not signal.port_is_source(self):
# Connect this outputport to the signal if it isn't already
signal.connect_source_port(self)
signal.connect_source(self)
def disconnect_signal(self, i: int = 0) -> None:
assert 0 <= i < self.signal_count(), "Signal index out of bounds."
......
......@@ -22,13 +22,13 @@ class Signal(AbstractGraphComponent):
super().__init__(name)
self._source = source
self._destination = destination
self._destination = destination
if source is not None:
self.connect_source_port(source)
self.connect_source(source)
if destination is not None:
self.connect_destination_port(destination)
self.connect_destination(destination)
@property
def source(self) -> "OutputPort":
......@@ -40,7 +40,7 @@ class Signal(AbstractGraphComponent):
"""Returns the destination "InputPort" of the signal."""
return self._destination
def connect_source_port(self, src: "OutputPort") -> None:
def connect_source(self, src: "OutputPort") -> None:
"""Disconnects the previous source OutputPort of the signal and
connects to the entered source OutputPort. Also connects the entered
source port to the signal if it hasn't already been connected.
......@@ -54,7 +54,7 @@ class Signal(AbstractGraphComponent):
# If the new source isn't connected to this signal then connect it.
src.connect_signal(self)
def connect_destination_port(self, dest: "InputPort") -> None:
def connect_destination(self, dest: "InputPort") -> None:
"""Disconnects the previous destination InputPort of the signal and
connects to the entered destination InputPort. Also connects the entered
destination port to the signal if it hasn't already been connected.
......
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