]> AND Private Git Repository - blast.git/blobdiff - GroupInterface.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
after merge
[blast.git] / GroupInterface.cpp
index b59eb23c38d62aa1aa35f4fa32c46d9f5317ef00..e87c14ab4541eea789c6f74f291c2d2a35140c37 100644 (file)
@@ -2,7 +2,7 @@
 #include "FunctionalInterface.h"
 #include "GroupBlock.h"
 
 #include "FunctionalInterface.h"
 #include "GroupBlock.h"
 
-GroupInterface::GroupInterface(AbstractBlock* _owner, const QString& _name, int _direction, int _purpose) throw(Exception) : ConnectedInterface(_owner,_name,"expression","",_direction,_purpose) {
+GroupInterface::GroupInterface(AbstractBlock* _owner, const QString& _name, int _direction, int _purpose) throw(Exception) : ConnectedInterface(_owner,_name,_direction,_purpose,"inherited","") {
   if (! _owner->isGroupBlock()) throw(Exception(BLOCK_INVALID_TYPE));
 
   connectedFrom = NULL;
   if (! _owner->isGroupBlock()) throw(Exception(BLOCK_INVALID_TYPE));
 
   connectedFrom = NULL;
@@ -14,9 +14,7 @@ bool GroupInterface::isGroupInterface() {
 
 AbstractInterface *GroupInterface::clone() {
     GroupInterface *inter = new GroupInterface(owner,name,direction, purpose);
 
 AbstractInterface *GroupInterface::clone() {
     GroupInterface *inter = new GroupInterface(owner,name,direction, purpose);
-    inter->setWidth(width);    
-    inter->connectFrom(NULL);
-
+    inter->setWidth(width);        
     return inter;
 }
 
     return inter;
 }
 
@@ -43,7 +41,8 @@ bool GroupInterface::canConnectTo(AbstractInterface *iface) {
 
   */
   if (iface->isReferenceInterface()) return false;
 
   */
   if (iface->isReferenceInterface()) return false;
-  if (iface->getConnectedFrom() != NULL) return false;
+  ConnectedInterface* connIface = AI_TO_CON(iface);
+  if (connIface->getConnectedFrom() != NULL) return false;
 
   if (this->getOwner() == iface->getOwner()->getParent()) {
     if ((direction == Input) && (iface->getDirection() == Input)) return true;
 
   if (this->getOwner() == iface->getOwner()->getParent()) {
     if ((direction == Input) && (iface->getDirection() == Input)) return true;