Changeset 391 for trunk/yao/src/interface/src/MainWindow.cpp
- Timestamp:
- 07/31/10 21:19:33 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.