- Timestamp:
- 07/01/10 19:57:54 (14 years ago)
- Location:
- trunk/yao/src/interface/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/ConnectionWindow.cpp
r356 r373 1 1 //! \file ConnectionWindow.cpp 2 2 //! \brief Implementation of the Ctin window. 3 //! \version 2010/0 6/21 (yyyy/mm/dd)3 //! \version 2010/07/01 (yyyy/mm/dd) 4 4 //! \author MAYAKI Abdouramane. 5 5 … … 31 31 m_ctinTableView->resizeColumnsToContents(); 32 32 33 // connect(pushButtonctin2, SIGNAL(clicked()), this, SLOT(appelSupp())); /*!< slot for the delete the object selected in the view*/ 34 // connect(m_AjoutCtin, SIGNAL(clicked()), this, SLOT(appelAjoutCtin())); /*!< This slot add the object in the view */ 35 // connect(m_AideCtin, SIGNAL(clicked()), this, SLOT(callCtinHelp())); /*!< This slot opens */ 36 // connect(m_quitButtonCtin, SIGNAL(clicked()), this, SLOT(close())); 33 connect(m_ctinAddButton, SIGNAL(clicked()), this, SLOT(addCtinRow())); /*!< This slot add the object in the view */ 34 connect(m_ctinDelButton, SIGNAL(clicked()), this, SLOT(deleteCtinRow())); /*!< slot for the delete the object selected in the view*/ 35 connect(m_ctinQuitButton, SIGNAL(clicked()), this, SLOT(close())); 36 connect(m_ctinHelpButton, SIGNAL(clicked()), this, SLOT(ctinHelp())); /*!< This slot opens */ 37 37 38 38 setFixedWidth(baseSize().width() + 615); … … 40 40 /**************************************** This function add the object in the view*************************************/ 41 41 /****************************************************************************************/ 42 /*void ConnectionWindow::appelAjoutCtin() {43 42 void ConnectionWindow::addCtinRow() { 43 /* 44 44 static int row = 0; 45 45 int l = 0; … … 123 123 initialiseCtin(); 124 124 125 }*/ 125 */ 126 } 126 127 /****************************************************************************************/ 127 /*void ConnectionWindow::appelSupp() { 128 void ConnectionWindow::deleteCtinRow() 129 { 128 130 129 tableWidgetctin1->removeRow(tableWidgetctin1->currentRow());130 131 131 } 132 */ 132 } 133 133 //******************************* Write in the .d file**********************************/ 134 134 … … 158 158 comboBoxctin_j->clearEditText(); 159 159 comboBoxctin_k->clearEditText(); 160 161 162 QMessageBox::about(this, tr("Aide sur la directive Ctin."), tr("Lâobjet de la connectivité est dâétablir lâéchange dâinformation entre modules.<b r> Chaque module possÚdant un certain nombre dâentrées et de sorties; les modules sont distribués dans lâespace-temps répérable par des coordonnées (i, j , k, t).<p> La connectivité doit donc permettre dâindiquer les liens entre les différentes entrées et sorties des modules selon leur point de coordonnée (notion de voisinage). <p>Pour plus d'informations sur la directive, <a href=\"help/ctin_aide.html\">cliquez ici.</a>")); 163 160 164 161 165 }*/ 162 166 //****************************************************************************************/ 163 /*void ConnectionWindow::callCtinHelp() {167 void ConnectionWindow::ctinHelp() { 164 168 165 QMessageBox::about(this, tr("Aide sur la directive Ctin."),("<p> Cette directive sert à établir des connections " 166 "entre les entrées et sorties des modules meme si ceux-ci appartiennent à des espaces " 167 "differents rattachés à des trajectoires différentes. <p><u>Exemple:</u> ctin Uphy 1 from Ufil 1 i j t-1 " 168 "<p>Pour plus d'informations sur la directive, <a href=\"help/ctin_aide.html\">cliquez ici.</a>")); 169 QMessageBox::about(this, tr("Aide sur la directive Ctin."),("<p> Lâobjet de la connectivité est dâétablir lâéchange dâinformation entre modules.<br> Chaque module possÚdant un certain nombre dâentrées et de sorties; les modules sont distribués dans lâespace-temps répérable par des coordonnées (i, j, k, t).<p> La connectivité doit donc permettre dâindiquer les liens entre les différentes entrées et sorties des modules selon leur point de coordonnée (notion de voisinage). <p> <u>Exemple:</u> modul Hfil space Soce input 3 output 1 tempo cout target " 170 "<p>Pour plus d'informations sur la directive ctin, <a href=\"help/ctin_aide.html\">cliquez ici.</a>")); 169 171 170 }*/ 172 173 } 171 174 172 175 /****************************************************************************************/ … … 175 178 emit ctinWindowIsClosed(9); 176 179 } 180 /************************************************************************************/ 181 /********************************* End of file. *************************************/ 182 /************************************************************************************/ -
trunk/yao/src/interface/src/HatNameWindow.cpp
r367 r373 101 101 void HatNameWindow::callHatHelp() { 102 102 103 QMessageBox::about(this, tr("Aide sur la directive hatname."),("<p> PremiÚre directive à déclarer obligatoirement dans tout projet Yao. Hatname permet d'intégrer en nombre limité dans le projet, les fichiers source.h. <p><u>Exemple</u>: hat_name nom_1 [nom_2 ...[nom_n]] <p> Pour plus d'informations sur la directive hatname, <a href=\"help/hatname_aide.html\">cliquez ici.</a> "));103 QMessageBox::about(this, tr("Aide sur la directive hatname."),("<p> PremiÚre directive à déclarer obligatoirement dans tout projet Yao. Hatname permet d'intégrer en nombre limité dans le projet, les fichiers source.h. <p><u>Exemple</u>: hat_name nom_1 [nom_2 ...[nom_n]] <p> Pour plus d'informations sur la directive hatname, <a href=\"help/hatname_aide.html\">cliquez ici.</a> ")); 104 104 105 105 //cout << "In callHelp method, my coodinate is " << x() << endl; -
trunk/yao/src/interface/src/ModulWindow.cpp
r372 r373 20 20 //! \brief Implementation of the Modul window for visual_YAO. 21 21 //ModulWindow::ModulWindow(QWidget *parent):QWidget(parent) { 22 ModulWindow::ModulWindow(Table <Modul> *aModulTable, Table <Space> *aSpaceTable, Table <Operator> *anOperatorTable, Table <Constant> *aConstantTable, MainWindowController *mwc, string *aProjectName, string *aProjectPath, QWidget *parent) : QWidget(parent), m_localModulTable(NULL) {22 ModulWindow::ModulWindow(Table <Modul> *aModulTable, Table <Space> *aSpaceTable, Table <Operator> *anOperatorTable, Table <Constant> *aConstantTable, MainWindowController *mwc, string *aProjectName, string *aProjectPath, QWidget *parent) : QWidget(parent), m_localModulTable(NULL) /*, Modul(m_localModulName, m_localModulParent, state)*/ { 23 23 24 24 … … 30 30 m_localProjectName = aProjectName; 31 31 m_localProjectPath = aProjectPath; 32 32 33 33 34 QRegExp regExp("[A-Za-z_][A-Za-z1-9_]{0,}"); 34 35 m_modulNameLine->setValidator(new QRegExpValidator(regExp, this)); 36 //Modul(&m_localModulName); 35 37 36 38 m_modulOperaCombo->setDisabled(true); … … 78 80 int row = m_modulModel->rowCount(); 79 81 80 //m_modulModel->setItem(row, 0, new QStandardItem(QString(it->getProperty(0).c_str()))); /*!< Gets the name.*/82 m_modulModel->setItem(row, 0, new QStandardItem(QString(it->getName().c_str()))); /*!< Gets the name.*/ 81 83 m_modulModel->setItem(row, 1, new QStandardItem(QString(it->getSpaceOrOperator().c_str()))); /*!< Gets the dimension (1, 2 or 3).*/ 82 84 //m_modulModel->setItem(row, 2, new QStandardItem(QString(it->getProperty(2).c_str()))); /*!< Gets the choosed in the space directive .*/ … … 147 149 //m_loperaListView 148 150 149 string modulName = m_modulNameLine->text().toStdString() ,151 string modulName = m_modulNameLine->text().toStdString() , 150 152 modulParent, 153 input = m_modulInputLine->text().toStdString(), 154 output = m_modulOutputLine->text().toStdString(), 151 155 modulAttributs; 152 156 … … 163 167 if (m_modulOperaRadioButton->isChecked()) 164 168 modulParent = m_modulOperaCombo->currentText().toStdString() ; 165 166 if (!(modulName.empty() || modulParent.empty() )) { 169 170 if(!input.empty()) 171 { 172 173 modulAttributs = "input " + input; 174 if(!output.empty()) 175 modulAttributs += "output " + output; 176 } 177 if (!(modulName.empty() || modulParent.empty() )) { // !(false) => true if there are data in the lineEDit. 167 178 168 179 m_modulModel->setItem(row, 0, new QStandardItem(QString(modulName.c_str()))); 169 180 m_modulModel->setItem(row, 1, new QStandardItem(QString(modulParent.c_str()))); 181 if (!input.empty()) 182 { 183 m_modulModel->setItem(row, 2, new QStandardItem(QString(input.c_str()))); 184 if (!output.empty()) 185 m_modulModel->setItem(row, 3, new QStandardItem(QString(output.c_str()))); 186 } 187 if (!(output.empty()) && (input.empty())) { 188 QMessageBox::critical(this, "Erreur", "Veuillez préciser la valeur du champ \"input\"."); 189 return; // Arrêt de la méthode 190 } 170 191 // m_modulModel->setItem(row, 2, new QStandardItem(m_modulAutonetCombo->currentText())); 171 192 // m_modulModel->setItem(row, 3, new QStandardItem(m_comboModulClonof->currentText())); … … 173 194 (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)); 174 195 175 generateModulFile(modulName);196 if (!m_modulNowardCheckBox->isChecked ()) generateModulFile(modulName); 176 197 } 177 198 // m_modulModel->setItem(row, 4, new QStandardItem(m_comboModulLopera->currentText())); … … 186 207 //m_modulArrayCheckBox->isChecked()?m_modulModel->setItem(row, 12, new QStandardItem("oui")):m_modulModel->setItem(row, 12, new QStandardItem("non")); 187 208 188 eraseDataFromLineEdit();209 toInitialize(); 189 210 if (!isModulTableEmpty()) m_modulDelButton->setEnabled(true); 190 211 } … … 193 214 cout << "Erreur dans la methode addModulRow" << endl; 194 215 } 195 eraseDataFromLineEdit(); 196 } 197 198 /************************************ Implementation of generateModulFile(string aFilename) method. *************************************************/ 199 void ModulWindow::generateModulFile(string aFilename) 200 { 201 date = new QDateEdit; 202 date->setDate(QDate::currentDate()); 203 //string theFile ; 204 string path = *m_localProjectPath + "/" + *m_localProjectName + "/" + aFilename + ".h"; 205 ofstream theFile(path.c_str(), ios::out | ios::binary | ios::trunc); 206 if(!theFile.is_open()) 207 throw ofstream::failure("couldn't create " + path); 208 theFile << endl; 209 theFile << " Date: " << date->date().toString().toStdString().c_str() << " " << endl; 210 theFile << "//===========================================================================" << endl; 211 theFile << "forward () " << endl; 212 theFile << "{ " << endl; 213 theFile << endl; 214 theFile << endl; 215 theFile << endl; 216 theFile << endl; 217 theFile << endl; 218 theFile << endl; 219 theFile << endl; 220 theFile << endl; 221 theFile << endl; 222 theFile << endl; 223 theFile << "} " << endl; 224 theFile << endl; 225 theFile << "//===========================================================================" << endl; 226 theFile << "// methodes classe C: backward " << endl; 227 theFile << "//===========================================================================" << endl; 228 theFile << "backward () " << endl; 229 theFile << "{ " << endl; 230 theFile << endl; 231 theFile << endl; 232 theFile << endl; 233 theFile << endl; 234 theFile << endl; 235 theFile << endl; 236 theFile << endl; 237 theFile << endl; 238 theFile << endl; 239 theFile << endl; 240 theFile << "} " << endl; 241 theFile << "//===========================================================================" << endl; 242 theFile << "//************************** FIN DU MODULE C *******************************" << endl; 243 244 theFile.close(); 245 } 216 toInitialize(); 217 } 218 219 246 220 247 221 /**************************************** Implémentation de la méthode addLoperaRow() **************************************************************/ 248 222 void ModulWindow::addLoperaRow() { 249 223 250 m_loperaModel->appendRow(new QStandardItem(m_ comboModulLopera->currentText()));251 m_ comboModulLopera->setCurrentIndex(0);224 m_loperaModel->appendRow(new QStandardItem(m_modulLoperaCombo->currentText())); 225 m_modulLoperaCombo->setCurrentIndex(0); 252 226 } 253 227 … … 266 240 //if(isHeaderListEmpty()) m_delHatButton->setDisabled(true); 267 241 } 268 //cout << "Salut" << endl; 269 } 270 /************************************* Implémentation de la méthode eraseDataFromLineEdit() ***********************************************************/ 271 void ModulWindow::eraseDataFromLineEdit() { 242 } 243 /************************************* Implémentation de la méthode toInitialize() ***********************************************************/ 244 void ModulWindow::toInitialize() { 272 245 273 246 m_modulNameLine->setText(""); 247 m_modulInputLine->setText(""); 248 m_modulOutputLine->setText(""); 274 249 m_modulSpaceCombo->setCurrentIndex(0); 275 250 m_modulOperaCombo->setCurrentIndex(0); 276 /*m_modulAutonetCombo->setCurrentIndex(0);277 m_ comboModulClonof->setCurrentIndex(0);278 m_ comboModulLopera->setCurrentIndex(0);279 m_ checkBoxNoward->setChecked(false);280 m_ checkBoxTempo->setChecked(false);281 m_m _modulCoutCheckBox->setChecked(false);282 m_ checkBoxSpec->setChecked(false);283 m_ checkBoxNetward->setChecked(false);284 m_ checkBoxModulHidjac->setChecked(false);285 m_ checkBoxModulManage->setChecked(false);251 m_modulAutonetCombo->setCurrentIndex(0); 252 m_modulClonofCombo->setCurrentIndex(0); 253 m_modulLoperaCombo->setCurrentIndex(0); 254 m_modulNowardCheckBox->setChecked(false); 255 m_modulTempoCheckBox->setChecked(false); 256 m_modulCoutCheckBox->setChecked(false); 257 m_modulSpecCheckBox->setChecked(false); 258 m_modulNetwardCheckBox->setChecked(false); 259 m_modulHidjacCheckBox->setChecked(false); 260 m_modulManageCheckBox->setChecked(false); 286 261 m_modulArrayCheckBox->setChecked(false); 287 */262 288 263 } 289 264 /*************************************** Implémentation de la méthode deleteModulRow ****************************************************************/ … … 351 326 } 352 327 */ 353 /****************************************************************************************************************************/ 354 355 /*bool ModulWindow::testContenu(int anInt) { 356 357 if (anInt != 0) { 358 m_modulDelButton->setEnabled(true); 359 //m_enregModul->setEnabled(true); 360 361 return true; 362 363 } 364 else 365 { 366 m_modulDelButton->setDisabled(true); 367 //m_enregModul->setDisabled(true); 368 369 return false; 370 } 371 }*/ 328 /************************************ Implementation of generateModulFile(string aFilename) method. *************************************************/ 329 void ModulWindow::generateModulFile(string aFilename) 330 { 331 date = new QDateEdit; 332 date->setDate(QDate::currentDate()); 333 //string theFile ; 334 string path = *m_localProjectPath + "/" + *m_localProjectName + "/" + aFilename + ".h"; 335 ofstream theFile(path.c_str(), ios::out | ios::binary | ios::trunc); 336 if(!theFile.is_open()) 337 throw ofstream::failure("couldn't create " + path); 338 theFile << endl; 339 theFile << " Date: " << date->date().toString().toStdString().c_str() << " " << endl; 340 theFile << "//===========================================================================" << endl; 341 theFile << "forward () " << endl; 342 theFile << "{ " << endl; 343 theFile << endl; 344 theFile << endl; 345 theFile << endl; 346 theFile << endl; 347 theFile << endl; 348 theFile << endl; 349 theFile << endl; 350 theFile << endl; 351 theFile << endl; 352 theFile << endl; 353 theFile << "} " << endl; 354 theFile << endl; 355 theFile << "//===========================================================================" << endl; 356 theFile << "// methodes classe C: backward " << endl; 357 theFile << "//===========================================================================" << endl; 358 theFile << "backward () " << endl; 359 theFile << "{ " << endl; 360 theFile << endl; 361 theFile << endl; 362 theFile << endl; 363 theFile << endl; 364 theFile << endl; 365 theFile << endl; 366 theFile << endl; 367 theFile << endl; 368 theFile << endl; 369 theFile << endl; 370 theFile << "} " << endl; 371 theFile << "//===========================================================================" << endl; 372 theFile << "//************************** FIN DU MODULE C *******************************" << endl; 373 374 theFile.close(); 375 } 376 372 377 /****************************************************************************************************************************/ 373 378 void ModulWindow::callModulHelp() { -
trunk/yao/src/interface/src/include/ConnectionWindow.hpp
r364 r373 2 2 * \file ConnectionWindow.hpp 3 3 * \brief Ctin class for visual_YAO. 4 * \version 2010/0 6/21 (yyyy/mm/dd)4 * \version 2010/07/01 (yyyy/mm/dd) 5 5 * \author MAYAKI Abdouramane. 6 6 */ … … 12 12 #include "../../../YAOObjects/Table.hpp" 13 13 #include "../../../YAOObjects/Connection.hpp" 14 #include <QTextCodec> 14 15 #include <QFileDialog> 15 16 #include <QMessageBox> … … 35 36 36 37 public : 37 38 /*! 38 39 * \brief Constructor 39 40 * Constructor of the class ConnectionWindow 40 41 * \param parent : initialized at zero. 41 42 */ 42 43 44 43 ConnectionWindow(QWidget *parent=0); 44 QStringList getDataCtin(); /*!< This function returns the connexion's data. */ 45 void initialiseCtin(); 45 46 46 private slots: /*!< Functions called after a click. */ 47 47 private slots: /*!< Functions called after a click. */ 48 49 void ctinHelp(); 50 void addCtinRow(); 51 void deleteCtinRow(); 48 52 49 53 signals: 50 void ctinWindowIsClosed(int anInt);54 void ctinWindowIsClosed(int anInt); 51 55 52 56 protected: 53 void closeEvent(QCloseEvent *event);57 void closeEvent(QCloseEvent *event); 54 58 55 59 private : 56 60 57 QStringList CtinData;58 QStandardItemModel *m_ctinModel;61 QStringList CtinData; 62 QStandardItemModel *m_ctinModel; 59 63 60 64 -
trunk/yao/src/interface/src/include/ModulWindow.hpp
r371 r373 16 16 17 17 18 class ModulWindow: public QWidget, public Ui::ModulWindow {18 class ModulWindow: public QWidget, public Ui::ModulWindow/*, public yao::Modul*/ { 19 19 20 20 Q_OBJECT … … 23 23 ModulWindow(yao::Table <yao::Modul> *aModulTable, yao::Table <yao::Space> *aSpaceIdentifier, yao::Table <yao::Operator> *anOperatorTable, yao::Table <yao::Constant> *aConstantTable, MainWindowController *mwc, std::string *aProjectName, std::string *aProjectPath, QWidget *parent=0); 24 24 25 void eraseDataFromLineEdit();26 25 bool isModulTableEmpty(); 27 void generateModulFile(string aFilename);26 void toInitialize(); 28 27 29 28 private slots: … … 41 40 protected: 42 41 void closeEvent(QCloseEvent *event); 42 void generateModulFile(string aFilename); 43 43 44 44 private: 45 45 46 QStandardItemModel *m_modulModel; 46 47 QStandardItemModel *m_loperaModel; 47 48 QModelIndex index; 48 49 QModelIndex m_loperaIndex; 50 51 std::string m_localModulName; 52 std::string m_localModulParent; 53 54 bool state; 55 49 56 std::string *m_localProjectPath; 50 57 std::string *m_localProjectName; -
trunk/yao/src/interface/src/ui_/modulwindow.ui
r367 r373 59 59 <x>10</x> 60 60 <y>110</y> 61 <width> 161</width>61 <width>201</width> 62 62 <height>111</height> 63 63 </rect> … … 69 69 <widget class="QLabel" name="label_2"> 70 70 <property name="text"> 71 <string>Entrée </string>71 <string>Entrée (input)</string> 72 72 </property> 73 73 <property name="buddy"> … … 99 99 <widget class="QLabel" name="label_3"> 100 100 <property name="text"> 101 <string>Sortie </string>101 <string>Sortie (outpu)</string> 102 102 </property> 103 103 <property name="buddy"> … … 137 137 </item> 138 138 <item> 139 <spacer name="horizontalSpacer"> 140 <property name="orientation"> 141 <enum>Qt::Horizontal</enum> 142 </property> 143 <property name="sizeHint" stdset="0"> 144 <size> 145 <width>50</width> 146 <height>20</height> 147 </size> 148 </property> 149 </spacer> 150 </item> 151 <item> 139 152 <widget class="QComboBox" name="m_modulTargetCombo"/> 140 153 </item> … … 146 159 <property name="geometry"> 147 160 <rect> 148 <x> 190</x>149 <y>11 0</y>161 <x>220</x> 162 <y>111</y> 150 163 <width>61</width> 151 <height> 22</height>164 <height>31</height> 152 165 </rect> 153 166 </property> … … 416 429 </property> 417 430 <property name="buddy"> 418 <cstring>m_ comboModulLopera</cstring>419 </property> 420 </widget> 421 </item> 422 <item> 423 <widget class="QComboBox" name="m_ comboModulLopera"/>431 <cstring>m_modulLoperaCombo</cstring> 432 </property> 433 </widget> 434 </item> 435 <item> 436 <widget class="QComboBox" name="m_modulLoperaCombo"/> 424 437 </item> 425 438 </layout> … … 476 489 <x>10</x> 477 490 <y>70</y> 478 <width>30 7</width>491 <width>301</width> 479 492 <height>29</height> 480 493 </rect> … … 594 607 <tabstops> 595 608 <tabstop>m_modulNameLine</tabstop> 609 <tabstop>m_modulSpaceRadioButton</tabstop> 610 <tabstop>m_modulSpaceCombo</tabstop> 596 611 <tabstop>m_modulOperaRadioButton</tabstop> 612 <tabstop>m_modulOperaCombo</tabstop> 597 613 <tabstop>m_modulInputLine</tabstop> 598 614 <tabstop>m_modulArrayCheckBox</tabstop> … … 613 629 <tabstop>m_modulCovtCombo</tabstop> 614 630 <tabstop>m_modulClonofCombo</tabstop> 615 <tabstop>m_ comboModulLopera</tabstop>631 <tabstop>m_modulLoperaCombo</tabstop> 616 632 <tabstop>m_buttonLoperaAdd</tabstop> 617 633 <tabstop>m_buttonLoperaDel</tabstop> 618 <tabstop>m_loperaListView</tabstop>619 634 <tabstop>m_modulAddButton</tabstop> 620 635 <tabstop>m_modulDelButton</tabstop> 621 636 <tabstop>m_modulQuitButton</tabstop> 637 <tabstop>m_modulHelpButton</tabstop> 638 <tabstop>m_loperaListView</tabstop> 622 639 <tabstop>m_modulTableView</tabstop> 623 <tabstop>m_modulHelpButton</tabstop>624 640 </tabstops> 625 641 <resources/>
Note: See TracChangeset
for help on using the changeset viewer.