Ignore:
Timestamp:
May 9, 2007, 7:52:36 PM (17 years ago)
Author:
chou
Message:

2eme release du viewer
Mise a jour graphique du Viewer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/include/window.h

    r20 r21  
    1414
    1515#include <iostream>
     16#include <cmath>
     17#include <sstream>
    1618#include <qstring.h>
    1719#include <qapplication.h>
     
    3638#include <qtreeview.h>
    3739#include <qdirmodel.h>
     40#include <qevent.h>
     41
    3842
    3943#include "Tools/Viewer/Parser/include/parser.h"
     
    4448#define EAST 2
    4549#define WEST 3
     50
     51#define MARGEX 50
     52#define MARGEY 70
    4653
    4754using namespace morpheo::tools::viewer::parser;
     
    6269
    6370  Window(QString name);
    64   void _setParse(Parse *p); 
    65   void _init_file();   
     71  void _setParse(Parse *p);  //parse the base
     72  void _init_file();    //search component and port before drawing
    6673 private slots:
    6774   
    68   void _open();
     75  void _open(); //open a file
    6976  void _open_end();
    7077  void _open_error();
    7178
    72   void _save();
     79  void _save(); //save a file
    7380  void _saveAs();
    7481  void _saveAsOk();
    75   void _close();
    76   void _quit();
     82
     83  void _close(); //close a file
     84
     85  void _quit(); //quit a file
    7786  void _quit2();
    78   void _zoomIn();
     87
     88  void _zoomIn(); //zoom for the architecture view
    7989  void _zoomOut();
    8090  void _defautZoom();
    81   void _level();
    82   void _informations();
    83   void _parameters();
    84   void _about();
    8591
    86  private:
     92  void _level(); 
     93  void _informations(); //show or hide informations window
     94  void _parameters(); //show or hide parameters window
     95  void _about(); //about the programm
     96  void _component_name(); //show or hide the components name
     97  void _signal_name(); //show or hide the signals name
    8798
    88   void wparameters();
    89   void winformations();
    90   void paintEvent( QPaintEvent * );
    91   void repaint();
    92   void drawPort(int x,int y,int pos,string dir);
     99  void _back();
    93100
    94   QList <Port> port_east;
     101 protected :
     102  void mousePressEvent (QMouseEvent *); //mouse handler
     103 
     104 private :
     105  void wparameters(); // parameters window builder
     106  void winformations(); //informations window builder
     107  void paintEvent( QPaintEvent * ); //drawing panel
     108  void repaint(); //repaint the panel with current parameters
     109  void drawPort(int x,int y,int pos,string dir); //draw the components ports
     110  void write_name(string name); //write the name of the component clicked name in the informations window
     111  void write_position(int x, int y);//write the position of the position clicked in the informations window
     112  void write_size(int x, int y);//write the size of the component clicked in the informations window
     113  void write_ports(int x);//write the number of the component clicked in the informations window
     114
     115  QList <Port> port_east; //ports lists
    95116  QList <Port> port_west;
    96117  QList <Port> port_north;
     
    98119  QList <Component> *compo;
    99120
    100   QWidget *wparam;
     121  QWidget *wparam;//windows widget (informations, parameters, open, save ...)
    101122  QWidget *winfo;
    102123  QWidget *ws;
     
    105126  QWidget *wa;
    106127
    107   Parse *parse;
    108   BaseV *base;
    109   BaseP p;
    110   Entity *entity;
    111   Coord *c;
     128  QWidget *mess_charg;
     129  QWidget *mess;
     130  QBoxLayout *informations; //informations box
     131  QBoxLayout *parameters; //parameters box
     132
     133  Parse *parse; //the parser
     134  BaseV *base; //the current BaseV
     135  BaseP p; //the current BaseP
     136  Entity *entity; //entity of current base
     137  Coord *c;
    112138 
    113139  QPainter painter;
     
    115141  QStatusBar *status;
    116142
    117   QLineEdit *file_name;
    118   QString current_name;
     143  QLineEdit *file_name; //retrieve the name user wants to open from the open window
     144  QString current_name; //name of the current file opened
    119145
    120   int window_height;
     146  /*items of the informations window*/
     147  QLabel *lname; //name of the component clicked
     148  QLineEdit *positionX; //x position
     149  QLineEdit *positionY;//y position
     150  QLineEdit *sizeX;//x size
     151  QLineEdit *sizeY;//y size
     152  QLineEdit *nb_ports;
     153
     154  int cpt_ports;//nb ports of component clicked
     155
     156  int mouseX; //mouse position
     157  int mouseY;
     158
     159  int window_height; //main window size
    121160  int window_width;
    122   int panel_heigth;
    123   int panel_width;
    124   int margeX;
     161  int margeX;//size of the marge
    125162  int margeY;
    126   int portX;
     163  int portX;//port size, position and size of components, used when drawing the architecture
    127164  int portY;
    128165  int posX;
     
    131168  int tailleY;
    132169
    133   bool save_as;
     170  QString father;//father name
     171  QString current;//name of the current architecture visible
     172
     173  bool save_as;
    134174  bool first_save;
    135   bool info_open;
    136   bool param_open;
    137   bool is_save;
    138   bool paint;
    139   bool wq_open;
     175  bool info_open; //know if the informations window opened or not
     176  bool param_open; //know if the parameters window opened or not
     177  bool is_save; //know if the file has been saved
     178  bool paint; //(re)paint or not
     179  bool wq_open; //know if Quit/Open ( 2 windows possible)/Save window is open
    140180  bool wo_open;
    141181  bool ws_open;
    142182  bool wa_open;
    143   bool quit_demand;
    144   bool file_open;
    145   bool is_parse;
     183  bool quit_demand;//know if user clicked on "quit" (used for saving file before quit)
     184  bool file_open;//know if a file is still open (used if user wants to open another file)
     185  bool is_parse;//know is the base has been created
     186  bool signalName;//show or hide signals name
     187  bool componentName;//show or hide components name
     188  bool charg_open;//back chargement message box opened or not
     189  bool mess_open;//chargment message box opened or not
     190
    146191};
    147192      };
Note: See TracChangeset for help on using the changeset viewer.