|
SILICON
|
Represents a connection point on a component. More...
#include <graphicalComponent.hpp>
Public Member Functions | |
| Port (unsigned int index, QPoint position, QString name, bool printName=false, QGraphicsItem *parent=nullptr) | |
| Constructs a port. | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
| Paints port names, bus markers, and input assignment errors. | |
| QRectF | boundingRect () const override |
| Gets visual bounds, including port labels and stroked markers. | |
| unsigned int | getIndex () const |
| Gets the port index. | |
| QPoint | getPosition () const |
| Gets the port position. | |
| QString | getName () const |
| Gets the port name. | |
| unsigned int | getSize () const |
| Gets the port bus size. | |
| PortSide | getDirection () const |
| Gets the port line direction. | |
| void | setSize (unsigned int newSize) |
| Sets the port bus size. | |
| void | setInputAssignmentError (bool failed) |
| Marks whether this port failed input assignment during simulation setup. | |
| void | setLine (QGraphicsLineItem *line) |
| Sets the connecting line. | |
| QRectF | collisionRect () const |
| Gets the collision rectangle for wire detection. | |
Private Member Functions | |
| QLineF | connectionLine () const |
| QTransform | labelTransform (const QRectF &rect, bool insideShape) const |
| void | prepareBoundsChange () |
Private Attributes | |
| unsigned int | index |
| Port index in the port list. | |
| QPoint | position |
| Position relative to component center. | |
| QGraphicsLineItem * | line = nullptr |
| Visual line connecting to component. | |
| QString | name |
| Port name. | |
| unsigned int | size = 1 |
| Number of wires represented by this port. | |
| PortSide | side = PortSide::RIGHT |
| Direction of the connecting line from port to component. | |
| bool | printName = false |
| Whether to write the port name on the component. | |
| bool | inputAssignmentError = false |
| Whether the net associated with this port has an error. | |
Friends | |
| class | GraphicalComponent |
Represents a connection point on a component.
Port is a QGraphicsItem that represents an input or output connection point on a graphical component. It connects to its parent component via a visible line and provides collision detection for wire connections.
Definition at line 55 of file graphicalComponent.hpp.
| Port | ( | unsigned int | index, |
| QPoint | position, | ||
| QString | name, | ||
| bool | printName = false, | ||
| QGraphicsItem * | parent = nullptr ) |
Constructs a port.
| index | The port index |
| position | Position relative to component |
| name | The port/bus name |
| printName | Whether to print the port name on the component |
| parent | Optional parent graphics item |
Definition at line 584 of file graphicalComponent.cpp.
|
override |
Gets visual bounds, including port labels and stroked markers.
Definition at line 637 of file graphicalComponent.cpp.
|
nodiscard |
Gets the collision rectangle for wire detection.
Definition at line 796 of file graphicalComponent.cpp.
|
nodiscardprivate |
Definition at line 594 of file graphicalComponent.cpp.
|
inline |
Gets the port line direction.
Definition at line 119 of file graphicalComponent.hpp.
|
inline |
Gets the port index.
Definition at line 107 of file graphicalComponent.hpp.
|
inlinenodiscard |
Gets the port name.
Definition at line 113 of file graphicalComponent.hpp.
|
inline |
Gets the port position.
Definition at line 110 of file graphicalComponent.hpp.
|
inline |
Gets the port bus size.
Definition at line 116 of file graphicalComponent.hpp.
|
nodiscardprivate |
Definition at line 600 of file graphicalComponent.cpp.
|
override |
Paints port names, bus markers, and input assignment errors.
Definition at line 715 of file graphicalComponent.cpp.
|
private |
Definition at line 629 of file graphicalComponent.cpp.
| void setInputAssignmentError | ( | bool | failed | ) |
Marks whether this port failed input assignment during simulation setup.
Definition at line 704 of file graphicalComponent.cpp.
| void setLine | ( | QGraphicsLineItem * | line | ) |
Sets the connecting line.
| line | The line item |
Definition at line 677 of file graphicalComponent.cpp.
| void setSize | ( | unsigned int | newSize | ) |
Sets the port bus size.
Definition at line 691 of file graphicalComponent.cpp.
|
friend |
Definition at line 56 of file graphicalComponent.hpp.
|
private |
Port index in the port list.
Definition at line 60 of file graphicalComponent.hpp.
|
private |
Whether the net associated with this port has an error.
Definition at line 81 of file graphicalComponent.hpp.
|
private |
Visual line connecting to component.
Definition at line 66 of file graphicalComponent.hpp.
|
private |
Port name.
Definition at line 69 of file graphicalComponent.hpp.
|
private |
Position relative to component center.
Definition at line 63 of file graphicalComponent.hpp.
|
private |
Whether to write the port name on the component.
Definition at line 78 of file graphicalComponent.hpp.
|
private |
Direction of the connecting line from port to component.
Definition at line 75 of file graphicalComponent.hpp.
|
private |
Number of wires represented by this port.
Definition at line 72 of file graphicalComponent.hpp.