- Timestamp:
- May 9, 2007, 7:52:36 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawAll.cpp
r20 r21 15 15 painter.begin(this); 16 16 painter.setPen(Qt::blue); 17 painter.drawRect(margeX,margeY,margeX+450,margeY+450); 17 painter.drawRect(MARGEX,MARGEY,MARGEX+450,MARGEY+450); 18 cpt_ports = 0; 18 19 19 20 for(QList<Port>::iterator it=port_east.begin(); it!=port_east.end(); ++it){ 20 21 portX = it->get_x(); 21 22 portY = it->get_y(); 22 drawPort(portX + margeX,portY + margeY ,EAST,it->getDirection()); 23 drawPort(portX + MARGEX,portY + MARGEY ,EAST,it->getDirection()); 24 cpt_ports++; 23 25 } 24 26 … … 26 28 portX = it->get_x() ; 27 29 portY = it->get_y() ; 28 drawPort(portX + margeX,portY + margeY, WEST, it->getDirection()); 30 drawPort(portX + MARGEX,portY + MARGEY, WEST, it->getDirection()); 31 cpt_ports++; 29 32 } 30 33 … … 32 35 portX = it->get_x() ; 33 36 portY = it->get_y() ; 34 drawPort(portX + margeX ,portY+margeY,NORTH,it->getDirection()); 37 drawPort(portX + MARGEX ,portY+MARGEY,NORTH,it->getDirection()); 38 cpt_ports++; 35 39 } 36 40 … … 38 42 portX = it->get_x() ; 39 43 portY = it->get_y() ; 40 drawPort(portX + margeX,portY+margeY,SOUTH,it->getDirection()); 44 drawPort(portX + MARGEX,portY+MARGEY,SOUTH,it->getDirection()); 45 cpt_ports++; 41 46 } 42 43 47 48 current = "Top Level"; 49 father = " "; 44 50 if(p.getArchitecture()!=NULL){ 45 51 compo = p.getComponent(); 46 52 for(QList<Component>::iterator it=compo->begin();it!=compo->end();++it){ 47 53 Coord *co = it->get_Position(); 48 posX = co->get_hg_x()+ margeX;49 posY = co->get_hg_y()+ margeY;54 posX = co->get_hg_x()+MARGEX; 55 posY = co->get_hg_y()+MARGEY; 50 56 tailleX = co->get_size_x(); 51 57 tailleY = co->get_size_y(); 52 58 painter.drawRect(posX,posY,tailleX,tailleY); 59 if (componentName){ 60 QString compo_name = QString::fromStdString(it->getName()); 61 painter.drawText(posX , posY + tailleY/2,compo_name); 62 } 53 63 Coord *co2=new Coord( co->get_hg_x() + tailleX/2, co->get_hg_y() + tailleY/2,tailleX/2,tailleY/2); 64 54 65 QList<Port> ports2=(it->getPortEast(co2)); 55 66 for (QList<Port>::iterator it2=ports2.begin();it2!=ports2.end();++it2) … … 58 69 portX =it2->get_x(); 59 70 portY =it2->get_y(); 60 drawPort(portX + margeX,portY+margeY , EAST,it2->getDirection());71 drawPort(portX + MARGEX,portY+MARGEY , EAST,it2->getDirection()); 61 72 } 62 73 ports2=(it->getPortWest(co)); … … 66 77 portX =it2->get_x(); 67 78 portY =it2->get_y(); 68 drawPort(portX + margeX ,portY+margeY ,WEST,it2->getDirection());79 drawPort(portX + MARGEX ,portY+MARGEY ,WEST,it2->getDirection()); 69 80 } 70 81 ports2=(it->getPortNorth(co)); … … 74 85 portX =it2->get_x(); 75 86 portY =it2->get_y(); 76 drawPort(portX + margeX ,portY+margeY,NORTH,it2->getDirection());87 drawPort(portX + MARGEX ,portY+MARGEY,NORTH,it2->getDirection()); 77 88 78 89 } … … 83 94 portX =it2->get_x(); 84 95 portY =it2->get_y(); 85 drawPort(portX + margeX ,portY+margeY,SOUTH,it2->getDirection());96 drawPort(portX + MARGEX ,portY+MARGEY,SOUTH,it2->getDirection()); 86 97 87 98 } 88 99 painter.setPen(Qt::red); 89 100 QList<PortMap> *pm=it->getPortMap(); 90 //init_grid();101 91 102 for (QList<PortMap>::iterator it3=pm->begin();it3!=pm->end();++it3) 92 103 { 93 104 Signal *s=base->getSignal(it->getType(),new PortMap(*it3)); 94 painter.drawLine(s->get_src_x()+margeX,s->get_src_y()+margeY,s->get_dest_x()+margeX,s->get_dest_y()+margeY); 95 //p1 = new Point(s->get_src_x()+2*margeX,s->get_src_y()+2*margeY,NULL,FREE,0); 96 //p2 = new Point(s->get_dest_x()+margeX,s->get_dest_y()+margeY,NULL,FREE,0); 97 // grid[p1->getX()][p1->getY()] = p1; 98 //grid[p2->getX()][p2->getY()] = p2; 99 100 101 //drawSignal(p1,p2); 102 //p1 = NULL;p2 = NULL; 105 painter.drawLine(s->get_src_x()+MARGEX,s->get_src_y()+MARGEY,s->get_dest_x()+MARGEX,s->get_dest_y()+MARGEY); 106 107 if(signalName){ 108 QString signal_name = QString::fromStdString(it3->getName()); 109 if(s->get_src_x() > s->get_dest_x()) 110 painter.drawText(s->get_dest_x() + MARGEX - 40 ,s->get_dest_y() + MARGEY-10, signal_name); 111 if(s->get_src_x() < s->get_dest_x()) 112 painter.drawText(s->get_dest_x() + MARGEX - 40 ,s->get_dest_y() + MARGEY-10, signal_name); 113 } 114 103 115 } 116 if(charg_open){ 117 charg_open = false; 118 mess_charg->close(); 119 } 104 120 painter.setPen(Qt::blue); 105 121 } 106 122 } 107 123 painter.end(); 108 109 110 124 } 125 if(mess_open){ 126 mess_open = false; 127 mess->close(); 128 } 111 129 } 112 130 -
trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_informations_window.cpp
r20 r21 10 10 { 11 11 winfo = new QWidget(); 12 QBoxLayout *informations = new QBoxLayout(QBoxLayout::LeftToRight,0); 13 winfo->resize(200,450); 12 informations = new QBoxLayout(QBoxLayout::TopToBottom,0); 14 13 winfo->setWindowTitle("informations"); 15 winfo->setFixedSize(2 00,620);16 winfo->move(6 08,0);14 winfo->setFixedSize(250,292); 15 winfo->move(678,50); 17 16 winfo->setLayout(informations); 18 17 winfo->show(); 19 18 } 20 19 21 -
trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main_window.cpp
r20 r21 12 12 is_parse = false; 13 13 window_height = 620; 14 window_width = 6 00;15 margeX = 50;16 m argeY = 70;17 14 window_width = 620; 15 charg_open = false; 16 mess_open = false; 17 18 18 /*menu bar*/ 19 19 QMenuBar *menu_bar = new QMenuBar(this); … … 78 78 connect(paramAct,SIGNAL(triggered()),this,SLOT(_parameters())); 79 79 80 81 QAction *compoNameAct; 82 compoNameAct = new QAction(tr("&components name"),this); 83 connect(compoNameAct,SIGNAL(triggered()),this,SLOT(_component_name())); 84 85 QAction *signalNameAct; 86 signalNameAct = new QAction(tr("&signals name"),this); 87 connect(signalNameAct,SIGNAL(triggered()),this,SLOT(_signal_name())); 88 80 89 /*add the menu "tools" to the menu bar*/ 81 90 tools = menu_bar->addMenu(tr("&Tools")); 82 tools->addAction(zoomInAct); 83 tools->addAction(zoomOutAct); 84 tools->addAction(defautZoomAct); 85 tools->addAction(levelAct); 91 //tools->addAction(zoomInAct); 92 //tools->addAction(zoomOutAct); 93 //tools->addAction(defautZoomAct); 94 tools->addAction(compoNameAct); 95 tools->addAction(signalNameAct); 96 //tools->addAction(levelAct); 86 97 tools->addAction(infoAct); 87 98 tools->addAction(paramAct); … … 96 107 help->addAction(aboutAct); 97 108 98 99 109 /*add the menu bar to the main window*/ 100 110 this->setMenuWidget(menu_bar); … … 108 118 109 119 /*defaut position*/ 110 this->move( 0,0);120 this->move(50,50); 111 121 112 122 /*main window title*/ … … 130 140 wa_open = false; 131 141 142 signalName = true; 143 componentName = true; 144 132 145 /*file unsaved at init*/ 133 146 save_as = false; -
trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_parameters_window.cpp
r20 r21 10 10 { 11 11 wparam = new QWidget(); 12 QBoxLayout *parameters = new QBoxLayout(QBoxLayout::LeftToRight,0); 13 wparam->resize(200,450); 12 parameters = new QBoxLayout(QBoxLayout::TopToBottom,0); 14 13 wparam->setWindowTitle("parameters"); 15 wparam->setFixedSize(200,620); 16 wparam->move(816,0); 14 wparam->setFixedSize(250,300); 15 wparam->move(678,370); 16 17 lname = new QLabel(wparam); 18 lname->setText(""); 19 20 QBoxLayout *bpos = new QBoxLayout(QBoxLayout::LeftToRight,0); 21 QLabel *lx = new QLabel(); 22 lx->setText("position x : "); 23 positionX = new QLineEdit(); 24 positionX->setText(""); 25 bpos->addWidget(lx); 26 bpos->addWidget(positionX); 27 28 QBoxLayout *bpos2 = new QBoxLayout(QBoxLayout::LeftToRight,0); 29 QLabel *ly = new QLabel(); 30 ly->setText("position y : "); 31 positionY = new QLineEdit(); 32 positionY->setText(""); 33 bpos2->addWidget(ly); 34 bpos2->addWidget(positionY); 35 36 QBoxLayout *bsize = new QBoxLayout(QBoxLayout::LeftToRight,0); 37 QLabel *sx = new QLabel(); 38 sx->setText("size x : "); 39 sizeX = new QLineEdit(); 40 sizeX->setText(""); 41 bsize->addWidget(sx); 42 bsize->addWidget(sizeX); 43 44 QBoxLayout *bsize2 = new QBoxLayout(QBoxLayout::LeftToRight,0); 45 QLabel *sy = new QLabel(); 46 sy->setText("size y : "); 47 sizeY = new QLineEdit(); 48 sizeY->setText(""); 49 bsize2->addWidget(sy); 50 bsize2->addWidget(sizeY); 51 52 QBoxLayout *bport = new QBoxLayout(QBoxLayout::LeftToRight,0); 53 QLabel *lport = new QLabel(); 54 lport->setText("nb ports : "); 55 nb_ports = new QLineEdit(); 56 nb_ports->setText(""); 57 bport->addWidget(lport); 58 bport->addWidget(nb_ports); 59 60 parameters->addWidget(lname); 61 parameters->addLayout(bpos); 62 parameters->addLayout(bpos2); 63 parameters->addLayout(bsize); 64 parameters->addLayout(bsize2); 65 parameters->addLayout(bport); 66 QPushButton *back = new QPushButton("back",wparam); 67 QPushButton *apply = new QPushButton("apply",wparam); 68 connect(back,SIGNAL(clicked()),this,SLOT(_back())); 69 parameters->addWidget(back); 70 parameters->addWidget(apply); 71 17 72 wparam->setLayout(parameters); 18 73 wparam->show(); 19 74 } 20 75 76 void Window::write_name(string name){ 77 QString n = QString::fromStdString(name); 78 lname->setText(n); 79 80 } 81 82 void Window::write_position(int x, int y){ 83 stringstream out; 84 string str; 85 out << x; 86 str = out.str(); 87 positionX->setText( QString::fromStdString(str)); 88 stringstream out2; 89 string str2; 90 out2 << y; 91 str2 = out2.str(); 92 positionY->setText(QString::fromStdString(str2)); 93 94 } 95 96 void Window::write_size(int x,int y){ 97 stringstream out; 98 string str; 99 out << x; 100 str = out.str(); 101 sizeX->setText(QString::fromStdString(str)); 102 stringstream out2; 103 string str2; 104 out2 << y; 105 str2 = out2.str(); 106 sizeY->setText(QString::fromStdString(str2)); 107 } 108 109 void Window::write_ports(int x){ 110 stringstream out; 111 string str; 112 out << x; 113 str = out.str(); 114 nb_ports->setText(QString::fromStdString(str)); 115 wparam->show(); 116 } 21 117 22 118 -
trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_setParse.cpp
r20 r21 11 11 if(p) 12 12 parse=p; 13 else 14 cout<<"eee"; 13 15 14 }
Note: See TracChangeset
for help on using the changeset viewer.