X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/cfe8322b50c9ef08ffbc3e52b0849bca4cd1d0bf..2019e5afdaf7fd0ad21607848710348bbc3be256:/Dispatcher.cpp?ds=sidebyside diff --git a/Dispatcher.cpp b/Dispatcher.cpp index 9035183..ee72743 100644 --- a/Dispatcher.cpp +++ b/Dispatcher.cpp @@ -94,26 +94,12 @@ bool Dispatcher::createConnection(InterfaceItem *iface1, InterfaceItem *iface2) // 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)) { @@ -122,6 +108,7 @@ bool Dispatcher::createConnection(InterfaceItem *iface1, InterfaceItem *iface2) unselectAllItems(); params->unsaveModif = true; + cout << "created a connection from " << qPrintable(ref1->getName()) << " to " << qPrintable(ref2->getName()) << endl; return true; } return false; @@ -351,6 +338,18 @@ void Dispatcher::renameInterface(InterfaceItem *item) { 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