- Timestamp:
- 07/07/10 16:46:56 (14 years ago)
- Location:
- trunk/yao/src/interface
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/ConnectionWindow.cpp
r380 r381 21 21 22 22 /************************************************* Implementation of the construtor *******************************************************************/ 23 ConnectionWindow::ConnectionWindow(Table < Modul> *aModulTable, Table <Constant> *aConstantTable, QWidget *parent) : QWidget(parent), cpt(1) { /*!< The constructor. */23 ConnectionWindow::ConnectionWindow(Table <Connection> *aConnectionTable, Table <Modul> *aModulTable, Table <Constant> *aConstantTable, QWidget *parent) : QWidget(parent), cpt(1) { /*!< The constructor. */ 24 24 setupUi(this); 25 25 … … 28 28 m_localModulTable = aModulTable; 29 29 m_localConstantTable = aConstantTable; 30 m_localConnectionTable = aConnectionTable; 30 31 31 32 m_ctinModulInCombo->insertItem(0, ""); … … 92 93 for (Table<Constant>::reverse_iterator it = m_localConstantTable->rbegin(); it != m_localConstantTable->rend(); it++) 93 94 { 94 //int row = m_ctinModel->rowCount();95 96 95 m_ctinInCombo->insertItem(1, QString(it->getName().c_str())); 97 96 m_ctinIn2Combo->insertItem(1, QString(it->getName().c_str())); … … 110 109 } 111 110 111 for (Table<Connection>::reverse_iterator it = m_localConnectionTable->rbegin(); it != m_localConnectionTable->rend(); it++) 112 { 113 int row = m_ctinModel->rowCount(); 114 115 m_ctinModel->setItem(row, 0, new QStandardItem(QString(it->getName().c_str()))); /*!< Gets the name.*/ 116 } 117 118 119 112 120 m_ctinInCombo->insertItem(cpt, "..."); 113 121 m_ctinOutCombo->insertItem(cpt, "..."); … … 137 145 in2 = m_ctinModulInCombo->currentText().toStdString(), 138 146 in3 = m_ctinModulInCombo->currentText().toStdString(), 139 modulOut = m_ctinModulOutCombo->currentText().toStdString(); 147 modulOut = m_ctinModulOutCombo->currentText().toStdString(), 148 out = m_ctinOutCombo->currentText().toStdString(); 140 149 141 150 if (!modulIn.empty() && !modulOut.empty()) 142 151 { 143 152 m_ctinModel->setItem(row, 0, new QStandardItem(QString(modulIn.c_str()))); 153 if(!in.empty()) m_ctinModel->setItem(row, 1, new QStandardItem(QString(in.c_str()))); 144 154 m_ctinModel->setItem(row, 2, new QStandardItem(QString(modulOut.c_str()))); 155 if(!out.empty()) m_ctinModel->setItem(row, 3, new QStandardItem(QString(out.c_str()))); 156 m_localConnection.setInModule(modulIn); 157 m_localConnectionTable->push_back(m_localConnection); 145 158 } 146 159 -
trunk/yao/src/interface/src/ConstantWindow.cpp
r366 r381 77 77 m_delButton->setEnabled(true); 78 78 Constant localConstant (Nom.toStdString(), Val.toStdString()); 79 m_localConstantTable->push_back(localConstant); 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()*/) 81 82 { 83 cout << it->getName() << endl; 84 85 // else { 86 // QMessageBox::critical(this, "Avertissement", "Cet élément existe déjà !"); 87 // return; // Arrêt de la méthode 88 } 80 89 90 m_localConstantTable->push_back(localConstant); 81 91 m_defvalModel->setItem(m_defvalModel->rowCount(), 0, new QStandardItem(m_ligneNom->text())); 82 92 m_defvalModel->setItem(m_defvalModel->rowCount()-1, 1, new QStandardItem(m_ligneValeur->text()));//Apres le 1er ajout, la ligne vaut i+1 -
trunk/yao/src/interface/src/MainWindow.cpp
r378 r381 363 363 364 364 connect(m_spaceWindow, SIGNAL(spaceWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 365 connect(m_spaceWindow, SIGNAL(spaceRowIsAdded(bool)), m_modulButton, SLOT(setEnabled(bool))); 365 366 } 366 367 … … 375 376 376 377 connect(m_operaWindow, SIGNAL(operaWindowIsClosed(int )), this, SLOT(initializeWindow(int ))); 378 //connect(m_operaWindow, SIGNAL(operaRowIsAdded(bool)), m_modulButton, SLOT(setEnabled(bool))); 377 379 } 378 380 … … 406 408 407 409 if (m_ctinWindow == NULL) { //to test if the object is already created. 408 m_ctinWindow = new ConnectionWindow(&the ModulTable, &theConstantTable); //mwc.getCtin();410 m_ctinWindow = new ConnectionWindow(&theConnectionTable, &theModulTable, &theConstantTable); //mwc.getCtin(); 409 411 espace.addWindow(m_ctinWindow)->move(0, 0); 410 412 m_ctinWindow->show(); … … 459 461 m_operaButton->setEnabled(false); 460 462 m_netwardButton->setEnabled(true); 461 m_modulButton->setEnabled( true);463 m_modulButton->setEnabled(false); 462 464 m_ctinButton->setEnabled(true); 463 465 m_orderButton->setEnabled(true); -
trunk/yao/src/interface/src/ModulWindow.cpp
r380 r381 120 120 try { 121 121 string modulName = m_modulNameLine->text().toStdString() , 122 modulParent ,122 modulParent = "", 123 123 input = m_modulInputLine->text().toStdString(), 124 124 output = m_modulOutputLine->text().toStdString(), … … 153 153 154 154 } 155 156 157 158 if (!(modulName.empty() && modulParent.empty())) 155 // the modul parent must to be here. 156 if (modulParent.empty()) 157 { 158 QMessageBox::critical(this, "Erreur", "Veuillez renseigner la valeur du champ \"space or opera\"."); 159 return; // Arrêt de la méthode 160 161 } 162 163 if (!modulName.empty() && !modulParent.empty()) 159 164 { // !(false) => true if there are data in the lineEDit. 160 165 -
trunk/yao/src/interface/src/OperaWindow.cpp
r380 r381 191 191 modeleOpera->setItem(row, 3, new QStandardItem(m_operaTrajname->currentText())); 192 192 193 if (! (d1.empty() || d2.empty() || d3.empty())) {193 if (!d1.empty()) { 194 194 //Operator Opera(name, localTrajectoryTable->find(traj), theShape); 195 195 //Operator::Type M; 196 196 localOperaTable->push_back(Operator(name, localTrajectoryTable->find(traj), theShape, Operator::M)); 197 // emit operaRowIsAdded(true); 197 198 } 198 199 toInitialize(); -
trunk/yao/src/interface/src/SpaceWindow.cpp
r380 r381 115 115 dim = localConstantTable->find(d1)->getText(); 116 116 theShape.push_back(toInt(localConstantTable->find(d1)->getText())); 117 118 //emit spaceRowIsAdded(true); 117 119 118 120 } … … 131 133 dim = d1; 132 134 theShape.push_back(toInt(d1)); 135 //emit spaceRowIsAdded(true); 133 136 134 137 } … … 198 201 modeleSpace->setItem(row, 2, new QStandardItem(m_spaceTrajname->currentText())); 199 202 200 if (! (d1.empty() || d2.empty() || d3.empty())) {203 if (!d1.empty()) { 201 204 Space espace(name, localTrajectoryTable->find(traj), theShape); 202 205 localSpaceTable->push_back(espace); 206 emit spaceRowIsAdded(true); 203 207 } 204 208 -
trunk/yao/src/interface/src/include/ConnectionWindow.hpp
r380 r381 44 44 */ 45 45 46 ConnectionWindow(yao::Table <yao:: Modul> *aModulTable, yao::Table <yao::Constant> *aConstantTable, QWidget *parent=0);46 ConnectionWindow(yao::Table <yao::Connection> *aConnectionTable, yao::Table <yao::Modul> *aModulTable, yao::Table <yao::Constant> *aConstantTable, QWidget *parent=0); 47 47 QStringList getDataCtin(); /*!< This function returns the connexion's data. */ 48 48 void toInitialize(); … … 70 70 QStringList CtinData; 71 71 QStandardItemModel *m_ctinModel; 72 yao::Connection m_localConnection; 72 73 yao::Table <yao::Modul> *m_localModulTable; 74 yao::Table <yao::Connection> *m_localConnectionTable; 73 75 yao::Table <yao::Constant> *m_localConstantTable; 74 76 int cpt; -
trunk/yao/src/interface/src/include/MainWindow.hpp
r370 r381 22 22 #include <QStringList> 23 23 24 #include "ConnectionWindow.hpp"25 24 #include "HatNameWindow.hpp" 26 25 #include "ConstantWindow.hpp" … … 35 34 #include "ContextWindow.hpp" 36 35 #include "OrderWindow.hpp" 36 #include "ConnectionWindow.hpp" 37 37 #include "NewProjectWindow.hpp" 38 38 … … 236 236 std::string m_projectPath; 237 237 238 // Yao structures are follow: 238 239 yao::Constant m_theConstant; 239 240 yao::Table <yao::Constant> theConstantTable; -
trunk/yao/src/interface/src/include/OperaWindow.hpp
r360 r381 58 58 void saveInYaoStructure(); /*!< This function is called to add data in the Yao model. */ 59 59 void callOperaHelp(); 60 //void operaRowIsAdded(bool); 60 61 61 62 signals: -
trunk/yao/src/interface/src/include/SpaceWindow.hpp
r359 r381 63 63 signals: 64 64 void spaceWindowIsClosed(int anInt); 65 void spaceRowIsAdded(bool); 65 66 66 67 protected: -
trunk/yao/src/interface/ui_newprojectwindow.h
r366 r381 2 2 ** Form generated from reading UI file 'newprojectwindow.ui' 3 3 ** 4 ** Created: Mon Jun 28 16:52:1020104 ** Created: Tue Jul 6 16:37:01 2010 5 5 ** by: Qt User Interface Compiler version 4.6.2 6 6 **
Note: See TracChangeset
for help on using the changeset viewer.