Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
start to include clkdomain converters
[blast.git] / SourceItem.cpp
index 52cf8875798085325f8c4c69eddec5381c4e3c92..89413b0de8c01a08cd15c273afd239d4a7d9bba7 100644 (file)
@@ -496,12 +496,14 @@ void SourceItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
   QAction* renameAction = NULL;
   QAction* showProperties = NULL;
   QAction* showParameters = NULL;
-
+  QAction* showPatterns = NULL;
 
   InterfaceItem* ifaceItem = getInterfaceItemFromCursor(event->pos().x(), event->pos().y());
   // menu for interface
   if( ifaceItem != NULL){
 
+    ConnectedInterface* iface = ifaceItem->refInter;
+
     titleAction = menu.addAction("Interface operations");
     titleAction->setEnabled(false);
     menu.addSeparator();
@@ -510,6 +512,11 @@ void SourceItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
     showProperties = menu.addAction("Show properties");
     renameAction = menu.addAction("Rename");
 
+    if (iface->getAssociatedIface() != NULL) {
+      if (iface->getDirection() == AbstractInterface::Output) {
+        showPatterns = menu.addAction("Show output pattern");
+      }
+    }
   }
   // menu for block
   else {
@@ -551,6 +558,9 @@ void SourceItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
   else if(selectedAction == showParameters){
     new ParametersWindow(refBlock, params, NULL);
   }      
+  else if(selectedAction == showPatterns) {
+    dispatcher->showPatterns(ifaceItem);
+  }
 }
 
 void SourceItem::load(QDomElement funcElement) throw(Exception) {