source: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main.cpp @ 20

Last change on this file since 20 was 20, checked in by chou, 17 years ago

1ere release du Viewer :

  • Parseur xml sur Base de données
  • Chargement d'un fichier de positions
  • Dessin du top-level
  • Dessin des ports du top level
  • Dessin des sous composants
  • Dessin des ports de ces sous composants

les valeurs de positions et de taille sont en %.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1/*******************************************/
2/*                                         */
3/*           viewer application            */
4/*             beta test v 1.0             */
5/*                                         */
6/*******************************************/
7
8#include "window.h"
9
10using namespace morpheo::tools::viewer::parser;
11using namespace morpheo::tools::viewer::bdd;
12using namespace morpheo::tools::viewer::graphics;
13
14using namespace std;
15
16int main (int argc, char* argv[])
17{
18  if(argc>2){
19    cout << "error : argument must be a file name or nothing" << endl;
20    return 0;
21  }
22
23  Parse *par = new Parse();
24
25 
26   QApplication *a=new QApplication (argc,argv); 
27   
28   if(argc == 2){
29     if(par->open_file(argv[1])==-1){
30        cout << "file doesn't exist or is not a valid format" << endl; 
31        exit(1);
32     }
33     Window *win = new Window(QString(argv[1]));
34     win->_setParse(par);
35     win->_init_file();
36     win->show();
37   }
38
39   else{
40     
41     Window *win = new Window(NULL);
42     win->_setParse(par);
43     win->show();
44   }
45   
46
47  a->setStyle(new QPlastiqueStyle);
48
49  return a->exec();
50 
51}
Note: See TracBrowser for help on using the repository browser.