Changeset 369 for trunk/yao


Ignore:
Timestamp:
06/30/10 12:48:23 (14 years ago)
Author:
yerima
Message:

option window is ready. We can generate option parameters after saving it in the yao structure. Visual Yao.

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

Legend:

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

    r368 r369  
    2727        if (isContextListEmpty()) m_delButtonO_EXTOBJ->setDisabled(true);   
    2828                m_comboContextO_REAL->insertItem(0, "");  
    29                 m_comboContextO_REAL->insertItem(1, "FLOAT");  
    30                 m_comboContextO_REAL->insertItem(2, "DOUBLE");  
     29                m_comboContextO_REAL->insertItem(1, "float");  
     30                m_comboContextO_REAL->insertItem(2, "double");  
    3131                m_comboContextO_MQN->insertItem(0, "");  
    3232                m_comboContextO_MQN->insertItem(1, "M1QN3");  
    3333                m_comboContextO_MQN->insertItem(2, "M2QN1");  
    3434                m_comboContextO_PARALLEL->insertItem(0, "");  
    35                 m_comboContextO_PARALLEL->insertItem(1, "ACTIF");  
     35                m_comboContextO_PARALLEL->insertItem(1, "Actif");  
    3636                                 
    3737                m_comboContextO_NETWARD->insertItem(0, "");  
     
    5050        filesListModele = new QStringListModel(filesList); 
    5151 
    52         /*m_contextTableView->setModel(m_contextModel); 
    53                   m_contextTableView->resizeColumnsToContents(); 
    54                   m_contextTableView->setEditTriggers(QAbstractItemView::NoEditTriggers);  
    55                   m_contextTableView->setShowGrid(false);   
    56                   m_contextTableView->setSelectionBehavior(QAbstractItemView::SelectRows);  
    57         */ 
    58         /*for (Table<Constant>::reverse_iterator it = localConstantTable->rbegin(); it != localConstantTable->rend(); it++)  { 
    59          
    60                 m_contextModel->setItem(row, 0, new QStandardItem(m_comboContextO_REAL->currentText()));   
    61         } */     
    6252 
    6353        O_EXTOBJModele = new QStandardItemModel(0, 1) ;          
     
    9080                        /*      m_contextModel->setItem(row, 0, new QStandardItem());   
    9181                 
    92                         m_checkBoxO_GRADTEST->isChecked() 
    93                         m_checkBoxO_VARINCR->isChecked() 
    94                         m_checkBoxO_DBG_NANF->isChecked() 
    95                         m_checkBoxO_DBG_TING->isChecked() 
    96                         m_checkBoxO_DBG_BETA->isChecked() 
    97                         m_checkBoxO_DBG_TRC_FWARD->isChecked() 
    98                         m_checkBoxO_DBG_TRC_BWARD->isChecked() 
    99                         m_checkBoxO_DBG_TRC_LWARD->isChecked() 
    100                         m_checkBoxO_DBG_TRC_AWARD->isChecked()*/ 
    101                         m_contextParametersToString.clear(); 
     82                        */                      m_contextParametersToString.clear(); 
    10283                        string option = "option "; 
    10384                        string o_real           = m_comboContextO_REAL->currentText().toStdString(), 
     
    10990                        if (!o_real.empty()) 
    11091                                //QMessageBox::critical(this, "Erreur", ""); 
    111                                 if ((o_real == "FLOAT") || (o_real == "DOUBLE"))  
     92                                if ((o_real == "float") || (o_real == "double"))  
    11293                                        o_real2 = option + "O_REAL " + o_real;           
    11394                                 
     
    11899                        if (!o_parallel.empty())  
    119100                                { 
    120                                         if ((o_parallel == "ACTIF"))  
     101                                        if ((o_parallel == "Actif"))  
    121102                                                o_parallel2 = option + "O_PARALLEL" ; 
    122103                                        else  
     
    169150                         
    170151 
    171                         //if (!o_netward.empty()) 
    172                                 //if ((o_netward        == "M1QN3") || (o_mqn == "M2QN1")) 
    173                         //              o_netward2 = option + "O_NETWARD " + localConstantTable->find(o_parallel)->getText(); 
    174          
    175  
    176152                        for (vector <string>::reverse_iterator it = m_fileList.rbegin(); it != m_fileList.rend(); it++ ) 
    177153                                { 
     
    183159                                        //cout << "coucou" << endl; 
    184160                                } 
     161                         
     162 
     163 
     164 
    185165                        if (!o_real2.empty()) 
    186166                                m_contextParametersToString = o_real2 + "\n";  
     
    190170                                m_contextParametersToString += o_parallel2 + "\n"; 
    191171                        if (!o_netward2.empty())  
    192                                 m_contextParametersToString += o_netward2; 
    193                          
     172                                m_contextParametersToString += o_netward2 + "\n"; 
     173                        if (m_checkBoxO_GRADTEST->isChecked())   
     174                                m_contextParametersToString += "option O_GRADTEST \n"; 
     175                        if (m_checkBoxO_VARINCR->isChecked())   
     176                                m_contextParametersToString += "option O_VARINCR \n"; 
     177                        if (m_checkBoxO_DBG_NANF->isChecked())   
     178                                m_contextParametersToString += "option O_DBG_NANF \n"; 
     179                        if (m_checkBoxO_DBG_TING->isChecked())   
     180                                m_contextParametersToString += "option O_DBG_TING \n"; 
     181                        if (m_checkBoxO_DBG_BETA->isChecked())   
     182                                m_contextParametersToString += "option O_DBG_BETA \n"; 
     183                        if (m_checkBoxO_DBG_TRC_FWARD->isChecked())   
     184                                m_contextParametersToString += "option O_DBG_TRC_FWARD \n"; 
     185                        if (m_checkBoxO_DBG_TRC_BWARD->isChecked())   
     186                                m_contextParametersToString += "option O_DBG_TRC_BWARD \n"; 
     187                        if (m_checkBoxO_DBG_TRC_LWARD->isChecked())   
     188                                m_contextParametersToString += "option O_DBG_TRC_LWARD \n"; 
     189                        if (m_checkBoxO_DBG_TRC_AWARD->isChecked())   
     190                                m_contextParametersToString += "option O_DBG_TRC_AWARD \n"; 
     191 
     192 
     193 
     194 
     195 
     196 
     197 
     198 
    194199                        m_localContext->addExternal(m_fileList); 
    195200                        cout << "voici les parametres: " << endl << m_contextParametersToString << endl;  
     
    239244} 
    240245 
     246/********************************** Implementation of the method getContextParameters() ************************************************************/ 
     247string ContextWindow::getContextParameters() { 
     248 
     249        return m_contextParametersToString; 
     250 
     251} 
    241252/*************************************** Implémentation de la méthode resetParameters ****************************************************************/ 
    242253void ContextWindow::resetParameters() { 
    243254 
    244 /*      QItemSelectionModel *selection = m_contextTableView->selectionModel(); 
    245         QModelIndex indexElementSelectionne = selection->currentIndex(); 
    246         QVariant elementSelectionne = filesListModele->data(indexElementSelectionne, Qt::DisplayRole); 
    247  
    248         filesList.removeOne(elementSelectionne.toString());//Retrait de l'élément sélectionné de l'objet QStringList 
    249         filesListModele->setStringList(filesList); //On indique au modÚle la liste des éléments à afficher. 
    250  
    251 */ 
    252255        eraseDataFromLineEdit();         
    253256} 
     
    319322          }*/ 
    320323                  
    321            //        event->accept(); 
    322           //       emit contextWindowIsClosed(3); 
     324        event->accept(); 
     325        emit contextWindowIsClosed(3); 
    323326        //      for (vector <string>::iterator it = m_fileList.begin(); it != m_fileList.end(); it++ ) 
    324327            //                     { 
  • trunk/yao/src/interface/src/InsertFCTWindow.cpp

    r366 r369  
    1515        m_insertFCTModel        = new QStandardItemModel(0, 2);  
    1616        localFunctionTable      = aFunctionTable; 
     17         
     18        QRegExp regExp("[A-Za-z_][A-Za-z0-9_]*"); 
     19        m_insertFCTNameLine->setValidator(new QRegExpValidator(regExp, this)); 
    1720 
    1821        m_insertFCTModel->setHorizontalHeaderLabels(QStringList() << "Nom Fonction" << "Argument"); /*!< displays tableWidgetfct */ 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r367 r369  
    614614                        description << "//DEFVAL name value -------------------------------------------------------" << endl; 
    615615                                for (Table<Constant>::iterator it = theConstantTable.begin(); it != theConstantTable.end(); it++) 
    616                                         description << "defval " << it->getName() << " " << it->getText() << endl;///*<< dynamic_cast <string>(*it)*/ << endl; 
     616                                        description << "defval " << it->getName() << " " << it->getText() << endl; 
    617617                                        description << endl; 
    618  
    619618                        description << "//HATNAME  --------------------------------------------------------------------------" << endl; 
    620619                                for(vector <string>::iterator it = theHeaderList.begin(); it != theHeaderList.end(); it++) 
    621620                                        description << "hat_name \"" << it->c_str() << "\"" << endl; 
    622621                                        description << endl; 
    623                         //description << "//Contexts  ----------------------------------------------------------------------" << endl; 
    624          
    625                                 //for(QStringList::iterator it = m_contextWindow->getContextData().begin(); it != m_contextWindow->getContextData().end(); it++) 
    626                                         //     description << "option " << it->toStdString() << endl; 
    627                                         //       description << endl; 
    628  
     622                        description << "//Contexts  ----------------------------------------------------------------------" << endl; 
     623                                        description << m_contextWindow->getContextParameters() << endl; //"option " << it->toStdString() << endl; 
     624                                        description << endl; 
    629625                        description << "//TRAJECTOIRES name type uptime offtime dtime steptime -------------" << endl; 
    630  
    631                         /*      for(vector <string>::iterator it = m_contextWindow->getContextData().begin(); it != m_contextWindow->getContextData().end(); it++) 
    632                                         description << "option " << it->toStdString() << endl; 
    633                                         description << endl; 
    634                         */ 
    635   
    636626                                for (Table<Trajectory>::iterator it = theTrajectoryTable.begin(); it != theTrajectoryTable.end(); it++) 
    637627                                        description << "traj " << it->getName() << " " << it->getType() << " " << it->getBoot() << " "  << it->getOffset() << " " << it->getStep() << " " << it->getSize()<< " " << endl; 
    638628                                        description << endl; 
    639629                        description << "//SPACE name type dim1 [[dim2]---[dim3]] traj------------------" << endl;  
    640  
    641630                                for (Table<Space>::iterator it = theSpaceTable.begin(); it != theSpaceTable.end(); it++) 
    642                                         description << "space " << it->getProperty(0) << " " << it->getProperty(1) << " " << it->getProperty(2) << endl;//<< " " << it->getBoot() << " " << it->getSize() << " " << it->getStep() << " " << it->getOffset() << " " << it->getType() << endl; 
     631                                        description << "space " << it->getProperty(0) << " " << it->getProperty(1) << " " << it->getProperty(2) << endl; 
    643632                                        description << endl; 
    644                         description << "//DIMENSION ---------------------------------------------" << endl;  
    645  
    646  
    647                                 // for (QStringList::iterator it = m_spaceWindow->getData().begin(); it != m_spaceWindow->getData().end(); it++) 
    648                         //    description << "space " << it->toStdString() << endl; 
    649                         //  description << endl; 
    650             
    651                         //description << "//NETWARD ---------------------------------------------------------------------------" << endl; 
     633                        description << "//OPERATOR ---------------------------------------------" << endl;  
     634                                for (Table<Operator>::iterator it = theOperaTable.begin(); it != theOperaTable.end(); it++) 
     635                                        description << "opera " << it->getProperty(0) << " " << it->getProperty(1) << " " << it->getProperty(2) << endl; 
     636                        description << "//NETWARD ---------------------------------------------------------------------------" << endl; 
    652637 
    653638                                /*for (QStringList::iterator it = m_netwardWindow->getDataNetward().begin(); it != m_netwardWindow->getDataNetward().end(); it++) 
    654639                        description << "netward " << it->toStdString() << endl; 
    655640                        description << endl;*/ 
    656                         // description << "//MODUL --------------------------------------------------------------------------" << endl; 
     641                        description << "//MODUL --------------------------------------------------------------------------" << endl; 
    657642    
    658643                                /*  for (QStringList::iterator it = m_modulWindow->getDataModul().begin(); it != m_modulWindow->getDataModul().end(); it++) 
    659644                        description << "modul " << it->toStdString() << endl; 
    660645                        description << endl;*/ 
    661                         //description << "//CONNECTIONS----------------------------------------------------------------------" << endl; 
     646                        description << "//CONNECTIONS----------------------------------------------------------------------" << endl; 
    662647 
    663648                                /* for (QStringList::iterator it = m_ctinWindow->getDataCtin().begin(); it != m_ctinWindow->getDataCtin().end(); it++) 
    664649                        description << "ctin " << it->toStdString() << endl; */ 
    665                         // description << "//USER FUNCTIONS     ----------------------------------------------------------------" << endl; 
    666                         //description << endl; 
     650                        description << "//USER FUNCTIONS----------------------------------------------------------------" << endl; 
     651                                for (Table<Function>::iterator it = theFunctionTable.begin(); it != theFunctionTable.end(); it++) { 
     652                                                 
     653                                        string aString = it->isParameterized()? "arg" : " "; 
     654                                        description << "insert_fct " << aString << " " << it->getName() << endl; 
     655                                        } 
     656                                        description << endl; 
    667657 
    668658                                /*    for (QStringList::iterator it = m_insertFCTWindow->getDataFCT().begin(); it != m_insertFCTWindow->getDataFCT().end(); it++) 
  • trunk/yao/src/interface/src/include/ContextWindow.hpp

    r367 r369  
    3333                QStringList getContextData(); 
    3434                void eraseDataFromLineEdit();  
     35                std::string getContextParameters(); 
    3536 
    3637        private slots: 
     
    5354   
    5455                  void contextWindowIsClosed(int anInt); 
    55  
    5656 
    5757        private : 
Note: See TracChangeset for help on using the changeset viewer.