1 #include "ArithmeticEvaluator.h"
\r
2 #include "ConnectedInterface.h"
\r
3 #include "FunctionalBlock.h"
\r
4 #include "GroupBlock.h"
\r
7 ConnectedInterface::ConnectedInterface(AbstractBlock* _owner) : AbstractInterface(_owner) {
\r
8 connectedFrom = NULL;
\r
11 ConnectedInterface::ConnectedInterface(AbstractBlock* _owner, const QString& _name, const QString& _type, const QString& _width, int _direction, int _purpose, int _level) : AbstractInterface(_owner, _name, _type, _width, _direction, _purpose, _level) {
\r
12 connectedFrom = NULL;
\r
15 void ConnectedInterface::removeConnectedTo(ConnectedInterface *iface) {
\r
16 connectedTo.removeOne(iface);
\r
19 void ConnectedInterface::clearConnections() {
\r
20 connectedFrom = NULL;
\r
21 connectedTo.clear();
\r
24 void ConnectedInterface::clearConnectedTo() {
\r
25 connectedTo.clear();
\r
28 bool ConnectedInterface::connectTo(ConnectedInterface *iface) {
\r
30 if (canConnectTo(iface)) {
\r
31 connectedTo.append(iface);
\r
38 bool ConnectedInterface::connectFrom(ConnectedInterface *iface) {
\r
39 if (canConnectFrom(iface)) {
\r
40 connectedFrom = iface;
\r
46 /* getConnectionToParentGroup() :
\r
47 if an interface among connectedTo is an interface of the parent group
\r
50 ConnectedInterface* ConnectedInterface::getConnectionToParentGroup() {
\r
51 foreach(ConnectedInterface *iface, connectedTo) {
\r
52 if (owner->getParent() == iface->owner) {
\r
59 /* getConnectionFromParentGroup() :
\r
60 if connectedFrom is an interface of the parent group
\r
63 ConnectedInterface *ConnectedInterface::getConnectionFromParentGroup() {
\r
64 if ((connectedFrom != NULL) && (owner->getParent() == connectedFrom->owner)) {
\r
65 return connectedFrom;
\r