Ignore:
File:
1 edited

Legend:

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

    r30 r20  
    1414
    1515#include <iostream>
    16 #include <cmath>
    17 #include <sstream>
    1816#include <qstring.h>
    1917#include <qapplication.h>
     
    3836#include <qtreeview.h>
    3937#include <qdirmodel.h>
    40 #include <qevent.h>
    41 #include <qfiledialog.h>
    42 
    4338
    4439#include "Tools/Viewer/Parser/include/parser.h"
     
    4944#define EAST 2
    5045#define WEST 3
    51 
    52 #define MARGEX 50
    53 #define MARGEY 70
    5446
    5547using namespace morpheo::tools::viewer::parser;
     
    7062
    7163  Window(QString name);
    72   void _setParse(Parse *p);  //parse the base
    73   void _init_file();    //search component and port before drawing
     64  void _setParse(Parse *p); 
     65  void _init_file();   
    7466 private slots:
    7567   
    76   void _open(); //open a file
    77  void _open_error();
     68  void _open();
     69  void _open_end();
     70  void _open_error();
    7871
    79   void _save(); //save a file
     72  void _save();
    8073  void _saveAs();
    8174  void _saveAsOk();
    82 
    83   void _close(); //close a file
    84 
    85   void _quit(); //quit a file
     75  void _close();
     76  void _quit();
    8677  void _quit2();
    87 
    88   void _zoomIn(); //zoom for the architecture view
     78  void _zoomIn();
    8979  void _zoomOut();
    9080  void _defautZoom();
     81  void _level();
     82  void _informations();
     83  void _parameters();
     84  void _about();
    9185
    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
     86 private:
    9887
    99   void _back();//return to the previous view
    100   void _cancel_selection();
    101   void _apply();
     88  void wparameters();
     89  void winformations();
     90  void paintEvent( QPaintEvent * );
     91  void repaint();
     92  void drawPort(int x,int y,int pos,string dir);
    10293
    103  protected :
    104   void mousePressEvent (QMouseEvent *); //mouse handler when mouse pressed
    105   void mouseMoveEvent (QMouseEvent *); //mouse handler in other case
    106  private :
    107   void wparameters(); // parameters window builder
    108   void winformations(); //informations window builder
    109   void paintEvent( QPaintEvent * ); //drawing panel
    110   void repaint(); //repaint the panel with current parameters
    111   void drawPort(int x,int y,int pos,string dir); //draw the components ports
    112   void write_name(string name); //write the name of the component clicked name in the informations window
    113   void write_comment(string comment);
    114   void write_type(string t);
    115 
    116   QList <Port> port_east; //ports lists
     94  QList <Port> port_east;
    11795  QList <Port> port_west;
    11896  QList <Port> port_north;
     
    12098  QList <Component> *compo;
    12199
    122   QWidget *wparam;//windows widget (informations, parameters, open, save ...)
     100  QWidget *wparam;
    123101  QWidget *winfo;
    124102  QWidget *ws;
    125103  QWidget *wq;
     104  QWidget *wo;
    126105  QWidget *wa;
    127106
    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;
     107  Parse *parse;
     108  BaseV *base;
     109  BaseP p;
     110  Entity *entity;
     111  Coord *c;
    138112 
    139113  QPainter painter;
     
    141115  QStatusBar *status;
    142116
    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
     117  QLineEdit *file_name;
     118  QString current_name;
    145119
    146   /*items of the informations window*/
    147   QLabel *lname;//name of the component clicked
    148   QLabel *ln;
    149   QLineEdit *comment;//comment associated with the component clicked
    150   QLabel *lt;
    151   QLabel *ltype;//type of the component
    152  
    153   int level; //level of architecture
    154   int mouseX; //mouse position
    155   int mouseY;
    156 
    157   int window_height; //main window size
     120  int window_height;
    158121  int window_width;
    159   int margeX;//size of the marge
     122  int panel_heigth;
     123  int panel_width;
     124  int margeX;
    160125  int margeY;
    161   int portX;//port size, position and size of components, used when drawing the architecture
     126  int portX;
    162127  int portY;
    163128  int posX;
     
    166131  int tailleY;
    167132
    168   int cpt_level;
    169   QString tab[50];
    170 
    171   QString father;//father name
    172   QString current;//name of the current architecture visible
    173 
    174   bool save_as;
     133  bool save_as;
    175134  bool first_save;
    176   bool info_open; //know if the informations window opened or not
    177   bool param_open; //know if the parameters window opened or not
    178   bool is_save; //know if the file has been saved
    179   bool paint; //(re)paint or not
    180   bool wq_open; //know if Quit/Open ( 2 windows possible)/Save window is open
     135  bool info_open;
     136  bool param_open;
     137  bool is_save;
     138  bool paint;
     139  bool wq_open;
     140  bool wo_open;
     141  bool ws_open;
    181142  bool wa_open;
    182   bool quit_demand;//know if user clicked on "quit" (used for saving file before quit)
    183   bool file_open;//know if a file is still open (used if user wants to open another file)
    184   bool signalName;//show or hide signals name
    185   bool componentName;//show or hide components name
    186   bool charg_open;//back chargement message box opened or not
    187   bool mess_open;//chargment message box opened or not
    188   bool component_clicked;//if user clicked on a component to modify its parameters
    189 
    190 
     143  bool quit_demand;
     144  bool file_open;
     145  bool is_parse;
    191146};
    192147      };
Note: See TracChangeset for help on using the changeset viewer.