Changeset 380 for trunk/yao


Ignore:
Timestamp:
07/06/10 15:27:19 (14 years ago)
Author:
yerima
Message:

Control on the d2 and d3 priority in space and opera window. Adding row is possible in the connection window.

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

Legend:

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

    r379 r380  
    131131        try 
    132132                { 
     133                        int row = m_ctinModel->rowCount();//To have the current row of the tableView. 
     134 
     135                        string modulIn   = m_ctinModulInCombo->currentText().toStdString(), 
     136                                in       = m_ctinInCombo->currentText().toStdString(), 
     137                                in2      = m_ctinModulInCombo->currentText().toStdString(), 
     138                                in3      = m_ctinModulInCombo->currentText().toStdString(), 
     139                                modulOut = m_ctinModulOutCombo->currentText().toStdString(); 
     140                 
     141                        if (!modulIn.empty() && !modulOut.empty())  
     142                                { 
     143                                        m_ctinModel->setItem(row, 0, new QStandardItem(QString(modulIn.c_str()))); 
     144                                        m_ctinModel->setItem(row, 2, new QStandardItem(QString(modulOut.c_str()))); 
     145                                }        
     146 
    133147                } 
    134148 
     
    138152                } 
    139153         
    140  
    141 /* 
    142  static int row = 0; 
    143   int l = 0; 
    144   QString texte = " from "; 
    145  
    146 QString comboline1 = comboBoxctin1->currentText(); 
    147 QString comboline2 = comboBoxctin2->currentText(); 
    148 QString comboline3 = comboBoxctin3->currentText(); 
    149 QString comboline4 = comboBoxctin4->currentText(); 
    150 //QString comboline5 = comboBoxctin1->currentText(); 
    151 //QString comboline1 = comboBoxctin1->currentText(); 
    152  
    153  
    154              for(int i = 0; i<comboline1.size(); i++) 
    155         //if (m_ligneNomTraj->text().isEmpty()) 
    156      if(!((comboline1.at(i) >= QChar('a')&& comboline1.at(i) <= QChar('z')) || (comboline1.at(i) >= QChar('A')&& comboline1.at(i) <= QChar('Z')) //-------- 
    157          || (comboline1.at(i) >= QChar('0')&& comboline1.at(i) <= QChar('9')) || (comboline1.at(i) == QChar('_')))) //|| (line1.isEmpty()) 
    158     { 
    159         QMessageBox::critical(this, "Erreur", "Veuillez entrer une valeur correcte pour le module entre1"); 
    160         return; // Arrêt de la méthode 
    161     } 
    162        for(int i1 = 0; i1<comboline2.size(); i1++) 
    163         //if (m_ligneNomTraj->text().isEmpty()) 
    164      if(!((comboline2.at(i1) >= QChar('0')&& comboline2.at(i1) <= QChar('9')))) //|| (line1.isEmpty()) 
    165     { 
    166         QMessageBox::critical(this, "Erreur", "Veuillez entrer une valeur correcte pour le module entre 2"); 
    167         return; // Arrêt de la méthode 
    168     } 
    169        for(int i3 = 0; i3<comboline3.size(); i3++)  
    170      if(!((comboline3.at(i3) >= QChar('0')&& comboline3.at(i3) <= QChar('9')))) //|| 
    171     { 
    172         QMessageBox::critical(this, "Erreur", "Veuillez entrer une valeur correcte pour le module sortie 2"); 
    173         return; // Arrêt de la méthode 
    174     } 
    175        for(int i4 = 0; i4<comboline4.size(); i4++) 
    176      if(!((comboline4.at(i4) >= QChar('a')&& comboline4.at(i4) <= QChar('z')) || (comboline4.at(i4) >= QChar('A')&& comboline4.at(i4) <= QChar('Z')) 
    177          || (comboline4.at(i4) >= QChar('0')&& comboline4.at(i4) <= QChar('9')) || (comboline4.at(i4) == QChar('_')))) //||  
    178     { 
    179         QMessageBox::critical(this, "Erreur", "Veuillez entrer une valeur correcte pour le module sortie 1"); 
    180         return; // Arrêt de la méthode 
    181     } 
    182         
    183   
    184        if ((comboBoxctin1->currentText().isEmpty()) || (comboBoxctin2->currentText().isEmpty()) || (comboBoxctin3->currentText().isEmpty()) || (comboBoxctin4->currentText().isEmpty()) || (comboBoxctin_i->currentText().isEmpty())) 
    185         { 
    186     QMessageBox::critical(this, "Erreur", "Il y a au moins un module d'entree non definie: entrer la valeur manquante SVP!!!!"); 
    187         return; // Arrêt de la méthode 
    188     } 
    189  
    190        else if ((comboBoxctin3->currentText().isEmpty()) || (comboBoxctin4->currentText().isEmpty())) 
    191         { 
    192     QMessageBox::critical(this, "Erreur", "Il y a au moins un module de sortie non definie: entrer la valeur manquante SVP!"); 
    193         return; // Arrêt de la méthode 
    194     } 
    195        else if (comboBoxctin_i->currentText().isEmpty()) 
    196         { 
    197     QMessageBox::critical(this, "Erreur", "La valeur de l'axe i est vide: entrer la valeur manquante SVP!"); 
    198         return; // Arrêt de la méthode 
    199     } 
    200  
    201 if (l >= 0) 
    202 { 
    203       
    204  
    205       tableWidgetctin1->setItem(row, 0, new QTableWidgetItem(comboBoxctin1->currentText())); 
    206       tableWidgetctin1->setItem(row, 1, new QTableWidgetItem(comboBoxctin2->currentText())); 
    207       tableWidgetctin1->setItem(row, 2, new QTableWidgetItem(comboBoxctin4->currentText())); 
    208       tableWidgetctin1->setItem(row, 3, new QTableWidgetItem(comboBoxctin3->currentText())); 
    209       tableWidgetctin1->setItem(row, 4, new QTableWidgetItem(comboBoxctin_i->currentText())); 
    210       tableWidgetctin1->setItem(row, 5, new QTableWidgetItem(comboBoxctin_j->currentText())); 
    211       tableWidgetctin1->setItem(row, 6, new QTableWidgetItem(comboBoxctin_k->currentText())); 
    212  
    213           CtinData.push_back(comboBoxctin1->currentText() + " " + comboBoxctin2->currentText() + texte + comboBoxctin4->currentText() + 
    214                                                           " " + comboBoxctin3->currentText() + " " + comboBoxctin_i->currentText() + 
    215                                                           " " + comboBoxctin_j->currentText() + " " + comboBoxctin_k->currentText() + 
    216                                                           " " + comboBoxctin_t->currentText());  
    217     row++; 
    218 //} 
    219         } 
    220 //writefileCtin(); 
    221  
    222 */ 
    223154} 
    224155/********************************************** Implementation of the deleteCtinRow() method  *********************************************************/ 
     
    227158        try 
    228159                { 
     160                        QItemSelectionModel *selection =m_ctinTableView->selectionModel(); 
     161                        index = selection->currentIndex(); 
     162                        QVariant element = m_ctinModel->data(index, Qt::DisplayRole); 
     163                        int r = index.row(); 
     164                        if (selection->hasSelection())// Permet de supprimer la ligne qui est selectionnée. Evite ainsi certains effets indesirables. 
     165                                  {    
     166                                        m_ctinModel->removeRows(m_ctinTableView->currentIndex().row(), 1); 
     167                                         //m_localModulTable->erase(m_localModulTable->begin() + r);  
     168                                          
     169                                         //if(isModulTableEmpty()) m_modulDelButton->setDisabled(true); 
     170                                } 
    229171                } 
    230172 
  • trunk/yao/src/interface/src/ModulWindow.cpp

    r379 r380  
    3434        QRegExp regExp("[A-Za-z_][A-Za-z1-9_]{0,}");  
    3535        m_modulNameLine->setValidator(new QRegExpValidator(regExp, this)); 
     36        QRegExp regExp2("[1-9]{0,}");  
     37        m_modulInputLine->setValidator(new QRegExpValidator(regExp2, this)); 
     38        m_modulOutputLine->setValidator(new QRegExpValidator(regExp2, this)); 
     39         
    3640        //Modul(&m_localModulName); 
    3741 
     
    107111        connect(m_buttonLoperaDel, SIGNAL(clicked()), this, SLOT(deleteLoperaRow())); 
    108112 
    109         setFixedWidth(baseSize().width() + 766); 
     113        setFixedWidth(baseSize().width() + 780); 
    110114 
    111115 
     
    143147                         modulAttributs = "target " + target; 
    144148                 }                
    145          
    146  
    147         if (!(modulName.empty() || modulParent.empty() )) { // !(false) => true if there are data in the lineEDit. 
    148          
    149                 m_modulModel->setItem(row, 0, new QStandardItem(QString(modulName.c_str())));   
    150                 m_modulModel->setItem(row, 1, new QStandardItem(QString(modulParent.c_str())));   
    151                 if (!input.empty()) 
    152                         {  
    153                                 m_modulModel->setItem(row, 2, new QStandardItem(QString(input.c_str())));   
    154                                 if (!output.empty())  
    155                                         m_modulModel->setItem(row, 3, new QStandardItem(QString(output.c_str()))); 
     149        if (!(output.empty() && input.empty()) && modulName.empty()) 
     150                        { 
     151                                QMessageBox::critical(this, "Erreur", "Veuillez d'abord renseigner le champ \"nom module\"."); 
     152                                return; // Arrêt de la méthode 
     153 
    156154                        } 
    157                 if (!(output.empty()) && (input.empty())) { 
    158                         QMessageBox::critical(this, "Erreur", "Veuillez préciser la valeur du champ \"input\"."); 
    159                         return; // Arrêt de la méthode 
    160                 }  
    161  
    162                 if (!target.empty()) 
     155 
     156 
     157 
     158        if (!(modulName.empty() && modulParent.empty()))  
     159                { // !(false) => true if there are data in the lineEDit. 
     160         
     161                        m_modulModel->setItem(row, 0, new QStandardItem(QString(modulName.c_str())));   
     162                        m_modulModel->setItem(row, 1, new QStandardItem(QString(modulParent.c_str())));   
     163                        if (!input.empty()) 
     164                                {  
     165                                        m_modulModel->setItem(row, 2, new QStandardItem(QString(input.c_str())));   
     166                                        if (!output.empty())  
     167                                                m_modulModel->setItem(row, 3, new QStandardItem(QString(output.c_str()))); 
     168                                } 
     169                        if (!(output.empty()) && (input.empty())) { 
     170                                QMessageBox::critical(this, "Erreur", "Veuillez préciser la valeur du champ \"input\"."); 
     171                                return; // Arrêt de la méthode 
     172                        }  
     173                        if (!target.empty()) 
    163174                                m_modulModel->setItem(row, 4, new QStandardItem(QString(target.c_str())));   
    164175 
     
    175186                if (!m_modulNowardCheckBox->isChecked ()) generateModulFile(modulName);                  
    176187        } 
    177  
     188        else  
     189                { 
     190                        QMessageBox::critical(this, "Erreur", "Veuillez renseigner le champ \"nom module\" ou \"space or opera\"."); 
     191                                 return; // Arrêt de la méthode 
     192 
     193                } 
    178194        toInitialize(); 
    179195        if (!isModulTableEmpty()) m_modulDelButton->setEnabled(true);    
     
    237253                { 
    238254 
    239 /*                       
    240            if (selection->hasSelection())// Permet de supprimer la ligne qui est selectionnée. Evite ainsi certains effets indesirables. 
    241             { 
    242                    modeleSpace->removeRows(m_spaceTableView->currentIndex().row(), 1); 
    243                    localSpaceTable->erase(localSpaceTable->begin() + r); 
    244   
    245            } 
    246   
    247          if (isSpaceTableEmpty()) m_spaceDeleteButton->setDisabled(true); 
    248 */ 
    249                         //QItemSelectionModel *selection = m_modulTableView->selectionModel(); 
    250                         //QModelIndex indexElementSelectionne = selection->currentIndex(); 
    251          
    252                         //int c = m_tableView->currentIndex().row();//renvoie le numero de la ligne selectionnée. 
    253255                        QItemSelectionModel *selection = m_modulTableView->selectionModel(); 
    254256                        index = selection->currentIndex(); 
     
    260262                                        m_localModulTable->erase(m_localModulTable->begin() + r);  
    261263     
    262                                         /*for (unsigned int i=0; i < localHeaderList->size(); i++ ) //Parcourt le vecteur de HatName en fonction de sa taille (nombre d'éléments) 
    263                                                 {    
    264                                                         //localConstantTable->find(hatFile)->getText();  
    265                                                         if (element.toString().toStdString() == localHeaderList->at(i)) //Teste si l'élément à supprimer dans defval est aussi dans hat 
    266                                                                 localHeaderList->erase(localHeaderList->begin() + i);//localHeaderList->begin() +i );    
    267                                                 }    
    268                                             */ 
    269                                         //emit rowIsDeleted(element.toString()); // signal emis lorsqu'une ligne est retirée du tableau.  
    270264                                        if(isModulTableEmpty()) m_modulDelButton->setDisabled(true); 
    271265                                }    
  • trunk/yao/src/interface/src/OperaWindow.cpp

    r377 r380  
    169169                theShape.push_back(toInt(d3)); 
    170170        } 
    171   
     171        //Priority between d2 and d3 dimension.  
     172        if (!d3.empty() && d2.empty()) 
     173                                {        
     174                                         QMessageBox::about(this, tr("Erreur de saisie!"), tr("<p> Veuillez renseigner le champ \"dimension 2\".")); 
     175                                          return; 
     176                                  
     177                                } 
     178         
     179 
    172180        if (name.empty()) {  
    173181                QMessageBox::about(this, tr("Operator: erreur de saisie."), 
  • trunk/yao/src/interface/src/SpaceWindow.cpp

    r379 r380  
    8484        setFixedWidth(baseSize().width() + 505); 
    8585} 
     86 
    8687//------------------------------------  End of the contructor declaration.--------------------------------------- 
    8788/*************************************  Implementation of function addSpaceRow *************************************************/ 
     
    176177                                                theShape.push_back(toInt(d3)); 
    177178                                        } 
     179                                //Priority between d2 and d3 dimension. 
     180                                if (!d3.empty() && d2.empty())  
     181                                { 
     182                                        QMessageBox::about(this, tr("Erreur de saisie!"), tr("<p> Veuillez renseigner le champ \"dimension 2\".")); 
     183                                         return; 
     184         
     185                                } 
     186 
    178187  
    179188                                if (name.empty()) {  
     
    198207                                                if (!isSpaceTableEmpty()) m_spaceDeleteButton->setEnabled(true); 
    199208                                        } 
    200                 } 
     209                                        } 
    201210 
    202211                catch(...) 
     
    211220      return atoi(s.c_str()); 
    212221} 
    213  
    214 /************************************* Implementation of function addRow **************************************************/ 
    215 //void SpaceWindow::addRow() { 
    216  
    217         //int row = m_spaceTableView->rowCount(); 
    218         //m_spaceTableView->insertRow(row); 
    219  
    220 //} 
    221222 
    222223/************************************** Implementation of function deleteRow **********************************************/ 
     
    266267 
    267268} 
     269 
    268270/****************************************************************************************************************************/ 
    269271bool SpaceWindow::isString(string aString) { 
     
    322324} 
    323325/***************************************************************************************************************************************************/ 
    324 /*********************************************** End of file. **************************************************************************************/ 
     326/**************************************************************** End of file. *********************************************************************/ 
    325327/***************************************************************************************************************************************************/ 
  • trunk/yao/src/interface/src/TrajectoryWindow.cpp

    r377 r380  
    265265       || (upTime.at(k) == QChar('E')) || (upTime.at(k) == QChar('e')))) { 
    266266 
    267                 QMessageBox::critical(this, "Erreur", "Nbuptime doit-être une valeur entiÚre."); 
     267                QMessageBox::critical(this, "Erreur", "uptime doit-être une valeur entiÚre."); 
    268268 
    269269                return; // Arrêt de la méthode  
  • trunk/yao/src/interface/src/include/ConnectionWindow.hpp

    r379 r380  
    6767 
    6868        private : 
    69  
     69                        QModelIndex index; 
    7070                        QStringList CtinData; 
    7171                        QStandardItemModel *m_ctinModel; 
  • trunk/yao/src/interface/src/ui_/modulwindow.ui

    r377 r380  
    489489      <x>10</x> 
    490490      <y>70</y> 
    491       <width>307</width> 
     491      <width>301</width> 
    492492      <height>29</height> 
    493493     </rect> 
Note: See TracChangeset for help on using the changeset viewer.