Changeset 384 for trunk/yao


Ignore:
Timestamp:
07/09/10 19:31:12 (14 years ago)
Author:
yerima
Message:

the input and output parameter's option takes effect in the modul window.

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

Legend:

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

    r381 r384  
    8585             m_modulModel->setItem(row, 0, new QStandardItem(QString(it->getName().c_str()))); /*!< Gets the name.*/ 
    8686             m_modulModel->setItem(row, 1, new QStandardItem(QString(it->getSpaceOrOperator().c_str()))); /*!< Gets the dimension (1, 2 or 3).*/ 
    87              //m_modulModel->setItem(row, 2, new QStandardItem(QString(it->getProperty(2).c_str()))); /*!< Gets the  choosed in the space directive .*/ 
     87                if (it->isInput()) 
     88                        m_modulModel->setItem(row, 2, new QStandardItem(QString(intToString(it->getInput()).c_str()))); /*!< Gets the  choosed in the space directive .*/ 
     89                if (it->isOutput()) 
     90                        m_modulModel->setItem(row, 3, new QStandardItem(QString(intToString(it->getOutput()).c_str()))); /*!< Gets the  choosed in the space directive .*/ 
     91  
    8892           } 
    8993 
     
    116120} 
    117121 
    118 /**************************************** Implémentation de la méthode addModulRow *****************************************************************/ 
     122/**************************************** Implementation of addModulRow method *****************************************************************/ 
    119123void ModulWindow::addModulRow() { 
    120124try { 
     
    186190                                m_modulModel->setItem(row, 8, new QStandardItem("non")); 
    187191                        }        
    188                  
    189                 (m_modulSpaceRadioButton->isChecked())? m_localModulTable->push_back(Modul(modulName, m_localSpaceTable->find(modulParent), true)): m_localModulTable->push_back(Modul(modulName, m_localOperaTable->find(modulParent), false)); 
    190                  
     192                //bool aBool = m_modulSpaceRadioButton->isChecked()? true: false; 
     193 
     194        /*Modul mod =*/  
     195                        if (m_modulSpaceRadioButton->isChecked())  
     196                                { 
     197                                        Modul mod1(modulName, m_localSpaceTable->find(modulParent), true); 
     198                                        if (!input.empty()) 
     199                                                mod1.setInput(stringToInt(input)); 
     200                                        if (!output.empty()) 
     201                                                mod1.setOutput(stringToInt(output)); 
     202                                        //if (!target.emty()) 
     203                                                //mod1.setTarget(); 
     204                                        m_localModulTable->push_back(mod1); 
     205 
     206                                } 
     207                        else 
     208                                { 
     209                                        Modul mod2(modulName, m_localOperaTable->find(modulParent), false);      
     210                                        m_localModulTable->push_back(mod2); 
     211                                        if (!input.empty()) 
     212                                                mod2.setInput(stringToInt(input)); 
     213                                        if (!output.empty()) 
     214                                                mod2.setOutput(stringToInt(output)); 
     215 
     216                                        m_localModulTable->push_back(mod2); 
     217 
     218                                } 
     219 
     220         
    191221                if (!m_modulNowardCheckBox->isChecked ()) generateModulFile(modulName);                  
    192222        } 
     
    207237} 
    208238 
    209  
    210  
    211 /**************************************** Implémentation de la méthode addLoperaRow() **************************************************************/ 
     239/**************************************** Implementation of addLoperaRow() method **************************************************************/ 
    212240void ModulWindow::addLoperaRow() { 
    213241 
     
    216244} 
    217245 
    218 /**************************************** Implémentation de la méthode deleteLoperaRow() **********************************************************/ 
     246/**************************************** Implementation of deleteLoperaRow() method **********************************************************/ 
    219247void ModulWindow::deleteLoperaRow() { 
    220248 
     
    231259        } 
    232260} 
    233 /************************************* Implémentation de la méthode toInitialize() ***********************************************************/ 
     261 
     262/************************************* Implementation of toInitialize() method ***********************************************************/ 
    234263void ModulWindow::toInitialize() { 
    235264 
     
    253282                 
    254283} 
    255 /*************************************** Implémentation de la méthode deleteModulRow ****************************************************************/ 
     284 
     285/*************************************** Implementation of deleteModulRow() method. ***************************************************************/ 
    256286void ModulWindow::deleteModulRow() { 
    257287        try  
     
    284314} 
    285315 
    286 /*****************************************************************************************************************************/ 
     316/*************************************** Implementation of saveModulData() method. **************************************************/ 
    287317void ModulWindow::saveModulData() { 
    288318         
    289319} 
    290 /**********************************************************************/ 
     320/************************************* Implementation of isModulTableEmpty() method. *********************************/ 
    291321bool ModulWindow::isModulTableEmpty() { 
    292322 
     
    297327         
    298328} 
    299 /*****************************************************************************************************************************/ 
    300 /*void ModulWindow::enregistrerModul() { 
    301  
    302           //projetModul = new QFileDialog(this); 
    303           QStringList filtres; 
    304  
    305           //projetModul->setDirectory("."); 
    306           //projetModul->setFileMode (QFileDialog::AnyFile); 
    307           filtres << "*.h" 
    308                   << "Tous les fichiers (*.*)"; 
    309           //projetModul->setFilters(filtres); 
    310  
    311           //if(fd->exec()) { 
    312             //m_cheminProjetModul = projetModul->getSaveFileName(); 
    313  
    314 }*/ 
    315 /*****************************************************************************************************************************/ 
    316 /*void ModulWindow::ouvrirProjetExistant3() { 
    317  
    318             //projetModul = new QFileDialog(this); 
    319           QStringList filtres; 
    320  
    321           //projetModul->setDirectory("."); 
    322           //projetModul->setFileMode (QFileDialog::AnyFile); 
    323           filtres << "*.h" 
    324           << "Tous les fichiers (*.*)"; 
    325           projetModul->setFilters(filtres); 
    326  
    327             m_cheminProjetModul = projetModul->getSaveFileName(); 
    328  } 
     329/**************************************** Implementation of intToString(int anInt) method. ********************************************************/ 
     330string ModulWindow::intToString(int anInt) { 
     331 
     332        stringstream tampon; 
     333        tampon  << anInt; 
     334         
     335        return tampon.str(); 
     336} 
     337/**************************************** Implementation of stringToInt(const string& s) method. **************************************************/ 
     338const int ModulWindow::stringToInt(const string& s) { 
     339 
     340      return atoi(s.c_str()); 
     341} 
     342 
     343/**************************************** Implementation of stringToShort(const string& s) method. **************************************************/ 
     344const short ModulWindow::stringToShort(const string& s) { 
     345 
     346      return atoi(s.c_str()); 
     347} 
     348/*************************************** Implementation of method. *******************************************************************************/ 
     349/*QStringList ModulWindow::getModulData() { 
     350 
     351        //return filesList; 
     352} 
    329353*/ 
    330 /****************************************************************************************************************************/ 
    331 /*QStringList ModulWindow::getModulData() { 
    332  
    333         //return filesList; 
    334 } 
    335 */ 
     354/*************************************** Implementation of callModulHelp() *************************************************************************/ 
     355void ModulWindow::callModulHelp() { 
     356 
     357         QMessageBox::about(this, tr("Aide sur la directive Module."),("<p> Cette directive permet de déclarer les modules. Un module est identifié par son nom (modulname). Il doit ensuite être rattaché soit à un espace (introduit par le mot clé space suivi du nom de l’espace(spacename)) soit à un opérateur (introduit par le mot clé opera suivi du nom de l’opérateur (operaname)). <p> <u>Exemple:</u> modul Hfil space Soce input 3 output 1 tempo cout target" 
     358                              "<p>Pour plus d'informations sur la directive module,  <a href=\"help/modul_aide.html\">cliquez ici.</a>")); 
     359 
     360} 
     361 
    336362/************************************ Implementation of generateModulFile(string aFilename) method. *************************************************/ 
    337363void ModulWindow::generateModulFile(string aFilename)  
     
    382408} 
    383409 
    384 /****************************************************************************************************************************/ 
    385 void ModulWindow::callModulHelp() { 
    386  
    387          QMessageBox::about(this, tr("Aide sur la directive Module."),("<p> Cette directive permet de déclarer les modules. Un module est identifié par son nom (modulname). Il doit ensuite être rattaché soit à un espace (introduit par le mot clé space suivi du nom de l’espace(spacename)) soit à un opérateur (introduit par le mot clé opera suivi du nom de l’opérateur (operaname)). <p> <u>Exemple:</u> modul Hfil space Soce input 3 output 1 tempo cout target" 
    388                               "<p>Pour plus d'informations sur la directive module,  <a href=\"help/modul_aide.html\">cliquez ici.</a>")); 
    389  
    390 } 
    391  
    392410/********************************************************************/ 
    393411void ModulWindow::closeEvent(QCloseEvent *event) { 
  • trunk/yao/src/interface/src/include/MainWindow.hpp

    r381 r384  
    241241                        std::vector <string> theHeaderList; 
    242242                        yao::Context theContext; 
     243                        //yao::Modul theModul; 
    243244                        yao::Table <yao::Trajectory> theTrajectoryTable; 
    244245                        yao::Table <yao::Space> theSpaceTable; 
  • trunk/yao/src/interface/src/include/ModulWindow.hpp

    r379 r384  
    4242                void closeEvent(QCloseEvent *event); 
    4343                void generateModulFile(string aFilename);  
     44                string intToString(int anInt); 
     45                const int stringToInt(const string& s); 
     46                const short stringToShort(const string& s); 
    4447 
    4548        private: 
  • trunk/yao/src/interface/src/ui_/trajectorywindow.ui

    r362 r384  
    4444        <widget class="QLabel" name="m_nameLabel"> 
    4545         <property name="text"> 
    46           <string>Nom Trajectoire</string> 
     46          <string>Nom trajectoire</string> 
    4747         </property> 
    4848        </widget> 
     
    177177      <x>410</x> 
    178178      <y>40</y> 
    179       <width>81</width> 
     179      <width>87</width> 
    180180      <height>95</height> 
    181181     </rect> 
Note: See TracChangeset for help on using the changeset viewer.