- Timestamp:
- 07/01/10 01:37:02 (14 years ago)
- Location:
- trunk/yao/src/interface/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/MainWindow.cpp
r370 r371 393 393 394 394 if (m_modulWindow == NULL) { //to test if the object is already created. 395 m_modulWindow = new ModulWindow(&theModulTable, &theSpaceTable, &theOperaTable, &theConstantTable, &the_mwc ); //mwc.getModul();395 m_modulWindow = new ModulWindow(&theModulTable, &theSpaceTable, &theOperaTable, &theConstantTable, &the_mwc, &m_newProjectName, &m_projectPath); //mwc.getModul(); 396 396 espace.addWindow(m_modulWindow)->move(30, 15); 397 397 m_modulWindow->show(); … … 487 487 m_newProjectWindow = new NewProjectWindow(espace); 488 488 m_newProjectName = m_newProjectWindow->getProjectName(); 489 m_projectPath = m_newProjectWindow->getProjectPath(); 489 490 theHeaderList.push_back(m_newProjectWindow->getProjectName() + ".h"); 490 491 fv->appelActualiser(); //Permet de mettre à jour automatiquement la liste des fichiers visibles dans filesviewer. … … 650 651 for (Table<Function>::iterator it = theFunctionTable.begin(); it != theFunctionTable.end(); it++) { 651 652 652 string aString = it->isParameterized()? "arg" : " ";653 string aString = it->isParameterized()? "arg" : " "; 653 654 description << "insert_fct " << aString << " " << it->getName() << endl; 654 655 } -
trunk/yao/src/interface/src/ModulWindow.cpp
r370 r371 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, 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) { 23 23 24 24 … … 28 28 m_localSpaceTable = aSpaceTable; 29 29 m_localOperaTable = anOperatorTable; 30 m_localProjectName = aProjectName; 31 m_localProjectPath = aProjectPath; 30 32 31 33 QRegExp regExp("[A-Za-z_][A-Za-z1-9_]{0,}"); … … 40 42 m_modulInter2Combo->setDisabled(true); 41 43 m_modulInter3Combo->setDisabled(true); 44 45 //cout << "voici le chemin du projet courant: " << endl << *m_localProjectPath + "/" + *m_localProjectName << endl; 42 46 43 47 if (isModulTableEmpty()) … … 157 161 modulParent = m_modulSpaceCombo->currentText().toStdString() ; 158 162 else 159 modulParent = m_modulOperaCombo->currentText().toStdString() ; 163 if (m_modulOperaRadioButton->isChecked()) 164 modulParent = m_modulOperaCombo->currentText().toStdString() ; 160 165 161 166 if (!(modulName.empty() || modulParent.empty() )) { … … 167 172 168 173 (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)); 169 174 175 generateModulFile(modulName); 170 176 } 171 177 // m_modulModel->setItem(row, 4, new QStandardItem(m_comboModulLopera->currentText())); … … 188 194 } 189 195 } 196 197 /***********************************************************************************************************/ 198 void ModulWindow::generateModulFile(string aFilename) 199 { 200 date = new QDateEdit; 201 date->setDate(QDate::currentDate()); 202 //string theFile ; 203 string path = *m_localProjectPath + "/" + *m_localProjectName + "/" + aFilename + ".h"; 204 ofstream theFile(path.c_str(), ios::out | ios::binary | ios::trunc); 205 if(!theFile.is_open()) 206 throw ofstream::failure("couldn't create " + path); 207 theFile << endl; 208 theFile << " Date: " << date->date().toString().toStdString().c_str() << " " << endl; 209 theFile << "//===========================================================================" << endl; 210 theFile << "forward () " << endl; 211 theFile << "{ " << 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 << "// methodes classe C: backward " << endl; 226 theFile << "//===========================================================================" << endl; 227 theFile << "backward () " << endl; 228 theFile << "{ " << 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 << "//************************** FIN DU MODULE C *******************************" << endl; 242 243 theFile.close(); 244 } 245 190 246 /**************************************** Implémentation de la méthode addLoperaRow() **************************************************************/ 191 247 void ModulWindow::addLoperaRow() { -
trunk/yao/src/interface/src/include/ModulWindow.hpp
r362 r371 4 4 #include "MainWindowController.hpp" 5 5 #include <QString> 6 #include <QDateEdit> 6 7 #include <QFileDialog> 7 8 #include <QStringListModel> … … 20 21 21 22 public : 22 ModulWindow(yao::Table <yao::Modul> *aModulTable, yao::Table <yao::Space> *aSpaceIdentifier, yao::Table <yao::Operator> *anOperatorTable, yao::Table <yao::Constant> *aConstantTable, MainWindowController *mwc, QWidget *parent=0);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); 23 24 24 25 void eraseDataFromLineEdit(); 25 bool isModulTableEmpty(); 26 bool isModulTableEmpty(); 27 void generateModulFile(string aFilename); 28 26 29 private slots: 27 30 … … 44 47 QModelIndex index; 45 48 QModelIndex m_loperaIndex; 49 std::string *m_localProjectPath; 50 std::string *m_localProjectName; 46 51 yao::Table <yao::Modul> *m_localModulTable; 47 52 std::vector<std::string> anVector; … … 50 55 yao::Table <yao::Operator> *m_localOperaTable; 51 56 MainWindowController *localMwc; 57 QDateEdit *date; 52 58 53 59 };
Note: See TracChangeset
for help on using the changeset viewer.