Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/include/BaseV.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/include/BaseV.h	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/include/BaseV.h	(revision 26)
@@ -28,5 +28,5 @@
       //accesseurs
       morpheo::tools::viewer::bdd::BaseP  get_BasePos(string v);
-      morpheo::tools::viewer::bdd::Signal *getSignal(string c,PortMap *dest);
+      morpheo::tools::viewer::bdd::Signal *getSignal(morpheo::tools::viewer::bdd::BaseP *top,string c,PortMap *dest);
       QList<morpheo::tools::viewer::bdd::BaseP>  *getBaseP();
       //morpheo::tools::viewer::bdd::Param get_Param(string v);
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/include/Entity.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/include/Entity.h	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/include/Entity.h	(revision 26)
@@ -27,8 +27,9 @@
       
     public:
-      Entity(string n,int l);
+      Entity(string n,string t,int l);
       ~Entity();
       string getComment();
       string getName();
+      string getType();
       void setComment(string s);
       int getSchema();
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseP_accessors.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseP_accessors.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseP_accessors.cpp	(revision 26)
@@ -13,4 +13,8 @@
     comment=s;
   }
+  void BaseP::setLevel(int s){
+    level=s;
+  }
+ 
   void BaseP::setArchitecture(Architecture *a)
   {
@@ -35,4 +39,8 @@
     return comment;
   }
+  int BaseP::getLevel()
+  {
+    return level;
+  }
 
     QList<morpheo::tools::viewer::bdd::Component> *BaseP::getComponent()
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_accessors.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_accessors.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_accessors.cpp	(revision 26)
@@ -10,5 +10,5 @@
 namespace bdd{     
 
- void BaseV::setComment(string s){
+  void BaseV::setComment(string s){
     comment=s;
   }
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_afficheBaseConsole.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_afficheBaseConsole.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_afficheBaseConsole.cpp	(revision 26)
@@ -1,3 +1,3 @@
- /*
+/*
  *
  * [desc.]
@@ -13,4 +13,5 @@
         = pos->begin(); it != pos->end(); ++it)
     {
+     
       morpheo::tools::viewer::bdd::Entity *test=(it->getEntity());
       string n2=test->getName();
@@ -18,5 +19,5 @@
       cout << n << endl ;
       cout << "----Entity-----------------------------------------" <<endl;
-      cout << "Entity name:"<< n2<< endl;
+      cout << "Entity name:"<< n2 <<" level:"<< it->getLevel()<< endl;
       cout << "------------------ports east-----------------------" <<endl;
       
@@ -100,12 +101,14 @@
 	   cout << "port :" << it3->getPort() <<endl;
 	   cout << "comment :" << it3->getComment() <<endl;
-	  
-	  
+
+	   
 	   
 	     }
 	 }
       }//if
+      cout << endl<< "************    fin BASEP  *******************"<<endl <<endl;
+	
     }//for
-    
+      
   }
   
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_getSignal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_getSignal.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_getSignal.cpp	(revision 26)
@@ -9,9 +9,14 @@
 namespace viewer{
 namespace bdd{  
-
-  morpheo::tools::viewer::bdd::Signal *BaseV::getSignal(string c,morpheo::tools::viewer::bdd::PortMap *dest)
+  /*
+   * search and find the signal 
+   * top : actual component is viewed on screen
+   * c: the component (source) which is connected to the dest
+   * dest : the port destination informations
+   */
+  morpheo::tools::viewer::bdd::Signal *BaseV::getSignal(BaseP *top,string c,morpheo::tools::viewer::bdd::PortMap *dest)
   {
     int srcX,srcY,destX,destY;
-    Architecture *aa=((pos->operator[](0)).getArchitecture());
+    Architecture *aa=top->getArchitecture();
     morpheo::tools::viewer::bdd::Component x=aa->getComponent(c);
     // cout << dest->getName() <<endl;  
@@ -19,5 +24,5 @@
     srcX=p->get_x();
     srcY=p->get_y();
-    // cout << dest->getComponent() <<endl;  
+    //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());
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_searchComponent.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_searchComponent.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/BaseV_searchComponent.cpp	(revision 26)
@@ -1,2 +1,3 @@
+
  /*
  *
@@ -11,5 +12,9 @@
 
   morpheo::tools::viewer::bdd::BaseP BaseV::get_BasePos(string v){ 
-    return pos->operator[](listcomp->indexOf(v,0));
+    int tmp=listcomp->indexOf(v,0);
+    if(tmp==-1)
+      return NULL;
+    else
+      return pos->operator[](tmp);
   }
 
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Component_accessors.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Component_accessors.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Component_accessors.cpp	(revision 26)
@@ -16,5 +16,5 @@
   string Component::getComment(){ return comment;}
   string Component::getName(){ return name;}
-    string Component::getType(){ return type;}
+  string Component::getType(){ return type;}
   int Component::get_x(){return pos_x+size_x;}
   int Component::get_y(){return pos_y+size_y;}
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Entity_accessors.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Entity_accessors.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Entity_accessors.cpp	(revision 26)
@@ -18,4 +18,5 @@
   
   string Entity::getName(){ return name;}
+  string Entity::getType(){ return type;}
   
   int Entity::getSchema(){return schema;}
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Entity_alloc.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Entity_alloc.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Bdd/src/Entity_alloc.cpp	(revision 26)
@@ -11,10 +11,10 @@
 
 
-  Entity::Entity(string n,int l)
+  Entity::Entity(string n,string t,int l)
     :ListePorts()
   {
     name=n;
     schema=l;
-
+    type=t;
   }
  
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/include/window.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/include/window.h	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/include/window.h	(revision 26)
@@ -97,9 +97,11 @@
   void _signal_name(); //show or hide the signals name
 
-  void _back();
+  void _back();//return to the previous view
+  void _cancel_selection();
+  void _apply();
 
  protected :
-  void mousePressEvent (QMouseEvent *); //mouse handler
- 
+  void mousePressEvent (QMouseEvent *); //mouse handler when mouse pressed
+  void mouseMoveEvent (QMouseEvent *); //mouse handler in other case
  private :
   void wparameters(); // parameters window builder
@@ -111,5 +113,7 @@
   void write_position(int x, int y);//write the position of the position clicked in the informations window
   void write_size(int x, int y);//write the size of the component clicked in the informations window
-  void write_ports(int x);//write the number of the component clicked in the informations window
+  void write_comment(string comment);
+  void erase_position();
+  void erase_size();
 
   QList <Port> port_east; //ports lists
@@ -144,14 +148,14 @@
   QString current_name; //name of the current file opened
 
-  /*items of the informations window*/
-  QLabel *lname; //name of the component clicked
+  /*items of the parameters window*/
   QLineEdit *positionX; //x position
   QLineEdit *positionY;//y position
   QLineEdit *sizeX;//x size
   QLineEdit *sizeY;//y size
-  QLineEdit *nb_ports;
-
-  int cpt_ports;//nb ports of component clicked
-
+  
+  /*items of the informations window*/
+  QLabel *lname;//name of the component clicked
+  QLineEdit *comment;//comment associated with the component clicked
+  int level; //level of architecture
   int mouseX; //mouse position
   int mouseY;
@@ -167,4 +171,7 @@
   int tailleX;
   int tailleY;
+
+  int cpt_level;
+  QString tab[50];
 
   QString father;//father name
@@ -188,4 +195,6 @@
   bool charg_open;//back chargement message box opened or not
   bool mess_open;//chargment message box opened or not
+  bool component_clicked;//if user clicked on a component to modify its parameters
+
 
 };
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawAll.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawAll.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawAll.cpp	(revision 26)
@@ -12,9 +12,8 @@
     
   if(paint){
-
     painter.begin(this);
     painter.setPen(Qt::blue);
     painter.drawRect(MARGEX,MARGEY,MARGEX+450,MARGEY+450);
-    cpt_ports = 0;
+
     
     for(QList<Port>::iterator it=port_east.begin(); it!=port_east.end(); ++it){
@@ -22,5 +21,5 @@
       portY = it->get_y();
       drawPort(portX + MARGEX,portY + MARGEY ,EAST,it->getDirection());
-      cpt_ports++;
+
     } 
     
@@ -29,5 +28,5 @@
       portY = it->get_y() ;
       drawPort(portX + MARGEX,portY + MARGEY, WEST, it->getDirection());
-      cpt_ports++;
+
     }
 
@@ -36,5 +35,5 @@
       portY = it->get_y() ;
       drawPort(portX + MARGEX ,portY+MARGEY,NORTH,it->getDirection());
-      cpt_ports++;
+
     }
 
@@ -43,9 +42,7 @@
       portY = it->get_y() ;
       drawPort(portX + MARGEX,portY+MARGEY,SOUTH,it->getDirection());
-      cpt_ports++;
+
     }
     
