if (connIface->getConnectedFrom() != NULL) return false;
if (this->getOwner() == iface->getOwner()->getParent()) {
- if ((direction == Input) && (iface->getDirection() == Input)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Input) && (iface->getDirection() == Input) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
else if (this->getOwner()->getParent() == iface->getOwner()->getParent()) {
- if ((direction == Output) && (iface->getDirection() == Input)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Output) && (iface->getDirection() == Input) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
else if (this->getOwner()->getParent() == iface->getOwner()) {
- if ((direction == Output) && (iface->getDirection() == Output)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Output) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
if (getConnectedFrom() != NULL) return false;
if (this->getOwner() == iface->getOwner()->getParent()) {
- if ((direction == Output) && (iface->getDirection() == Output)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Output) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
else if (this->getOwner()->getParent() == iface->getOwner()->getParent()) {
- if ((direction == Input) && (iface->getDirection() == Output)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Input) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
else if (this->getOwner()->getParent() == iface->getOwner()) {
- if ((direction == Input) && (iface->getDirection() == Input)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Input) && (iface->getDirection() == Input) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
- else if ((getOwner()->isTopGroupBlock()) && (iface->getOwner()->isSourceBlock())) {
- if ((direction == Input) && (iface->getDirection() == Output)) return true;
+ else if ((getOwner()->isTopGroupBlock()) && (iface->getOwner()->isStimuliBlock())) {
+ if ((direction == Input) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;
}
return false;