Changeset 449 for trunk/yao


Ignore:
Timestamp:
10/15/10 12:05:27 (14 years ago)
Author:
yerima
Message:

A signal is emited from the InstructionWindow? to indicate that a row is inserted. Visual Yao

Location:
trunk/yao/src/interface/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/yao/src/interface/src/InstructionWindow.cpp

    r444 r449  
    2222 
    2323/*********************************************************************************************************************************/ 
    24 InstructionWindow::InstructionWindow(Table <Function> *aFunctionTable, QWidget *parent) : QWidget(parent) { 
     24InstructionWindow::InstructionWindow(Table <Function> *aFunctionTable, QWidget *parent) : QWidget(parent), savedData(" ") { 
    2525 
    2626        setupUi(this); 
     
    132132void InstructionWindow::addInstructionRow() { 
    133133 
     134try { 
    134135        QString nom  = m_fonctionNameLineEdit->text(); 
    135136        QString val  = m_fonctionParameterLineEdit->text(); 
     
    159160                                m_fonctionNameLineEdit->setText(""); 
    160161                                m_fonctionParameterLineEdit->setText(""); 
     162                                 
     163                                //QString dataInOneLine =  
     164                                 
     165                                //savedData.push_back(nom+" "+val); 
     166                                savedData  << nom+" "+val;//=  (QStringList() << str1 << str2 << str3); 
     167                                 
     168                                emit activeTheIAction(); 
    161169                  } 
     170        }        
     171 
     172        catch (...) { 
     173 
     174                QMessageBox::critical(this, "Erreur", "Erreur dans la méthode addInstructionRow()"); 
     175        } 
     176         
    162177 
    163178} 
     179/************************************ Implementation of getInstruction() method ************************************************************/ 
     180QStringList InstructionWindow::getInstruction() { 
    164181 
     182        return savedData;  
     183 
     184} 
    165185/***********************************************************************************************************************/ 
    166186/***************************************************** End of file *****************************************************/ 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r445 r449  
    3434*/ 
    3535 
    36 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), contextTest(false)     
     36MainWindow::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), contextTest(false), iw(NULL)      
    3737{ 
    3838 
     
    122122                menuExecution->addAction(actionCompilation); 
    123123                menuExecution->addAction(actionExecution); 
     124                 
    124125        menuConfig    = menuBar()->addMenu("&Configuration"); 
    125126                menuConfig->addAction(actionEditeur); 
     
    219220 
    220221        actionGenerationI = new QAction(this); 
    221                 //actionGenerationI->setEnabled(false); 
     222                actionGenerationI->setEnabled(false); 
    222223                actionGenerationI->setText("Générer le fichier .i");  
    223224                connect(actionGenerationI, SIGNAL(triggered()), this, SLOT(generateIFile())); 
     
    243244 
    244245} 
    245  
     246/*************************************************/ 
     247void MainWindow::enableIAction() { 
     248 
     249        actionGenerationI->setEnabled(true); 
     250 
     251} 
    246252/********************************* Implementation of the method Implémentation de la methode createToolBar() ****************************************/ 
    247253void MainWindow::createToolBar() { 
     
    935941                        instruction << "#---Fichier " + filename + ".i généré par visual Yao le " << date->date().toString().toStdString()  << endl; 
    936942                        instruction << "#-------------------------------------------------------------------------------------------------" << endl; 
    937  
     943                         
     944                        if (!iw->getInstruction().isEmpty()) { 
     945                         
     946                        for (QStringList::iterator it = iw->getInstruction().begin(); it != iw->getInstruction().end(); it++) 
     947 
     948                                instruction << it->toStdString() << endl; 
     949                         
     950                                instruction << endl; 
     951                                 
     952                                //emit activeTheIAction(); 
     953                        } 
    938954                        instruction.close(); 
    939955 
     
    954970 
    955971         
    956         InstructionWindow *iw = new InstructionWindow(&theFunctionTable) ; 
     972        iw = new InstructionWindow(&theFunctionTable) ; 
    957973        espace.addWindow(iw)->move(0, 0);  
    958974        iw->show();      
    959975 
     976        connect(iw, SIGNAL(activeTheIAction()), this, SLOT(enableIAction())); 
    960977} 
    961978/********************************************* Implementation of the method initializeWindow(int anInt) *********************************************/ 
  • trunk/yao/src/interface/src/include/InstructionWindow.hpp

    r443 r449  
    2424        public : 
    2525                InstructionWindow(yao::Table <yao::Function> *aFunctionTable, QWidget *parent=0); 
     26                QStringList getInstruction();  
    2627 
    2728        private slots: 
     
    2930                void selectedFunction(QModelIndex index); 
    3031                 
    31         //signals: 
     32        signals: 
     33                void activeTheIAction(); 
    3234                //void orderWindowIsClosed(int ); 
    3335 
     
    4547                QStandardItem *user_functions;  
    4648                 
     49                QStringList savedData; 
     50 
    4751                yao::Table <yao::Function>  *localFunctionTable; 
    4852                 //QStandardItemModel *m_orderModel; 
  • trunk/yao/src/interface/src/include/MainWindow.hpp

    r444 r449  
    135135                        void saveAs(); 
    136136                        void save(); 
     137                        void enableIAction(); 
    137138 
    138139        signals : 
     
    141142                        void newProjectIsCreated(QString chaine); 
    142143                        void WindowTitleChanged(); 
     144                        //void activeTheIAction(); 
    143145 
    144146        private : 
    145147                         
    146148                        MainWindowController the_mwc; 
     149                        InstructionWindow *iw; 
    147150                    // Les attributs des menus 
    148151                        QMenu *menuFichier; 
Note: See TracChangeset for help on using the changeset viewer.