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

Private GIT Repository
added source items
[blast.git] / FunctionalInterface.cpp
index cc9f7658c7ab083b8fe2bfbb87cea71012e6d2c5..d34cc8daac6490a18f7c4e1b070635502d00723f 100644 (file)
@@ -19,9 +19,8 @@ FunctionalInterface::FunctionalInterface(AbstractBlock* _owner, ReferenceInterfa
   name = reference->getName();\r
   width = reference->getWidth();\r
   direction = reference->getDirection();\r
-  purpose = reference->getPurpose();\r
-  level = reference->getLevel(); \r
-  connectedFrom = NULL;\r
+  purpose = reference->getPurpose();  \r
+  connectedFrom = NULL;  \r
 }\r
 \r
 bool FunctionalInterface::isFunctionalInterface() {\r
@@ -65,10 +64,10 @@ int FunctionalInterface::getInterfaceMultiplicity() {
     return -1;\r
   }\r
   else if ( reference->getMultiplicity() == -1) {\r
-    return ifaceCount+1;\r
+    return ifaceCount;\r
   }\r
-  else if ( reference->getMultiplicity() > ifaceCount) {\r
-    return ifaceCount+1;\r
+  else if ( ifaceCount < reference->getMultiplicity()) {\r
+    return ifaceCount;\r
   }\r
   return -1;\r
 }\r
@@ -79,10 +78,9 @@ AbstractInterface *FunctionalInterface::clone() {
   FunctionalInterface *inter = new FunctionalInterface(owner, reference);\r
   inter->setWidth(width);\r
   inter->setDirection(direction);\r
-  inter->setPurpose(purpose);\r
-  inter->setLevel(level);  \r
+  inter->setPurpose(purpose);  \r
   inter->connectFrom(NULL);\r
-  inter->setName(reference->getName()+"_"+QString::number(id));\r
+  inter->setName(reference->getName()+"_"+QString::number(id+1));\r
   return inter;\r
 }\r
 \r