-    current = "Top Level";
-    father = " ";
     if(p.getArchitecture()!=NULL){
       compo = p.getComponent();
@@ -102,5 +99,5 @@
 	for (QList<PortMap>::iterator it3=pm->begin();it3!=pm->end();++it3) 
 	  {
-	    Signal *s=base->getSignal(it->getType(),new PortMap(*it3));
+	    Signal *s=base->getSignal(&p,it->getName(),new PortMap(*it3));
 	    painter.drawLine(s->get_src_x()+MARGEX,s->get_src_y()+MARGEY,s->get_dest_x()+MARGEX,s->get_dest_y()+MARGEY);
 
@@ -114,5 +111,5 @@
 
 	  }
-        if(charg_open){
+	if(charg_open){
 	  charg_open = false;
 	  mess_charg->close();
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_file_actions.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_file_actions.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_file_actions.cpp	(revision 26)
@@ -26,5 +26,4 @@
     tree->setRootIndex(dir->index("./data/"));
     file_name = new QLineEdit(wo);
-    file_name->setText("data/");
     QPushButton *ok_open = new QPushButton("ok",wo);
     connect(ok_open,SIGNAL(clicked()),this,SLOT(_open_end()));
@@ -67,5 +66,5 @@
     is_parse=true;
   }
-  if(parse->open_file( current_name.toStdString())==-1)
+  if(parse->open_file( current_name.toStdString(),0)==-1)
     _open_error();
   else{
@@ -79,9 +78,15 @@
   is_save = true;
   base = parse->getBaseV();//parse the base and open the file
-  //base->afficheBaseConsole();
+  #ifdef DEBUG_ALL
+  base->afficheBaseConsole();
+  #endif
+  cpt_level = 0;
+  
+  tab[cpt_level] = "";
   file_open = true;
   QList <BaseP> *liste_compo = base->getBaseP();
   p = liste_compo->at(0);
   entity = p.getEntity();
+  current = QString::fromStdString(entity->getName());
   c = new Coord(250,250,250,250);
   port_east = entity->getPortEast(c);
@@ -91,4 +96,5 @@
   paint = true;
   repaint();
+  setMouseTracking(true);
 }
 
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_informations_window.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_informations_window.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_informations_window.cpp	(revision 26)
@@ -12,8 +12,23 @@
   informations = new QBoxLayout(QBoxLayout::TopToBottom,0);
   winfo->setWindowTitle("informations");
-  winfo->setFixedSize(250,292);
-  winfo->move(678,50);
+  winfo->setFixedSize(350,292);
+  winfo->move(628,50);
+  lname = new QLabel();
+  lname->setText("");
+  comment = new QLineEdit();
+  comment->setText("");
+  informations->addWidget(lname);
+  informations->addWidget(comment);
   winfo->setLayout(informations);
   winfo->show();
 }
 
+void Window::write_comment(string cm){
+  QString c = QString::fromStdString(cm);
+  comment->setText(c);
+}
+
+void Window::write_name(string name){
+  QString n = QString::fromStdString(name);
+  lname->setText(n);
+}
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main.cpp	(revision 26)
@@ -18,14 +18,15 @@
   if(argc>2){
     cout << "error : argument must be a file name or nothing" << endl;
+    cout << "usage : Viewer [file]" << endl;
     return 0;
   }
 
   Parse *par = new Parse();
-
+  
   
    QApplication *a=new QApplication (argc,argv);  
    
-   if(argc == 2){
-     if(par->open_file(argv[1])==-1){
+  if(argc == 2){
+     if(par->open_file(argv[1],0)==-1){
 	cout << "file doesn't exist or is not a valid format" << endl;  
 	exit(1);
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main_window.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main_window.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main_window.cpp	(revision 26)
@@ -15,5 +15,7 @@
   charg_open = false;
   mess_open = false; 
- 
+  component_clicked = false;
+  cpt_level=0;
+  
   /*menu bar*/
   QMenuBar *menu_bar = new QMenuBar(this);
@@ -118,5 +120,5 @@
 
   /*defaut position*/
-  this->move(50,50);    
+  this->move(0,50);    
 
   /*main window title*/
@@ -140,6 +142,7 @@
   wa_open = false;
 
-  signalName = true;
-  componentName = true;
+  /*signals and components name hidden*/
+  signalName = false;
+  componentName = false;
 
   /*file unsaved at init*/
@@ -147,5 +150,4 @@
   first_save = false; //first_save = true for a new file
   
-
   current_name = name;
   if(current_name != NULL){
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_mouseEvent.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_mouseEvent.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_mouseEvent.cpp	(revision 26)
@@ -18,5 +18,9 @@
     mouseY = mouseEvent->y();
     
-    
+    bool bc = false;
+    int cx,cy,tx,ty;
+    string cc,nc;
+    bool found = false;
+
     for(QList<Component>::iterator it=compo->begin();it!=compo->end();++it){
       Coord *co = it->get_Position();
@@ -25,87 +29,240 @@
       int taillex = co->get_size_x();
       int tailley = co->get_size_y();
-      
+      QString t=QString::fromStdString(it->getType()).toLower();
       if(e->type() == QMouseEvent::MouseButtonDblClick && e->button() == Qt::LeftButton){
 	
 	if(mouseX >= px + MARGEX  && mouseY >= py +MARGEY && mouseX <= px+taillex + MARGEX  && mouseY <= py+tailley + MARGEY) {
 	  
+	  bc = false;
 	  paint = false;
 	  repaint();
-	   
-	  mess = new QWidget();
-      	  mess->setFixedSize(200,50);
-	  mess->move(200,50);
-	  QBoxLayout *b = new QBoxLayout(QBoxLayout::TopToBottom,0);
-   	  QLabel *l = new QLabel();
-	  l->setText("please wait while charging");
-	  b->addWidget(l);
- 	  mess->setLayout(b);
-	  mess->show();
-	  mess_open = true;
-	  
-	  p=base->get_BasePos(it->getType());
-	  entity = p.getEntity();
-	  c = new Coord(250,250,250,250);
-	  port_east = entity->getPortEast(c);
-	  port_west = entity->getPortWest(c);
-	  port_north = entity->getPortNorth(c);
-	  port_south = entity->getPortSouth(c);
-	  paint = true;
-	  father = current;
-	  current = QString::fromStdString(it->getName());
-	  repaint();
+          found=true;
+	  this->setDisabled(true);
 	}
       }
-
+      if(found){  
+       	mess = new QWidget();
+	mess->setFixedSize(200,50);
+	mess->move(200,50);
+	QBoxLayout *b = new QBoxLayout(QBoxLayout::TopToBottom,0);
+	QLabel *l = new QLabel();
+	l->setText("please wait while charging");
+	b->addWidget(l);
+	mess->setLayout(b);
+	mess->show();
+	mess_open = true;
+
+	p=base->get_BasePos(t.toStdString());
+	entity = p.getEntity();
+	c = new Coord(250,250,250,250);
+	port_east = entity->getPortEast(c);
+	port_west = entity->getPortWest(c);
+	port_north = entity->getPortNorth(c);
+	port_south = entity->getPortSouth(c);
+	if(cpt_level!=0)
+	  tab[cpt_level]=father;
+	father = current;
+	current = QString::fromStdString(t.toStdString());
+	cpt_level++;
+	tab[cpt_level] = father;
+	paint = true;
+	this->releaseMouse();
+	repaint();
+	write_name("");
+	write_comment("");
+	erase_position();
+	erase_size();
+	found = false;
+	this->setDisabled(false);
+      }
+      
       if(e->type() == QMouseEvent::MouseButtonPress && e->button() == Qt::LeftButton){
 	if(mouseX >= px + MARGEX  && mouseY >= py +MARGEY && mouseX <= px+taillex + MARGEX  && mouseY <= py+tailley + MARGEY) {
-	  write_name(it->getName());
-	  write_position(px,py);
-	  write_size(taillex,tailley);
-	  write_ports(cpt_ports);
-	}	
-      }
-      
+	  bc = true;
+	  nc = it->getName();
+	  cx = px;
+	  cy = py;
+	  tx = taillex;
+	  ty = tailley;
+	  BaseP tp = base->get_BasePos(t.toStdString());
+	  if(&tp != NULL)
+		cc=tp.getComment();
+	  component_clicked = true;
+	}
+      }
+    }
+    if(bc){
+      write_name(nc);
+      write_position(cx,cy);
+      write_size(tx,ty);
+      write_comment(cc);
     }
   }
 }
 
+
+void Window::mouseMoveEvent(QMouseEvent *e){
+
+   if(paint && (p.getArchitecture() != NULL) && !component_clicked){
+
+    compo = p.getComponent();
+    
+    QMouseEvent *mouseEvent = (QMouseEvent *) e;
+
+    mouseX = mouseEvent->x();
+    mouseY = mouseEvent->y();
+    
+    bool b  = false;
+    bool b2 = false;
+    int px,py,taillex,tailley,sx,sy,ppx,ppy;
+    string s,c;
+   
+    for(QList<Component>::iterator it=compo->begin();it!=compo->end();++it){
+      Coord *co = it->get_Position();
+      px = co->get_hg_x();
+      py = co->get_hg_y();
+      taillex = co->get_size_x();
+      tailley = co->get_size_y();
+      
+      if(e->type() == QMouseEvent::MouseMove){
+	if(mouseX >= px + MARGEX  && mouseY >= py +MARGEY && mouseX <= px+taillex + MARGEX  && mouseY <= py+tailley + MARGEY) {
+	  b = true;
+	  s = it->getName();
+	  BaseP tp=base->get_BasePos(it->getName());
+	  if(&tp!=NULL)
+	    c=tp.getComment();
+	  ppx = px;
+	  ppy = py;
+	}
+      }
+    
+    
+
+      // QList<PortMap> *pm=it->getPortMap();
+//       for (QList<PortMap>::iterator it3=pm->begin();it3!=pm->end();++it3) {
+// 	Signal *sig=base->getSignal(it->getType(),new PortMap(*it3));
+// 	if(e->type() == QMouseEvent::MouseMove){
+// 	  if(mouseX >= sig->get_dest_x() - 5  + MARGEX  && mouseY >= sig->get_dest_x() - 5 +MARGEY && mouseX <= sig->get_dest_x() + 5  + MARGEX  && mouseY <= sig->get_dest_x() + 5 +MARGEY) {
+// 	    b2 = true;
+// 	    s = it3->getName();
+// 	    sx = portX;
+// 	    sy = portY;
+// 	  }
+// 	}
+//       }
+    }
+    
+    if(b){
+      write_name(s);
+      write_position(ppx,ppy);
+      write_size(taillex,tailley);
+      write_comment(c);
+    }
+    else{
+      write_name("");
+      erase_position();
+      erase_size();
+      write_comment("");
+    }
+   
+    
+    // if(b2){
+//       write_name(s);
+//       write_position(sx,sy);
+//     }
+//     else{
+//       write_name("");
+//       erase_position();
+//     }
+    //  }
+ 
+//    bool b3;
+//    int sx2,sy2;
+//    string s2;
+   
+//    for(QList<Port>::iterator it=port_east.begin(); it!=port_east.end(); ++it){
+//       portX = it->get_x();
+//       portY = it->get_y();
+//       if(mouseX >= portX - 10 && mouseY >= portY - 10 && mouseX <= portX + 10 && mouseY <= portY + 10){
+// 	b3 = true;
+// 	s2 = it->getName();
+// 	sx2 = portX;
+// 	sy2 = portY;
+//       }
+//     } 
+    
+//     for(QList<Port>::iterator it=port_west.begin(); it!=port_west.end(); ++it){
+//       portX = it->get_x() ;
+//       portY = it->get_y() ;
+//       if(mouseX >= portX - 5 && mouseY >= portY - 5 && mouseX <= portX + 5 && mouseY <= portY + 5){
+// 	b3 = true;
+// 	s2 = it->getName();
+// 	sx2 = portX;
+// 	sy2 = portY;
+//       }
+//     }
+    
+//     for(QList<Port>::iterator it=port_north.begin(); it!=port_north.end(); ++it){
+//       portX = it->get_x() ;
+//       portY = it->get_y() ;
+//       if(mouseX >= portX - 5 && mouseY >= portY - 5 && mouseX <= portX + 5 && mouseY <= portY + 5){
+// 	b3 = true;
+// 	s2 = it->getName();
+// 	sx2 = portX;
+// 	sy2 = portY;
+//       }
+//     }
+    
+//     for(QList<Port>::iterator it=port_south.begin(); it!=port_south.end(); ++it){
+//       portX = it->get_x() ;
+//       portY = it->get_y() ;
+//       if(mouseX >= portX - 5 && mouseY >= portY - 5 && mouseX <= portX + 5 && mouseY <= portY + 5){
+// 	b3 = true;
+// 	s2 = it->getName();
+// 	sx2 = portX;
+// 	sy2 = portY;
+//       }
+//     }
+   }
+}
+   
+ 
+void Window::_back(){
+  if(cpt_level==0){
+    QMessageBox *m = new QMessageBox(this);
+    m->setText("can't go up, you're on the top level !");
+    m->addButton("ok",QMessageBox::YesRole);
+    m->show();  
+  }
   
-void Window::_back(){
-  
-  paint = false;
-  repaint();
-  mess_charg = new QWidget();
-  mess_charg->setFixedSize(200,50);
-  mess_charg->move(200,50);
-  charg_open = true;
-  QBoxLayout *b = new QBoxLayout(QBoxLayout::TopToBottom,0);
-  QLabel *l = new QLabel();
-  l->setText("please wait while charging");
-  b->addWidget(l);
-  mess_charg->setLayout(b);
-  mess_charg->show();
-  
-  
-  
-  if(father==" "){
-    QList <BaseP> *liste_compo = base->getBaseP();  
-    p = liste_compo->at(0);  
+  else{
+    this->setDisabled(true);
+    paint = false;
+    repaint();
+    cpt_level--;
+    mess_charg = new QWidget();
+    mess_charg->setFixedSize(200,50);
+    mess_charg->move(200,50);
+    charg_open = true;
+    QBoxLayout *b = new QBoxLayout(QBoxLayout::TopToBottom,0);
+    QLabel *l = new QLabel();
+    l->setText("please wait while charging");
+    b->addWidget(l);
+    mess_charg->setLayout(b);
+    mess_charg->show();
+    
+    p = base->get_BasePos(father.toStdString());
+    entity = p.getEntity();
+    c = new Coord(250,250,250,250);
+    port_east = entity->getPortEast(c);
+    port_west = entity->getPortWest(c);
+    port_north = entity->getPortNorth(c);
+    port_south = entity->getPortSouth(c);
+    father = tab[cpt_level];
+    current = QString::fromStdString(entity->getName());
+    paint = true;
+    repaint();
+    this->setDisabled(false);
   }
-
-  else{
-    p = base->get_BasePos(father.toStdString());
-  }
-
-  entity = p.getEntity();
-  c = new Coord(250,250,250,250);
-  port_east = entity->getPortEast(c);
-  port_west = entity->getPortWest(c);
-  port_north = entity->getPortNorth(c);
-  port_south = entity->getPortSouth(c);
-  father = current;
-  current = QString::fromStdString(entity->getName());
-  paint = true;
-  repaint();
 }
 
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_parameters_window.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_parameters_window.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_parameters_window.cpp	(revision 26)
@@ -12,9 +12,6 @@
   parameters = new QBoxLayout(QBoxLayout::TopToBottom,0);
   wparam->setWindowTitle("parameters");
-  wparam->setFixedSize(250,300);
-  wparam->move(678,370);
-
-  lname = new QLabel(wparam);
-  lname->setText("");
+  wparam->setFixedSize(350,300);
+  wparam->move(628,370);
 
   QBoxLayout *bpos = new QBoxLayout(QBoxLayout::LeftToRight,0);
@@ -49,22 +46,16 @@
   bsize2->addWidget(sy);
   bsize2->addWidget(sizeY);
-  
-  QBoxLayout *bport = new QBoxLayout(QBoxLayout::LeftToRight,0);
-  QLabel *lport = new QLabel();
-  lport->setText("nb ports : ");
-  nb_ports = new QLineEdit();
-  nb_ports->setText("");
-  bport->addWidget(lport);
-  bport->addWidget(nb_ports);
-
-  parameters->addWidget(lname);
   parameters->addLayout(bpos);
   parameters->addLayout(bpos2);
   parameters->addLayout(bsize);
   parameters->addLayout(bsize2);
-  parameters->addLayout(bport);
+  QPushButton *noselect = new QPushButton("cancel selection",wparam);
   QPushButton *back = new QPushButton("back",wparam);
   QPushButton *apply = new QPushButton("apply",wparam);
   connect(back,SIGNAL(clicked()),this,SLOT(_back()));
+  connect(noselect,SIGNAL(clicked()),this,SLOT(_cancel_selection()));
+  connect(apply,SIGNAL(clicked()),this,SLOT(_apply()));
+  
+  parameters->addWidget(noselect);
   parameters->addWidget(back);
   parameters->addWidget(apply);
@@ -72,10 +63,4 @@
   wparam->setLayout(parameters);
   wparam->show();
-}
-
-void Window::write_name(string name){
-  QString n = QString::fromStdString(name);
-  lname->setText(n);
-  
 }
 
@@ -91,5 +76,9 @@
   str2 = out2.str();
   positionY->setText(QString::fromStdString(str2));
-  
+}
+
+void Window::erase_position(){
+  positionX->setText("");
+  positionY->setText("");
 }
 
@@ -107,12 +96,21 @@
 }
 
-void Window::write_ports(int x){
-  stringstream out;
-  string str;
-  out << x;
-  str = out.str();
-  nb_ports->setText(QString::fromStdString(str));
-  wparam->show();
+void Window::erase_size(){
+  sizeX->setText("");
+  sizeY->setText("");
 }
 
+void Window::_cancel_selection(){
+  component_clicked = false;
+}
 
+void Window::_apply(){
+  if(positionX->isModified())
+    cout << "positionX modified : " << positionX->text().toStdString() << endl;
+  if(positionY->isModified())
+    cout << "positionY modified : " << positionX->text().toStdString() << endl;
+  if(sizeX->isModified())
+    cout << "sizeX modified : " << sizeX->text().toStdString() << endl;
+  if(sizeY->isModified())
+    cout << "sizeY modified : " << sizeY->text().toStdString() << endl;
+}
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Makefile	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Makefile	(revision 26)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: bin/Viewer
-# Generated by qmake (2.01a) (Qt 4.2.2) on: Wed May 9 19:23:22 2007
+# Generated by qmake (2.01a) (Qt 4.2.2) on: Sun May 20 18:09:08 2007
 # Project:  Viewer.pro
 # Template: app app
@@ -93,4 +93,6 @@
 		Bdd/src/ListePorts_searchPort.cpp \
 		Parser/src/Parse_alloc.cpp \
+		Parser/src/Parse_closeBaseV.cpp \
+		Parser/src/Parse_accessors.cpp \
 		Parser/src/Parse_parser_pos.cpp \
 		Parser/src/Parse_getBaseV.cpp \
@@ -155,4 +157,6 @@
 		obj/ListePorts_searchPort.o \
 		obj/Parse_alloc.o \
+		obj/Parse_closeBaseV.o \
+		obj/Parse_accessors.o \
 		obj/Parse_parser_pos.o \
 		obj/Parse_getBaseV.o \
@@ -264,5 +268,5 @@
 dist: 
 	@$(CHK_DIR_EXISTS) obj/Viewer1.0.0 || $(MKDIR) obj/Viewer1.0.0 
-	$(COPY_FILE) --parents $(SOURCES) $(DIST) obj/Viewer1.0.0/ && $(COPY_FILE) --parents Bdd/include/Architecture.h Bdd/include/BaseP.h Bdd/include/BaseV.h Bdd/include/Component.h Bdd/include/Coord.h Bdd/include/Entity.h Bdd/include/ListePorts.h Bdd/include/Port.h Bdd/include/PortMap.h Bdd/include/Signal.h Graphics/include/window.h Parser/include/parser.h obj/Viewer1.0.0/ && $(COPY_FILE) --parents Bdd/src/Architecture_accessors.cpp Bdd/src/BaseP_accessors.cpp Bdd/src/Architecture_addComponent.cpp Bdd/src/Architecture_alloc.cpp Bdd/src/Architecture_searchComponent.cpp Bdd/src/Architecture_unalloc.cpp Bdd/src/BaseP_alloc.cpp Bdd/src/BaseP_unalloc.cpp Bdd/src/BaseV_accessors.cpp Bdd/src/BaseV_addBaseP.cpp Bdd/src/BaseV_addParam.cpp Bdd/src/BaseV_afficheBaseConsole.cpp Bdd/src/BaseV_alloc.cpp Bdd/src/BaseV_searchComponent.cpp Bdd/src/BaseV_unalloc.cpp Bdd/src/Component_accessors.cpp Bdd/src/Component_addPortMap.cpp Bdd/src/Component_alloc.cpp Bdd/src/Component_getPosition.cpp Bdd/src/Component_unalloc.cpp Bdd/src/Coord_alloc.cpp Bdd/src/Coord_unalloc.cpp Bdd/src/Signal_unalloc.cpp Bdd/src/ListePorts_getPortSouth.cpp Bdd/src/Port_accessors.cpp Bdd/src/Signal_alloc.cpp Bdd/src/Port_alloc.cpp Bdd/src/Signal_accessors.cpp Bdd/src/Coord_accessors.cpp Bdd/src/Port_unalloc.cpp Bdd/src/ListePorts_getPortEast.cpp Bdd/src/BaseV_getSignal.cpp Bdd/src/PortMap_alloc.cpp Bdd/src/Entity_alloc.cpp Bdd/src/PortMap_unalloc.cpp Bdd/src/ListePorts_alloc.cpp Bdd/src/PortMap_accessors.cpp Bdd/src/ListePorts_unalloc.cpp Bdd/src/ListePorts_countPort.cpp Bdd/src/ListePorts_getPortWest.cpp Bdd/src/Entity_unalloc.cpp Bdd/src/ListePorts_getPortNorth.cpp Bdd/src/Entity_accessors.cpp Bdd/src/ListePorts_addPort.cpp Bdd/src/ListePorts_accessors.cpp Bdd/src/ListePorts_searchPort.cpp Parser/src/Parse_alloc.cpp Parser/src/Parse_parser_pos.cpp Parser/src/Parse_getBaseV.cpp Parser/src/Parse_unalloc.cpp Parser/src/Parse_open_file.cpp Graphics/src/Graphics_main.cpp Graphics/src/Graphics_file_actions.cpp Graphics/src/Graphics_tools_actions.cpp Graphics/src/Graphics_about_actions.cpp Graphics/src/Graphics_main_window.cpp Graphics/src/Graphics_informations_window.cpp Graphics/src/Graphics_drawPort.cpp Graphics/src/Graphics_parameters_window.cpp Graphics/src/Graphics_setParse.cpp Graphics/src/Graphics_drawAll.cpp Graphics/src/Graphics_mouseEvent.cpp obj/Viewer1.0.0/ && (cd `dirname obj/Viewer1.0.0` && $(TAR) Viewer1.0.0.tar Viewer1.0.0 && $(COMPRESS) Viewer1.0.0.tar) && $(MOVE) `dirname obj/Viewer1.0.0`/Viewer1.0.0.tar.gz . && $(DEL_FILE) -r obj/Viewer1.0.0
+	$(COPY_FILE) --parents $(SOURCES) $(DIST) obj/Viewer1.0.0/ && $(COPY_FILE) --parents Bdd/include/Architecture.h Bdd/include/BaseP.h Bdd/include/BaseV.h Bdd/include/Component.h Bdd/include/Coord.h Bdd/include/Entity.h Bdd/include/ListePorts.h Bdd/include/Port.h Bdd/include/PortMap.h Bdd/include/Signal.h Graphics/include/window.h Parser/include/parser.h obj/Viewer1.0.0/ && $(COPY_FILE) --parents Bdd/src/Architecture_accessors.cpp Bdd/src/BaseP_accessors.cpp Bdd/src/Architecture_addComponent.cpp Bdd/src/Architecture_alloc.cpp Bdd/src/Architecture_searchComponent.cpp Bdd/src/Architecture_unalloc.cpp Bdd/src/BaseP_alloc.cpp Bdd/src/BaseP_unalloc.cpp Bdd/src/BaseV_accessors.cpp Bdd/src/BaseV_addBaseP.cpp Bdd/src/BaseV_addParam.cpp Bdd/src/BaseV_afficheBaseConsole.cpp Bdd/src/BaseV_alloc.cpp Bdd/src/BaseV_searchComponent.cpp Bdd/src/BaseV_unalloc.cpp Bdd/src/Component_accessors.cpp Bdd/src/Component_addPortMap.cpp Bdd/src/Component_alloc.cpp Bdd/src/Component_getPosition.cpp Bdd/src/Component_unalloc.cpp Bdd/src/Coord_alloc.cpp Bdd/src/Coord_unalloc.cpp Bdd/src/Signal_unalloc.cpp Bdd/src/ListePorts_getPortSouth.cpp Bdd/src/Port_accessors.cpp Bdd/src/Signal_alloc.cpp Bdd/src/Port_alloc.cpp Bdd/src/Signal_accessors.cpp Bdd/src/Coord_accessors.cpp Bdd/src/Port_unalloc.cpp Bdd/src/ListePorts_getPortEast.cpp Bdd/src/BaseV_getSignal.cpp Bdd/src/PortMap_alloc.cpp Bdd/src/Entity_alloc.cpp Bdd/src/PortMap_unalloc.cpp Bdd/src/ListePorts_alloc.cpp Bdd/src/PortMap_accessors.cpp Bdd/src/ListePorts_unalloc.cpp Bdd/src/ListePorts_countPort.cpp Bdd/src/ListePorts_getPortWest.cpp Bdd/src/Entity_unalloc.cpp Bdd/src/ListePorts_getPortNorth.cpp Bdd/src/Entity_accessors.cpp Bdd/src/ListePorts_addPort.cpp Bdd/src/ListePorts_accessors.cpp Bdd/src/ListePorts_searchPort.cpp Parser/src/Parse_alloc.cpp Parser/src/Parse_closeBaseV.cpp Parser/src/Parse_accessors.cpp Parser/src/Parse_parser_pos.cpp Parser/src/Parse_getBaseV.cpp Parser/src/Parse_unalloc.cpp Parser/src/Parse_open_file.cpp Graphics/src/Graphics_main.cpp Graphics/src/Graphics_file_actions.cpp Graphics/src/Graphics_tools_actions.cpp Graphics/src/Graphics_about_actions.cpp Graphics/src/Graphics_main_window.cpp Graphics/src/Graphics_informations_window.cpp Graphics/src/Graphics_drawPort.cpp Graphics/src/Graphics_parameters_window.cpp Graphics/src/Graphics_setParse.cpp Graphics/src/Graphics_drawAll.cpp Graphics/src/Graphics_mouseEvent.cpp obj/Viewer1.0.0/ && (cd `dirname obj/Viewer1.0.0` && $(TAR) Viewer1.0.0.tar Viewer1.0.0 && $(COMPRESS) Viewer1.0.0.tar) && $(MOVE) `dirname obj/Viewer1.0.0`/Viewer1.0.0.tar.gz . && $(DEL_FILE) -r obj/Viewer1.0.0
 
 
@@ -449,4 +453,10 @@
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/Parse_alloc.o Parser/src/Parse_alloc.cpp
 
+obj/Parse_closeBaseV.o: Parser/src/Parse_closeBaseV.cpp 
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/Parse_closeBaseV.o Parser/src/Parse_closeBaseV.cpp
+
+obj/Parse_accessors.o: Parser/src/Parse_accessors.cpp 
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/Parse_accessors.o Parser/src/Parse_accessors.cpp
+
 obj/Parse_parser_pos.o: Parser/src/Parse_parser_pos.cpp 
 	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/Parse_parser_pos.o Parser/src/Parse_parser_pos.cpp
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/include/parser.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/include/parser.h	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/include/parser.h	(revision 26)
@@ -17,5 +17,5 @@
 #include "Tools/Viewer/Bdd/include/PortMap.h"
 
-
+#define LEVEL_MAX 8
 
 using namespace std;
@@ -32,14 +32,13 @@
   string s;
   string absolutePath;
+  string toplevel;
 
-protected:
   morpheo::tools::viewer::bdd::BaseV *base;
   morpheo::tools::viewer::bdd::BaseP *pos;
-  morpheo::tools::viewer::bdd::Entity *ent;
-  morpheo::tools::viewer::bdd::Architecture *arch;
-  morpheo::tools::viewer::bdd::Component *ctemp;
-  //  morpheo::tools::viewer::bdd::Param *param;
-
-
+  morpheo::tools::viewer::bdd::Entity *ent[LEVEL_MAX];
+  morpheo::tools::viewer::bdd::Architecture *arch[LEVEL_MAX];
+  morpheo::tools::viewer::bdd::Component *ctemp[LEVEL_MAX];
+  
+protected:
 
 public:
@@ -47,11 +46,13 @@
   Parse(void);
   ~Parse(void);
-  void parser_pos(QDomNode n);
-  //void ParseParam(void);
-  int open_file(string name);
+  void parser_pos(QDomNode n,int level);
+
+  int open_file(string name,int level);
   //void saveFile(string name);
   morpheo::tools::viewer::bdd::BaseV *getBaseV();
-
- 
+  string getTopLevelName();
+  string getAbsolutePath();
+  /*Close and erase baseV*/
+  void closeBaseV();
  //void refresh();
  
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/src/Parse_open_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/src/Parse_open_file.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/src/Parse_open_file.cpp	(revision 26)
@@ -10,12 +10,20 @@
 namespace parser{
 
-   int Parse::open_file(string name){
+   int Parse::open_file(string name,int level){
+
     QFile file(QString::fromStdString(name));
+    QString testname,testname2;
     QString tmppath=QString::fromStdString(name);
-
     QString path=tmppath.left(tmppath.lastIndexOf('/',-1,Qt::CaseSensitive)+1);
-
     absolutePath=path.toStdString();
-
+    testname=tmppath.right(tmppath.lastIndexOf('.',-1,Qt::CaseSensitive)-1);
+    testname2=testname.left(testname.lastIndexOf('.',-1,Qt::CaseSensitive));
+    
+    if(tmppath.contains('-') && level==0) //file not top level (first open file)
+      {
+	testname2=testname2.left(testname2.lastIndexOf('-',-1,Qt::CaseSensitive));
+      }
+    
+    
      if( !file.open( QIODevice::ReadOnly ) )
        {
@@ -44,14 +52,17 @@
          #endif
 	 //BaseP
-	 if(!base)
-	   base=new morpheo::tools::viewer::bdd::BaseV();
+	 if(!base){
+	   base=new morpheo::tools::viewer::bdd::BaseV(); 
+	   toplevel=testname2.toStdString();
+	 }
 	 pos=new morpheo::tools::viewer::bdd::BaseP();
 	 //base->addBaseP(pos);
-	 parser_pos(root.firstChild());    
+	 parser_pos(root.firstChild(),level);    
 	 
        }
+
+     //     delete pos;
+     //delete ctemp;
      return 0;
-
-
    }
 
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/src/Parse_parser_pos.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/src/Parse_parser_pos.cpp	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Parser/src/Parse_parser_pos.cpp	(revision 26)
@@ -10,5 +10,6 @@
 namespace parser{     
 
-  void Parse::parser_pos(QDomNode n){
+  void Parse::parser_pos(QDomNode n,int level){
+    string fichier;
        while( !n.isNull() )
       {
@@ -25,17 +26,22 @@
 		//BaseP
 		pos->setComment(e.text().toStdString());
+		pos->setLevel(level);
+		
 	      }
 	    if (e.tagName() == "entity" )
 	      {
-                #ifdef DBUG_PARSE
+		#ifdef DBUG_PARSE
 		cout << "entity" <<endl;
 		cout << e.attribute("name","").toStdString() <<endl;
 		#endif
-		ent=new morpheo::tools::viewer::bdd::Entity\
+
+		ent[level]=new morpheo::tools::viewer::bdd::Entity\
 		  (e.attribute("name","").toStdString(),\
+		   e.attribute("type","").toStdString(),\
 		   e.attribute("schema","").toInt(0,10));
-		s=e.attribute("type","").toStdString();
-		pos->setEntity(ent);
-		parser_pos(n.firstChild());
+		s=e.attribute("name","").toStdString();
+		pos->setEntity(ent[level]);
+
+		parser_pos(n.firstChild(),level);
 		
 		if((n.nextSiblingElement()).tagName() !="architecture")
@@ -59,5 +65,5 @@
 		       e.attribute("localisation","").toStdString());
 		p->setComment(e.text().toStdString());
-		ent->addport(p);
+		ent[level]->addport(p);
 	      } 
 	    if (e.tagName() == "architecture" )
@@ -66,10 +72,10 @@
 		cout << "architecture" <<endl;
 		#endif
-		arch=new morpheo::tools::viewer::bdd::Architecture();
-		pos->setArchitecture(arch);
+		arch[level]=new morpheo::tools::viewer::bdd::Architecture();
+		pos->setArchitecture(arch[level]);
 		
 		base->addBaseP(pos,s);
 
-		parser_pos(n.firstChild());    
+		parser_pos(n.firstChild(),level);    
 	      } 
 	    if (e.tagName() == "component" )
@@ -86,20 +92,25 @@
 			    e.attribute("size_x","").toInt(0,10),\
 			    e.attribute("size_y","").toInt(0,10));
-		arch->addComponent(comp, e.attribute("type","").toStdString());
-		ctemp=comp;
+		ctemp[level]=comp;
+		arch[level]->addComponent(ctemp[level], e.attribute("name","").toStdString());
 		
-		string fichier=absolutePath;
-		fichier.append(e.attribute("type","").toStdString());
+		fichier=absolutePath;
+		fichier.append(ent[level]->getName());
+		fichier.append("-");
+		fichier.append((e.attribute("type","").toLower()).toStdString());
 		fichier.append(".pos");
-		#ifdef DBUG_PARSE
-		cout << fichier <<endl;
-		#endif
-		open_file(fichier);
-		parser_pos(n.firstChild());    
+          #ifdef DBUG_PARSE
+		cout << fichier <<endl; 
+          #endif
+		if(open_file(fichier,level+1)==-1)
+		  exit(1);
+		
+		parser_pos(n.firstChild(),level);    
+		
 		//ajout ptr Port du sous composant
-		BaseP pt=base->get_BasePos(e.attribute("type","").toStdString());
+		BaseP pt=base->get_BasePos((e.attribute("type","").toLower()).toStdString());
 		QList<Port> *sspor= (pt.getEntity())->getPort();
 		for(QList<Port>::iterator it=sspor->begin();it!=sspor->end();++it)
-		  ctemp->addport(new Port(*it));
+		  ctemp[level]->addport(new Port(*it));
 		
 	      } 
@@ -115,5 +126,5 @@
 			  e.attribute("port","").toStdString());
 		
-		ctemp->addPortMap(p);
+		ctemp[level]->addPortMap(p);
 		
 	      } 
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Viewer.pro
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Viewer.pro	(revision 25)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Viewer.pro	(revision 26)
@@ -92,5 +92,7 @@
 			Bdd/src/ListePorts_accessors.cpp				\
 			Bdd/src/ListePorts_searchPort.cpp				\
-			Parser/src/Parse_alloc.cpp					\
+			Parser/src/Parse_alloc.cpp					\		
+                        Parser/src/Parse_closeBaseV.cpp					\
+			Parser/src/Parse_accessors.cpp					\
 			Parser/src/Parse_parser_pos.cpp					\
 			Parser/src/Parse_getBaseV.cpp					\
