+void Dispatcher::showPatterns(InterfaceItem *item) {
+ static QString fctName = "Dispatcher::showPatterns()";
+#ifdef DEBUG_FCTNAME
+ cout << "call to " << qPrintable(fctName) << endl;
+#endif
+ QString msg = "";
+ if (item->refInter->getDirection() == AbstractInterface::Input) {
+ msg = "Input pattern of iface ";
+ msg += item->refInter->getName();
+ msg += " owned by ";
+ msg += item->refInter->getOwner()->getName();
+ msg += " is:\n";
+ // get the precursor output pattern
+ ConnectedInterface* connIface = AI_TO_CON(item->refInter->getAssociatedIface());
+ QList<char>* out = connIface->getConnectedFrom()->getOutputPattern();
+ // get the modifier
+ AbstractInputModifier* modifier = connIface->getInputModifier();
+ // check if the input is modified
+ if (modifier != NULL) {
+
+ out = modifier->getModifiedInput(out);
+ }
+
+ foreach(char c, *out) {
+ msg += QString::number((int)c);
+ }
+ msg += "\n";
+ }
+ 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(InterfaceItem *item) {
+ static QString fctName = "Dispatcher::showModifier()";
+#ifdef DEBUG_FCTNAME
+ cout << "call to " << qPrintable(fctName) << endl;
+#endif
+ 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(InterfaceItem *item) {
+ static QString fctName = "Dispatcher::showModifier()";
+#ifdef DEBUG_FCTNAME
+ cout << "call to " << qPrintable(fctName) << endl;
+#endif
+
+ ConnectedInterface* assoIface = AI_TO_CON(item->refInter->getAssociatedIface());
+ assoIface->clearInputModifier();
+}
+
+