- Timestamp:
- 07/31/10 21:19:33 (14 years ago)
- Location:
- trunk/yao/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/Translator.cpp
r323 r391 68 68 */ 69 69 void Translator::generateCode(){ 70 this->description (); // Description analysis.70 this->descriptionVisualYAO(); // Description analysis. 71 71 72 72 if(theDisplay.isHelp()) // Display the help menu if requested in the description file. -
trunk/yao/src/interface/Makefile
r390 r391 12 12 CXX = g++ 13 13 DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED 14 CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) 15 CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) 16 INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Isrc/include -I. -I../../share/boost_1_39_0/ -I. 14 ANTLRDIR = ../../share/antlr-2.7.7/lib/cpp/ 15 CFLAGS = #-pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) 16 CXXFLAGS = -I$(ANTLRDIR)#-pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) 17 INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -Isrc/include -I. -I../../share/boost_1_39_0 $(CXXFLAGS) 17 18 LINK = g++ 18 LFLAGS = -Wl,-O1 19 LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread 19 LFLAGS = -Wl,-O1 #-L$(ANTLRDIR)src -lantlr 20 LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread -L../../share/antlr-2.7.7/lib/cpp/src -lantlr 20 21 AR = ar cqs 21 22 RANLIB = -
trunk/yao/src/interface/src/ConnectionWindow.cpp
r381 r391 48 48 49 49 m_ctinModulInCombo->insertItem(1, QString(it->getName().c_str())); 50 m_ctinModulOutCombo->insertItem(1, QString(it->getName().c_str()));50 //m_ctinModulOutCombo->insertItem(1, QString(it->getName().c_str())); 51 51 //m_ctinModel->setItem(row, 0, new QStandardItem(QString(it->getName().c_str()))); /*!< Gets the name.*/ 52 52 //m_ctinModel->setItem(row, 1, new QStandardItem(QString(it->getSpaceOrOperator().c_str()))); -
trunk/yao/src/interface/src/ConstantWindow.cpp
r389 r391 1 1 //! \file ConstantWindow.cpp 2 2 //! \brief Implementation of the Constant window for visual_YAO. 3 //! \version 2010/0 5/12(yyyy/mm/dd)3 //! \version 2010/07/30 (yyyy/mm/dd) 4 4 //! \author MAYAKI Abdouramane & MAYOMBO Alexis. 5 5 … … 191 191 if (!(m_ligneNom->text().isEmpty()) && !(m_ligneValeur->text().isEmpty())) { //When the two QLineEdit content data, show a confirmation box. 192 192 193 int ret = QMessageBox::warning(this, tr("Confirmation de fermeture"), tr("Voulez-vous vraiment quitter?"),193 int ret = QMessageBox::warning(this, tr("Confirmation de fermeture"), tr("Voulez-vous quitter sans sauvegarder les données contenues dans les champs?"), 194 194 QMessageBox::Yes | QMessageBox::Default, QMessageBox::Cancel | QMessageBox::Escape); 195 195 -
trunk/yao/src/interface/src/MainWindow.cpp
r389 r391 17 17 //using namespace antlr; 18 18 using namespace std; 19 using namespace antlr; 19 20 using namespace yao; 20 21 … … 35 36 */ 36 37 37 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_constantWindow(NULL), m_hatnameWindow(NULL), m_contextWindow(NULL), m_trajectoryWindow(NULL), m_spaceWindow(NULL), m_operaWindow(NULL), m_netwardWindow(NULL), m_modulWindow(NULL), m_ctinWindow(NULL), m_orderWindow(NULL), m_insertFCTWindow(NULL), m_newProjectWindow(NULL), m_newProjectName("") 38 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_constantWindow(NULL), m_hatnameWindow(NULL), m_contextWindow(NULL), m_trajectoryWindow(NULL), m_spaceWindow(NULL), m_operaWindow(NULL), m_netwardWindow(NULL), m_modulWindow(NULL), m_ctinWindow(NULL), m_orderWindow(NULL), m_insertFCTWindow(NULL), m_newProjectWindow(NULL), m_newProjectName(""), theConstantTablePt(theConstantTable) 38 39 { 39 40 … … 74 75 75 76 77 } 78 79 /******************************************* Implementation of the method setTitle() *****************************************************************/ 80 MainWindow::MainWindow(Table <Constant> aConstantTable): theConstantTablePt(aConstantTable) 81 { 82 theConstantTablePt = aConstantTable; 83 //theConstantTable; 76 84 } 77 85 … … 223 231 224 232 /********************************* Implementation of the method Implémentation de la methode createToolBar() ****************************************/ 225 226 233 void MainWindow::createToolBar() { 227 234 … … 245 252 246 253 /******************************** Implementation of the method Implémentation de la methode cacherBarreOutils() ***************************************/ 247 248 254 void MainWindow::cacherBarreOutils() { 249 255 … … 252 258 253 259 } 260 254 261 /********************************** Implementation of the method Implementation de la methode toolBarActions() ****************************************/ 255 262 void MainWindow::toolBarActions(QWorkspace &espace) … … 297 304 desactivateToolBarButtons(); // Désactive tous les boutons de la barre d'outils 298 305 } 306 299 307 /*********************************************** Implementation of the method createDefvalWindow() *************************************************/ 300 308 void MainWindow::createDefvalWindow() … … 314 322 315 323 } 324 316 325 /******************************************** Implementation of the method createHatNameWindow() ***************************************************/ 317 326 void MainWindow::createHatNameWindow() { … … 326 335 connect(m_hatnameWindow, SIGNAL(hatWindowIsClosed(int)), this, SLOT(initializeWindow(int)));// The signal is in the HatNameWindow.hpp file. 327 336 } 337 328 338 /********************************************* Implementation of the method createContextWindow() *************************************************/ 329 339 void MainWindow::createContextWindow() { … … 338 348 connect(m_contextWindow, SIGNAL(contextWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 339 349 } 350 340 351 /********************************************* Implementation of the method createTrajectoryWindow() ************************************************/ 341 352 void MainWindow::createTrajectoryWindow() { … … 353 364 connect(m_trajectoryWindow, SIGNAL(trajRowIsAdded(bool)), m_operaButton, SLOT(setEnabled(bool))); 354 365 } 366 355 367 /********************************************* Implementation of the method createSpaceWindow() ************************************************/ 356 368 void MainWindow::createSpaceWindow() { … … 392 404 393 405 } 406 394 407 /********************************************* Implementation of the method createModulWindow() ************************************************/ 395 408 void MainWindow::createModulWindow() { … … 402 415 403 416 connect(m_modulWindow, SIGNAL(modulWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 404 405 417 } 406 418 … … 418 430 419 431 } 432 420 433 /********************************************* Implementation of the method createOrderWindow() ************************************************/ 421 434 void MainWindow::createOrderWindow() { … … 430 443 431 444 } 445 432 446 /********************************************* Implementation of the method createInsertFCTWindow() ************************************************/ 433 447 void MainWindow::createInsertFCTWindow() { … … 443 457 444 458 } 459 445 460 /********************************************* Implementation of the method directivesManage() *****************************************************/ 446 461 void MainWindow::directivesManager() { … … 464 479 m_orderButton->setEnabled(true); 465 480 m_insertFCTButton->setEnabled(true); 466 467 } 481 } 482 468 483 /********************************** Implementation of the method desactivateToolBarButtons() *******************************************************/ 469 484 void MainWindow::desactivateToolBarButtons() { … … 526 541 // exitStatus = EXIT_SUCCESS; 527 542 //cout << "End application" << endl; 528 543 QFileDialog *dialogue = new QFileDialog(this); //Crée une boite de dialogue 544 545 QString cheminFichier = dialogue->getOpenFileName(this, tr("Ouverture d'un project existant."), QDir::homePath(), tr("*.d *.i *.txt")); //Retourne le chemin du fichier. 546 529 547 // translator.theConstantTable; 530 548 //m_ConstantCopy = new ConstantWindow(&theConstantTable, &theHeaderList); … … 536 554 537 555 // translator.theConstantTable; 538 539 540 QFileDialog *dialogue = new QFileDialog(this); //Crée une boite de dialogue 541 542 QString cheminFichier = dialogue->getOpenFileName(this, tr("Ouverture d'un project existant."), QDir::homePath(), tr("*.d *.i *.txt")); //Retourne le chemin du fichier. 556 557 QProcess builder; 558 559 builder.setProcessChannelMode(QProcess::MergedChannels); 560 builder.start("Yao9Generator " + cheminFichier);//, QStringList() 561 // <<"-e" 562 // <<"/opt/drbl/sbin/drblpush -c /etc/drbl/drblpush.conf" 563 564 // ); 565 //char *test2[]; 566 //QDebug ( QString * string ) 567 if (!builder.waitForFinished()) 568 qDebug() << "Make failed:" << builder.errorString(); 569 else 570 //qDebug << "Make output:" << builder.readAll(); 571 { 572 QString test(builder.readAll()); 573 //for (int i = 0; i <= test.size(); i++) 574 // { 575 // if (test.at(i) == ' ') 576 577 // } 578 579 istringstream iss(test.toStdString()); 580 581 FilePath mot; 582 FilePath name; 583 while ( getline(iss, mot, '\n' ) ) 584 { 585 586 if (mot.getExtension() == ".def1") 587 { 588 //cout << mot.getTitle() << endl; 589 name = mot; 590 } 591 if (mot.getExtension() == ".def2" && name.getExtension() == ".def1") 592 { 593 Constant aConstant(name.getTitle(), mot.getTitle()); 594 theConstantTable.push_back(aConstant); 595 596 } 597 if (mot.getExtension() == ".h") 598 { 599 cout << mot << endl; 600 theHeaderList.push_back(mot); 601 602 } //theConstantTable.push_back(mot.getTitle()); 603 604 } 605 activateToolBarButtons(); 606 607 //cout << "Voici le resulat: " << test.toStdString() << endl; 608 } 609 610 //Tokenizer tokenizer("test_00.d");//cheminFichier.toStdString()); 611 //Translator translator(tokenizer); 612 //translator.descriptionVisualYAO(); 613 //translator.theConstantTable; 614 //for (Table<Constant>::iterator it = translator.theConstantTable.begin(); it != translator.theConstantTable.end(); it++) 615 // cout << it->getName() << " " << it->getText() << endl; 616 //string test << qDebug(); 617 618 /*QProcess process; 619 620 process.start( "sudo ", QStringList() 621 << "-S" 622 << "-p" << "password:\n" 623 << "gnome-terminal" ); 624 */ 625 //string test = "Yao9Generator " + cheminFichier.toStdString(); 626 //system(test.c_str());// "Yao9Generator projects/test_04/test_04.d"); 627 628 629 630 543 631 //QMessageBox::about(this, "test", "Ouverture un projet existant."); 544 632 } 633 545 634 /**************************************** Implementation of the method hatUpdate() ****************************************************************/ 546 635 void MainWindow::hatUpdate() { … … 580 669 return; 581 670 } 671 582 672 /******************************************* Implementation of the method contextUpdate(QString choix) ************************************************/ 583 673 void MainWindow::contextUpdate() { … … 598 688 return; 599 689 } 690 600 691 /***************************************** Implementation of the method montrerActionGenererD() ****************************************************/ 601 602 692 void MainWindow::montrerActionGenererD() { 603 693 … … 610 700 actionCompilation->setEnabled(true); 611 701 } 702 612 703 /************************************************* Implementation of the method setProjectName(string chaine) **************************************/ 613 704 void MainWindow::setProjectName(string chaine) { … … 623 714 624 715 /************************************* Implementation of the method setProjectPath(string aPath) ******************************************/ 625 626 716 void MainWindow::setProjectPath(string aPath) { 627 717 -
trunk/yao/src/interface/src/ModulWindow.cpp
r389 r391 1 1 //! \file ModulWindow.cpp 2 2 //! \brief Implementation of the Modul window for visual_YAO. 3 //! \version 2010/07/ 05(yyyy/mm/dd)3 //! \version 2010/07/30 (yyyy/mm/dd) 4 4 //! \author MAYAKI Abdouramane. 5 5 … … 184 184 185 185 } 186 if (!(!target.empty() && output.empty())) {187 QMessageBox::critical(this, "Erreur", "Si target est défini, output doit-être obligatoirement renseigné.");188 return; // Arrêt de la méthode189 }186 //if (!(!target.empty() && output.empty())) { 187 // QMessageBox::critical(this, "Erreur", "Si target est défini, output doit-être obligatoirement renseigné."); 188 // return; // Arrêt de la méthode 189 // } 190 190 191 191 if (!modulName.empty() && !modulParent.empty()) … … 213 213 m_modulModel->setItem(row, 7, new QStandardItem("non")); 214 214 m_modulModel->setItem(row, 8, new QStandardItem("non")); 215 } 215 216 } 217 else 218 { 219 QMessageBox::about(this, "Avis", "Un fichier .h portant le nom du module vient d'etre cree."); 220 //return; // Arrêt de la méthode 221 222 } 216 223 //bool aBool = m_modulSpaceRadioButton->isChecked()? true: false; 217 224 -
trunk/yao/src/interface/src/include/MainWindow.hpp
r387 r391 5 5 #include <exception> 6 6 #include <cstdlib> 7 #include <sstream> 7 8 8 9 #include <iostream> 9 10 #include "../../../help/FilePath.hpp" 10 //#include "../../../Translator.hpp" 11 //#include "../../../analyzers/BaseLexer.hpp" 11 #include "../../../Translator.hpp" 12 #include "../../../Tokenizer.hpp" 13 #include "../../../analyzers/BaseParser.hpp" 14 //#include "../../../analyzers/grammar.g" 12 15 #include "../../../help/Display.hpp" 13 //#include <antlr/TokenStreamRecognitionException.hpp>16 #include <antlr/TokenStreamRecognitionException.hpp> 14 17 15 18 … … 60 63 61 64 MainWindow(QWidget *parent = 0); 65 MainWindow(yao::Table <yao::Constant> aConstantTable); 62 66 63 67 void toolBarActions(QWorkspace &espace); … … 246 250 yao::Constant m_theConstant; 247 251 yao::Table <yao::Constant> theConstantTable; 252 yao::Table <yao::Constant> &theConstantTablePt; 253 248 254 std::vector <string> theHeaderList; 249 255 yao::Context theContext; -
trunk/yao/src/interface/src/include/ModulWindow.hpp
r389 r391 16 16 #include "../../ui_modulwindow.h" 17 17 18 //#include "../../../help/FilePath.hpp" 19 //#include "../../../Translator.hpp" 20 //#include "../../../Tokenizer.hpp" 21 22 //#include "../../../analyzers/grammar.g" 18 23 19 24 class ModulWindow: public QWidget, public Ui::ModulWindow/*, public yao::Modul*/ { -
trunk/yao/src/interface/src/ui_/netwardwindow.ui
r366 r391 29 29 <enum>QFrame::Raised</enum> 30 30 </property> 31 <widget class="QWidget" name=" layoutWidget">31 <widget class="QWidget" name=""> 32 32 <property name="geometry"> 33 33 <rect> 34 34 <x>40</x> 35 35 <y>10</y> 36 <width>2 61</width>37 <height> 103</height>38 </rect> 39 </property> 40 <layout class="QHBoxLayout" name="horizontalLayout_ 2">36 <width>281</width> 37 <height>97</height> 38 </rect> 39 </property> 40 <layout class="QHBoxLayout" name="horizontalLayout_4"> 41 41 <item> 42 42 <layout class="QVBoxLayout" name="verticalLayout_2"> … … 69 69 </item> 70 70 <item> 71 <widget class="QLabel" name="label_2"> 72 <property name="text"> 73 <string>Nombre d'entrées (nbi)</string> 74 </property> 75 </widget> 76 </item> 77 <item> 78 <widget class="QLabel" name="label_3"> 79 <property name="text"> 80 <string>Nombre de sorties (nbs)</string> 81 </property> 82 </widget> 71 <layout class="QHBoxLayout" name="horizontalLayout_3"> 72 <item> 73 <widget class="QLabel" name="label_2"> 74 <property name="text"> 75 <string>Nombre d'entrées (nbi)</string> 76 </property> 77 </widget> 78 </item> 79 <item> 80 <spacer name="horizontalSpacer_2"> 81 <property name="orientation"> 82 <enum>Qt::Horizontal</enum> 83 </property> 84 <property name="sizeHint" stdset="0"> 85 <size> 86 <width>40</width> 87 <height>20</height> 88 </size> 89 </property> 90 </spacer> 91 </item> 92 </layout> 93 </item> 94 <item> 95 <layout class="QHBoxLayout" name="horizontalLayout_2"> 96 <item> 97 <widget class="QLabel" name="label_3"> 98 <property name="text"> 99 <string>Nombre de sorties (nbs)</string> 100 </property> 101 </widget> 102 </item> 103 <item> 104 <spacer name="horizontalSpacer_3"> 105 <property name="orientation"> 106 <enum>Qt::Horizontal</enum> 107 </property> 108 <property name="sizeHint" stdset="0"> 109 <size> 110 <width>40</width> 111 <height>20</height> 112 </size> 113 </property> 114 </spacer> 115 </item> 116 </layout> 83 117 </item> 84 118 </layout> … … 120 154 <x>282</x> 121 155 <y>70</y> 122 <width>8 1</width>156 <width>87</width> 123 157 <height>95</height> 124 158 </rect> -
trunk/yao/src/interface/ui_newprojectwindow.h
r389 r391 2 2 ** Form generated from reading UI file 'newprojectwindow.ui' 3 3 ** 4 ** Created: Wed Jul 21 16:50:2220104 ** Created: Fri Jul 30 10:30:58 2010 5 5 ** by: Qt User Interface Compiler version 4.6.3 6 6 ** -
trunk/yao/src/main.cpp
r28 r391 16 16 // PURPOSE. 17 17 18 18 19 #include <cstring> 19 20 #include <iostream> … … 21 22 #include "Translator.hpp" 22 23 #include "help/Display.hpp" 23 24 #include "interface/src/include/MainController.hpp" 24 25 #include <antlr/TokenStreamRecognitionException.hpp> 25 26 … … 37 38 // Check argument count. 38 39 if(argc <= 1) 39 throw runtime_error(" no file specified");40 throw runtime_error("No file specified"); 40 41 41 42 // Check if help menu is required. … … 44 45 exit(EXIT_SUCCESS); 45 46 } 46 47 47 48 filename = argv[1]; 48 49 if(filename.getExtension().empty()) … … 54 55 Translator translator(tokenizer); 55 56 // Code generation of the files Y1ProjectName.h and Y2ProjectName.h 56 translator.generateCode(); 57 //translator.generateCode(); 58 translator.descriptionVisualYAO(); 57 59 exitStatus = EXIT_SUCCESS; 58 60 //cout << "End application" << endl; 61 62 //QMessageBox msgBox; 63 //msgBox.setWindowTitle("Aide sur la création d'un nouveau projet."); 64 65 66 translator.theConstantTable; 67 //MainController MainController(translator.theConstantTable); 68 //m_ConstantCopy = new ConstantWindow(&theConstantTable, &theHeaderList); 69 70 for (Table<Constant>::iterator it = translator.theConstantTable.begin(); it != translator.theConstantTable.end(); it++) 71 { 72 //Constant test(it->getName(), it->getText()); 73 //MainController MainController(test); 74 cout << it->getName() << ".def1" << endl << it->getText() << ".def2" << endl; 75 //cout << "#" << endl; 76 //msgBox.setText("Le dernier parametre est:" + it->getName() + it->getText()); 77 } 78 translator.theHeaderList; 79 for (vector<string>::iterator it = translator.theHeaderList.begin(); it != translator.theHeaderList.end(); it++) 80 cout << it->c_str() << endl; 81 translator.theHeaderList; 82 for (vector<string>::iterator it = translator.theHeaderList.begin(); it != translator.theHeaderList.end(); it++) 83 cout << it->c_str() << endl; 84 for (Table<Trajectory>::iterator it = theTrajectoryTable.begin(); it != theTrajectoryTable.end(); it++) 85 cout << it->getName() << ".traj1" << endl << it->getType() << ".traj2" << endl << it->getBoot() << ".traj3" << endl << it->getOffset() << ".traj4" << it->getStep() << ".traj5" << it->getSize()<< " " << endl; 86 59 87 } 60 88 catch (RecognitionException& e){ -
trunk/yao/src/makefile
r309 r391 9 9 BOOSTDIR = ../share/boost_1_39_0 10 10 BOOSTFLAG = -I $(BOOSTDIR) 11 12 11 13 12 #LFLAGS = -L../lib -lantlr … … 33 32 34 33 $(CP) $(EXEC) ../bin/ 35 34 $(CP) $(EXEC) interface/ 36 35 #@echo 37 36 #@echo "Nardi's application---------------" … … 58 57 # target for compiling Visual YAO########################################################## 59 58 visual: 60 cd interface/; qmake -project; qmake; make; 59 #make 60 #make -C interface/ 61 62 63 @echo "-----Done----- " 61 64 62 65 # visual clean target ############ … … 128 131 $(CP) $(MQNDIR)/src/$(MQNLIB) $(MQNDIR)/bin/ 129 132 -@echo " $(EXEC) installed." 130 133 cd interface/; make; ./interface; cd - 131 134 # DO NOT DELETE
Note: See TracChangeset
for help on using the changeset viewer.