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

Private GIT Repository
finished testbench generation
[blast.git] / InterfaceItem.cpp
index 1ef3aae76b5c3de65eeb940cb3dc78c958da847e..7ee68c628f967731aafc5b4e5f27f961ba89a908 100644 (file)
@@ -4,6 +4,7 @@
 #include "GroupInterface.h"
 #include "FunctionalInterface.h"
 #include "BoxItem.h"
+#include "ReferenceInterface.h"
 
 int InterfaceItem::counter = 0;
 
@@ -45,6 +46,15 @@ QString InterfaceItem::getName() {
   return refInter->getName();
 }
 
+QString InterfaceItem::getReferenceName() {
+  if (!refInter->isFunctionalInterface()) {
+    return "no_refname_for_groupiface";
+  }
+  FunctionalInterface* iface = AI_TO_FUN(refInter);
+  ReferenceInterface* refIface = iface->getReference();
+  return refIface->getName();
+}
+
 void InterfaceItem::updateName(QString name) {  
   QFontMetrics fmName(params->defaultIfaceFont);
   nameWidth = fmName.width(refInter->getName());
@@ -98,7 +108,7 @@ void InterfaceItem::paint(QPainter *painter) {
       if(owner->isBoxItem()) {
         painter->setPen(QPen(Qt::black,1));
       }
-      else if(owner->isSourceItem()) {
+      else if(owner->isStimuliItem()) {
         painter->setPen(QPen(Qt::darkCyan,1));
       }
     }
@@ -165,7 +175,7 @@ void InterfaceItem::paint(QPainter *painter) {
       if(owner->isGroupItem()){
         painter->drawText(-(w+params->arrowWidth+params->arrowLineLength),-h/2,w,h,Qt::AlignLeft | Qt::TextWordWrap, refInter->getName());
       }
-      else if((owner->isBoxItem()) || (owner->isSourceItem())){
+      else if((owner->isBoxItem()) || (owner->isStimuliItem())){
         painter->drawText(0,-h/2,w,h,Qt::AlignRight | Qt::TextWordWrap, refInter->getName());
       }
     }
@@ -174,7 +184,7 @@ void InterfaceItem::paint(QPainter *painter) {
       if(owner->isGroupItem()) {
         painter->drawText(params->arrowWidth+params->arrowLineLength,-h/2,w,h,Qt::AlignRight | Qt::TextWordWrap, refInter->getName());
       }
-      else if((owner->isBoxItem()) || (owner->isSourceItem())){     
+      else if((owner->isBoxItem()) || (owner->isStimuliItem())){     
         painter->drawText(-w,-h/2,w,h,Qt::AlignLeft | Qt::TextWordWrap, refInter->getName());
       }
     }