// test the ref1->ref2 connection
if ((ref1->canConnectTo(ref2)) && (ref2->canConnectFrom(ref1))) {
- ref1->connectTo(ref2);
- /*
- ref2->connectFrom(ref1);
- if ((asso1 != NULL) && (asso2 != NULL)) {
- asso1->connectTo(asso2);
- asso2->connectFrom(asso1);
- }
- */
+ ref1->connectTo(ref2);
ok1 = true;
}
// if the frist one did not work, test ref2->ref1
if ((ok1 == false) && (ref2->canConnectTo(ref1)) && (ref1->canConnectFrom(ref2))) {
- ref2->connectTo(ref1);
- /*
- ref1->connectFrom(ref2);
- if ((asso1 != NULL) && (asso2 != NULL)) {
- asso1->connectFrom(asso2);
- asso2->connectTo(asso1);
- }
- */
+ ref2->connectTo(ref1);
ok2 = true;
}
if ((ok1 == true) || (ok2 == true)) {
unselectAllItems();
params->unsaveModif = true;
+ cout << "created a connection from " << qPrintable(ref1->getName()) << " to " << qPrintable(ref2->getName()) << endl;
return true;
}
return false;
item->getOwner()->nameChanged();
}
+void Dispatcher::showPatterns(InterfaceItem *item) {
+ static QString fctName = "Dispatcher::showPatterns()";
+#ifdef DEBUG_FCTNAME
+ cout << "call to " << qPrintable(fctName) << endl;
+#endif
+ ConnectedInterface* iface = AI_TO_CON(item->refInter->getAssociatedIface());
+ foreach(char c, *(iface->getOutputPattern())) {
+ cout << (int)c;
+ }
+ cout << endl;
+}
+
void Dispatcher::duplicateBoxItem(BoxItem *item){
static QString fctName = "Dispatcher::duplicateBoxItem()";
#ifdef DEBUG_FCTNAME