Changeset 389 for trunk/yao


Ignore:
Timestamp:
07/23/10 18:37:41 (14 years ago)
Author:
yerima
Message:

in modul window, if checked some case the other one will be checked by default.Target button is synchronyzed with output button.

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

Legend:

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

    r381 r389  
    7777                        m_delButton->setEnabled(true);                      
    7878                        Constant localConstant (Nom.toStdString(), Val.toStdString());   
    79                         for (Table<Constant>::iterator it = m_localConstantTable->begin(); it != m_localConstantTable->end(); it++) 
    80                                 if (m_localConstantTable->size() == 0 )// it->getName().c_str() == "" /*Nom.toStdString()*/) 
     79                        //for (Table<Constant>::iterator it = m_localConstantTable->begin(); it != m_localConstantTable->end(); it++) 
     80                        //      if (m_localConstantTable->size() == 0 )// it->getName().c_str() == "" /*Nom.toStdString()*/) 
    8181                                         
    82                                         {        
    83                                                 cout << it->getName() << endl; 
     82                        //              {        
     83                                                //cout << it->getName() << endl; 
    8484                                 
    8585                        //      else { 
    8686                        //              QMessageBox::critical(this, "Avertissement", "Cet élément existe déjà!"); 
    8787                        //              return; // Arrêt de la méthode 
    88                                         } 
     88                        //              } 
    8989                 
    9090                                m_localConstantTable->push_back(localConstant); 
     
    118118                m_defvalModel->removeRows(m_tableView->currentIndex().row(), 1); 
    119119                m_localConstantTable->erase(m_localConstantTable->begin() + r); 
    120                  
    121              for (unsigned int i=0; i < localHeaderList->size(); i++ ) //Parcourt le vecteur de HatName en fonction de sa taille (nombre d'éléments) 
    122                 { 
     120 
     121                string chaine = element.toString().toStdString(); 
     122                for (Table<Constant>::iterator it = m_localConstantTable->begin(); it != m_localConstantTable->end(); it++) 
     123                        { 
     124                                 
     125                                //cout << "Chaine dans la boucle: " << chaine << endl; 
     126                                if (chaine == it->getName()) 
     127                                chaine = it->getText().c_str(); 
     128                        } 
     129                                //cout << "Chaine aprÚs la boucle: " << chaine << endl; 
     130             //for (unsigned int i=0; i < localHeaderList->size(); i++ ) //Parcourt le vecteur de HatName en fonction de sa taille (nombre d'éléments) 
     131        //      { 
     132                         
     133                         
     134         
    123135                        //localConstantTable->find(hatFile)->getText();  
    124                         if (element.toString().toStdString() == localHeaderList->at(i)) //Teste si l'élément à supprimer dans defval est aussi dans hat 
    125                                 localHeaderList->erase(localHeaderList->begin() + i);//localHeaderList->begin() +i );    
    126                 } 
     136                        //Constant *constantForUptime; 
     137                        //chaine = m_localConstantTable->find(chaine)->getText(); 
     138                        //element.toString().toStdString(); 
     139                //      if (element.toString().toStdString() == localHeaderList->at(i)) //Teste si l'élément à supprimer dans defval est aussi dans hat 
     140                //              localHeaderList->erase(localHeaderList->begin() + i);//localHeaderList->begin() +i );    
     141        //      } 
     142                //ostringstream t << element.toString().toStdString(); 
     143                //string test = m_localConstantTable->find(element.toString().toStdString())->getText();         
    127144                 
    128145                emit rowIsDeleted(element.toString()); // signal emis lorsqu'une ligne est retirée du tableau.  
  • trunk/yao/src/interface/src/HatNameWindow.cpp

    r373 r389  
    117117                        string constantValue = localConstantTable->find(hatFile)->getText(); //"getText()" returns the constant value. 
    118118                        constantValue.append(".h"); 
    119                         m_hatnameModel->setItem(m_hatnameModel->rowCount(), new QStandardItem(QString(hatFile.c_str()))); 
    120                         localHeaderList->push_back(hatFile); 
     119                        m_hatnameModel->setItem(m_hatnameModel->rowCount(), new QStandardItem(QString(constantValue.c_str()))); 
     120                        localHeaderList->push_back(constantValue); 
    121121                        eraseDataFromLineEdit(); 
    122122                        m_delHatButton->setEnabled(true); 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r388 r389  
    7575         
    7676} 
     77 
    7778/******************************************* Implementation of the method setTitle() *****************************************************************/ 
    7879void MainWindow::setTitle() { 
     
    8384 
    8485/************************************ Implementation of the method createMenus() *******************************************************************/ 
    85  
    8686void MainWindow::createMenus() { 
    8787 
     
    447447 
    448448        theHeaderList.push_back(getProjectName() + ".h") ;  
    449  
    450449         
    451450} 
    452451 
    453452/*********************************** Implementation of the method activateToolBarButtons() *********************************************************/ 
    454  
    455453void MainWindow::activateToolBarButtons() { 
    456454 
     
    469467} 
    470468/********************************** Implementation of the method desactivateToolBarButtons() *******************************************************/ 
    471  
    472469void MainWindow::desactivateToolBarButtons() { 
    473470 
     
    565562        else 
    566563                return; 
    567  
    568564} 
    569565 
  • trunk/yao/src/interface/src/ModulWindow.cpp

    r384 r389  
    8989                if (it->isOutput()) 
    9090                        m_modulModel->setItem(row, 3, new QStandardItem(QString(intToString(it->getOutput()).c_str()))); /*!< Gets the  choosed in the space directive .*/ 
    91   
     91                if (it->isTarget())  
     92                        m_modulModel->setItem(row, 4, new QStandardItem(m_modulTargetCombo->itemText(it->getTarget()-1)));  
    9293           } 
    9394 
     
    110111        connect(m_modulOperaRadioButton, SIGNAL(toggled(bool )), m_modulSpaceCombo, SLOT(setDisabled(bool ))); 
    111112 
     113        connect(m_modulCoutCheckBox, SIGNAL(toggled(bool )), m_modulNowardCheckBox, SLOT(setChecked(bool ))); 
     114 
     115        connect(m_modulTempoCheckBox, SIGNAL(toggled(bool )), m_modulCovtCombo, SLOT(setDisabled(bool ))); 
     116        //connect(m_modulTempoCheckBox, SIGNAL(toggled(bool )), , SLOT(setDisabled(bool ))); 
    112117         
    113118        connect(m_buttonLoperaAdd, SIGNAL(clicked()), this, SLOT(addLoperaRow())); 
     119         
    114120         
    115121        connect(m_buttonLoperaDel, SIGNAL(clicked()), this, SLOT(deleteLoperaRow())); 
     
    132138        int row = m_modulModel->rowCount(); 
    133139 
     140        //modulname      
     141        if (modulName.empty()) 
     142                        { 
     143                                QMessageBox::critical(this, "Erreur", "Veuillez d'abord renseigner le champ \"nom module\"."); 
     144                                return; // Arrêt de la méthode 
     145                        } 
     146         
    134147        if ((m_modulSpaceRadioButton->isChecked()) && (!m_modulSpaceCombo->currentText().isEmpty())) 
    135148                modulParent = m_modulSpaceCombo->currentText().toStdString() ; 
     
    137150                if ((m_modulOperaRadioButton->isChecked()) && (!m_modulOperaCombo->currentText().isEmpty())) 
    138151                        modulParent = m_modulOperaCombo->currentText().toStdString() ; 
    139         //input and output attribut.     
     152        //input attribut.        
    140153        if(!input.empty())  
    141154                { 
     
    145158                                modulAttributs += "output " + output; 
    146159                }        
    147         // Target attribut. 
    148         if(!target.empty()) 
    149                  { 
    150                            
    151                          modulAttributs = "target " + target; 
    152                  }                
     160                       
     161        //output attribut.       
    153162        if (!(output.empty() && input.empty()) && modulName.empty()) 
    154163                        { 
     
    157166 
    158167                        } 
     168        // Target attribut. 
     169        if(!target.empty()) 
     170                 { 
     171                         modulAttributs = "target " + target; 
     172                 }  
    159173        // the modul parent must to be here. 
    160174        if (modulParent.empty())  
     
    164178 
    165179                } 
     180        if (m_modulTempoCheckBox->isChecked() && output.empty()) 
     181                { 
     182                        QMessageBox::critical(this, "Erreur", "Si target est coché, output doit-être obligatoirement renseigné."); 
     183                        return; // Arrêt de la méthode 
     184 
     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éthode 
     189                        } 
    166190 
    167191        if (!modulName.empty() && !modulParent.empty())  
     
    180204                                return; // Arrêt de la méthode 
    181205                        }  
    182                         if (!target.empty()) 
     206                        if (!target.empty() && (!output.empty())) 
    183207                                m_modulModel->setItem(row, 4, new QStandardItem(QString(target.c_str())));   
    184  
     208                         
    185209                if(m_modulNowardCheckBox->isChecked()) 
    186210                        { 
     
    200224                                        if (!output.empty()) 
    201225                                                mod1.setOutput(stringToInt(output)); 
    202                                         //if (!target.emty()) 
    203                                                 //mod1.setTarget(); 
     226                                        if (!target.empty()) 
     227                                                mod1.setTarget(intToShort(m_modulTargetCombo->currentIndex()) + 1); 
    204228                                        m_localModulTable->push_back(mod1); 
    205229 
     
    208232                                { 
    209233                                        Modul mod2(modulName, m_localOperaTable->find(modulParent), false);      
    210                                         m_localModulTable->push_back(mod2); 
    211234                                        if (!input.empty()) 
    212235                                                mod2.setInput(stringToInt(input)); 
    213236                                        if (!output.empty()) 
    214237                                                mod2.setOutput(stringToInt(output)); 
    215  
     238                                        if (!target.empty()) 
     239                                                mod2.setTarget(intToShort(m_modulTargetCombo->currentIndex()) + 1); 
    216240                                        m_localModulTable->push_back(mod2); 
    217241 
     
    346370      return atoi(s.c_str()); 
    347371} 
     372/**************************************** Implementation of intToShort(const int anInt) method. **************************************************/ 
     373const short ModulWindow::intToShort(const int anInt) { 
     374         
     375      return atoi(intToString(anInt).c_str()); 
     376} 
     377 
    348378/*************************************** Implementation of method. *******************************************************************************/ 
    349379/*QStringList ModulWindow::getModulData() { 
  • trunk/yao/src/interface/src/include/ModulWindow.hpp

    r384 r389  
    4545                const int stringToInt(const string& s); 
    4646                const short stringToShort(const string& s); 
     47                const short intToShort(const int anInt); 
    4748 
    4849        private: 
  • trunk/yao/src/interface/src/ui_/connectionwindow.ui

    r375 r389  
    4747      <x>500</x> 
    4848      <y>20</y> 
    49       <width>81</width> 
     49      <width>87</width> 
    5050      <height>95</height> 
    5151     </rect> 
     
    9595    <property name="autoDefault"> 
    9696     <bool>true</bool> 
    97     </property> 
    98    </widget> 
    99    <widget class="QGroupBox" name="groupBox_2"> 
    100     <property name="enabled"> 
    101      <bool>false</bool> 
    102     </property> 
    103     <property name="geometry"> 
    104      <rect> 
    105       <x>190</x> 
    106       <y>70</y> 
    107       <width>212</width> 
    108       <height>45</height> 
    109      </rect> 
    110     </property> 
    111     <property name="title"> 
    112      <string/> 
    11397    </property> 
    11498   </widget> 
     
    237221          <string/> 
    238222         </property> 
    239          <widget class="QWidget" name=""> 
     223         <widget class="QWidget" name="layoutWidget"> 
    240224          <property name="geometry"> 
    241225           <rect> 
    242226            <x>10</x> 
    243227            <y>8</y> 
    244             <width>191</width> 
     228            <width>202</width> 
    245229            <height>41</height> 
    246230           </rect> 
     
    283267          </layout> 
    284268         </widget> 
    285          <widget class="QWidget" name=""> 
     269         <widget class="QWidget" name="layoutWidget"> 
    286270          <property name="geometry"> 
    287271           <rect> 
    288272            <x>10</x> 
    289273            <y>60</y> 
    290             <width>191</width> 
     274            <width>202</width> 
    291275            <height>41</height> 
    292276           </rect> 
  • trunk/yao/src/interface/ui_newprojectwindow.h

    r387 r389  
    22** Form generated from reading UI file 'newprojectwindow.ui' 
    33** 
    4 ** Created: Mon Jul 19 16:25:13 2010 
     4** Created: Wed Jul 21 16:50:22 2010 
    55**      by: Qt User Interface Compiler version 4.6.3 
    66** 
Note: See TracChangeset for help on using the changeset viewer.