 /*
 *
 * [desc.]
 */
#include "Tools/Viewer/Bdd/include/BaseV.h"

namespace morpheo{
namespace tools{
namespace viewer{
namespace bdd{  

  morpheo::tools::viewer::bdd::Signal *BaseV::getSignal(string c,morpheo::tools::viewer::bdd::PortMap *dest)
  {
    int srcX,srcY,destX,destY;
    Architecture *aa=((pos->operator[](0)).getArchitecture());
    morpheo::tools::viewer::bdd::Component x=aa->getComponent(c);
    // cout << dest->getName() <<endl;  
    morpheo::tools::viewer::bdd::Port *p= x.searchPort(dest->getName());
    srcX=p->get_x();
    srcY=p->get_y();
    // cout << dest->getComponent() <<endl;  
    morpheo::tools::viewer::bdd::BaseP res=get_BasePos(dest->getComponent());
    morpheo::tools::viewer::bdd::Port *pm=(res.getEntity())->searchPort(dest->getPort());
    destX=pm->get_x();
    destY=pm->get_y();
    
    morpheo::tools::viewer::bdd::Signal *s=new Signal(srcX,srcY,destX,destY);
    return s;
  }


};//end bdd
};//end viewer
};//end tools
};//end morpheo
