- Timestamp:
- 07/06/10 15:27:19 (14 years ago)
- Location:
- trunk/yao/src/interface/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/ConnectionWindow.cpp
r379 r380 131 131 try 132 132 { 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 133 147 } 134 148 … … 138 152 } 139 153 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éthode161 }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éthode168 }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éthode174 }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éthode181 }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éthode188 }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éthode194 }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éthode199 }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 */223 154 } 224 155 /********************************************** Implementation of the deleteCtinRow() method *********************************************************/ … … 227 158 try 228 159 { 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 } 229 171 } 230 172 -
trunk/yao/src/interface/src/ModulWindow.cpp
r379 r380 34 34 QRegExp regExp("[A-Za-z_][A-Za-z1-9_]{0,}"); 35 35 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 36 40 //Modul(&m_localModulName); 37 41 … … 107 111 connect(m_buttonLoperaDel, SIGNAL(clicked()), this, SLOT(deleteLoperaRow())); 108 112 109 setFixedWidth(baseSize().width() + 7 66);113 setFixedWidth(baseSize().width() + 780); 110 114 111 115 … … 143 147 modulAttributs = "target " + target; 144 148 } 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 156 154 } 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()) 163 174 m_modulModel->setItem(row, 4, new QStandardItem(QString(target.c_str()))); 164 175 … … 175 186 if (!m_modulNowardCheckBox->isChecked ()) generateModulFile(modulName); 176 187 } 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 } 178 194 toInitialize(); 179 195 if (!isModulTableEmpty()) m_modulDelButton->setEnabled(true); … … 237 253 { 238 254 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.253 255 QItemSelectionModel *selection = m_modulTableView->selectionModel(); 254 256 index = selection->currentIndex(); … … 260 262 m_localModulTable->erase(m_localModulTable->begin() + r); 261 263 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 hat266 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.270 264 if(isModulTableEmpty()) m_modulDelButton->setDisabled(true); 271 265 } -
trunk/yao/src/interface/src/OperaWindow.cpp
r377 r380 169 169 theShape.push_back(toInt(d3)); 170 170 } 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 172 180 if (name.empty()) { 173 181 QMessageBox::about(this, tr("Operator: erreur de saisie."), -
trunk/yao/src/interface/src/SpaceWindow.cpp
r379 r380 84 84 setFixedWidth(baseSize().width() + 505); 85 85 } 86 86 87 //------------------------------------ End of the contructor declaration.--------------------------------------- 87 88 /************************************* Implementation of function addSpaceRow *************************************************/ … … 176 177 theShape.push_back(toInt(d3)); 177 178 } 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 178 187 179 188 if (name.empty()) { … … 198 207 if (!isSpaceTableEmpty()) m_spaceDeleteButton->setEnabled(true); 199 208 } 200 }209 } 201 210 202 211 catch(...) … … 211 220 return atoi(s.c_str()); 212 221 } 213 214 /************************************* Implementation of function addRow **************************************************/215 //void SpaceWindow::addRow() {216 217 //int row = m_spaceTableView->rowCount();218 //m_spaceTableView->insertRow(row);219 220 //}221 222 222 223 /************************************** Implementation of function deleteRow **********************************************/ … … 266 267 267 268 } 269 268 270 /****************************************************************************************************************************/ 269 271 bool SpaceWindow::isString(string aString) { … … 322 324 } 323 325 /***************************************************************************************************************************************************/ 324 /*********************************************** End of file. **************************************************************************************/326 /**************************************************************** End of file. *********************************************************************/ 325 327 /***************************************************************************************************************************************************/ -
trunk/yao/src/interface/src/TrajectoryWindow.cpp
r377 r380 265 265 || (upTime.at(k) == QChar('E')) || (upTime.at(k) == QChar('e')))) { 266 266 267 QMessageBox::critical(this, "Erreur", " Nbuptime doit-être une valeur entiÚre.");267 QMessageBox::critical(this, "Erreur", "uptime doit-être une valeur entiÚre."); 268 268 269 269 return; // Arrêt de la méthode -
trunk/yao/src/interface/src/include/ConnectionWindow.hpp
r379 r380 67 67 68 68 private : 69 69 QModelIndex index; 70 70 QStringList CtinData; 71 71 QStandardItemModel *m_ctinModel; -
trunk/yao/src/interface/src/ui_/modulwindow.ui
r377 r380 489 489 <x>10</x> 490 490 <y>70</y> 491 <width>30 7</width>491 <width>301</width> 492 492 <height>29</height> 493 493 </rect>
Note: See TracChangeset
for help on using the changeset viewer.