+ else if (item->refInter->getDirection() == AbstractInterface::Output) {
+ msg = "Output pattern of iface ";
+ msg += item->refInter->getName();
+ msg += " owned by ";
+ msg += item->refInter->getOwner()->getName();
+ msg += " is:\n";
+ ConnectedInterface* iface = AI_TO_CON(item->refInter->getAssociatedIface());
+ if (iface->getOutputPattern() == NULL) return;
+ foreach(char c, *(iface->getOutputPattern())) {
+ msg += QString::number((int)c);
+ }
+ msg += "\n";
+ }
+ QMessageBox::information(NULL,"Interface pattern",msg,QMessageBox::Ok,QMessageBox::Ok);
+}
+
+void Dispatcher::showModifier(Context context, InterfaceItem *item) {
+ static QString fctName = "Dispatcher::showModifier()";
+#ifdef DEBUG_FCTNAME
+ cout << "call to " << qPrintable(fctName) << endl;
+#endif
+ /* NB: only called in Design context */
+ if (context != Design) {
+ cout << "Abnormal case: call to " << qPrintable(fctName) << " not in Design context" << endl;
+ return;
+ }
+
+ QString msg = "";
+ ConnectedInterface* assoIface = AI_TO_CON(item->refInter->getAssociatedIface());
+ AbstractInputModifier* mod = assoIface->getInputModifier();
+ if (mod->isDelay()) {
+ DelayInputModifier* delay = (DelayInputModifier *)mod;
+ msg = "Pattern of iface ";
+ msg += item->refInter->getName();
+ msg += " owned by ";
+ msg += item->refInter->getOwner()->getName();
+ msg += " is modified by a simple delay of ";
+ msg += QString::number(delay->getDelayLength());
+
+ }
+ QMessageBox::information(NULL,"Interface pattern",msg,QMessageBox::Ok,QMessageBox::Ok);
+}
+
+void Dispatcher::removeModifier(Context context, InterfaceItem *item) {
+ static QString fctName = "Dispatcher::removeModifier()";
+#ifdef DEBUG_FCTNAME
+ cout << "call to " << qPrintable(fctName) << endl;
+#endif
+ /* NB: only called in Design context */
+ if (context != Design) {
+ cout << "Abnormal case: call to " << qPrintable(fctName) << " not in Design context" << endl;
+ return;
+ }
+
+
+ ConnectedInterface* assoIface = AI_TO_CON(item->refInter->getAssociatedIface());
+ assoIface->clearInputModifier();
+}
+
+
+void Dispatcher::duplicateBoxItem(Context context, BoxItem *item){
+ static QString fctName = "Dispatcher::duplicateBoxItem()";
+#ifdef DEBUG_FCTNAME
+ cout << "call to " << qPrintable(fctName) << endl;
+#endif
+ /* NB: only called in Design context */
+ if (context != Design) {
+ cout << "Abnormal case: call to " << qPrintable(fctName) << " not in Design context" << endl;
+ return;
+ }
+
+
+ GroupScene *scene = item->getScene();
+ AbstractBlock* block = item->getRefBlock();
+ AbstractBlock *newBlock;
+
+ // only duplicate functional blocks
+ if(block->isFunctionalBlock()) {
+
+ // adding to the model
+ FunctionalBlock* funBlock = (FunctionalBlock*)block;
+ newBlock = params->getGraph()->duplicateFunctionalBlock(funBlock);
+ // adding to the view
+ scene->createBoxItem(newBlock);
+
+ params->unsaveModif = true;