Firebird: Difference between revisions
From stonehomewiki
Jump to navigationJump to search
Stonezhong (talk | contribs) (→APIs) |
Stonezhong (talk | contribs) (→APIs) |
||
| Line 65: | Line 65: | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
Represent a node that does not have output ports. | Represent a node that does not have output ports. | ||
</div> | |||
</div> | |||
<p></p> | |||
<div class="toccolours mw-collapsible mw-collapsed expandable"> | |||
<div class="mw-collapsible-preview">Port</div> | |||
<div class="mw-collapsible-content"> | |||
Represent a input port or output port | |||
Properties: | |||
* type: either PortType.INPUT or PortType.OUTPUT, represent it is a input port or output port | |||
* name: name of the port, it is unique within the node | |||
* owner: the node which this port belongs to | |||
* connected_ports: other ports connected to this port | |||
Methods: | |||
<pre><nowiki> | |||
def connect(self, *ports: Union["Port", Node]) | |||
# connect this port to other port | |||
</nowiki></pre> | |||
<pre><nowiki> | |||
def emit(self, json_data:Any) | |||
# emit data to this port | |||
</nowiki></pre> | |||
</div> | </div> | ||
</div> | </div> | ||