Changeset 71
- Timestamp:
- 12/11/09 12:44:01 (15 years ago)
- Location:
- trunk/yao/src/interface/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/DefvalWindow.cpp
r67 r71 163 163 164 164 /****************************************************************************************/ 165 void DefvalWindow::ouvrirProjetExistant() { 166 167 fd = new QFileDialog(this); 168 QStringList filtres; 169 170 fd->setDirectory("."); 171 fd->setFileMode (QFileDialog::AnyFile); 172 filtres << "*.*" 173 << "Tous les fichiers (*.*)"; 174 fd->setFilters(filtres); 175 176 lstF = fd->getSaveFileName(); 177 } 178 /****************************************************************************************************************************/ 179 QStringList DefvalWindow::getDataDefval() { 180 181 return DefvalData; 182 } 183 184 185 /****************************************************************************************/ 165 186 /*void DefvalWindow::ecrireFichier() 166 187 { … … 180 201 }*/ 181 202 182 /****************************************************************************************/ 183 void DefvalWindow::ouvrirProjetExistant() { 184 185 fd = new QFileDialog(this); 186 QStringList filtres; 187 188 fd->setDirectory("."); 189 fd->setFileMode (QFileDialog::AnyFile); 190 filtres << "*.*" 191 << "Tous les fichiers (*.*)"; 192 fd->setFilters(filtres); 193 194 lstF = fd->getSaveFileName(); 195 } 196 /****************************************************************************************************************************/ 197 QStringList DefvalWindow::getDataDefval() { 198 199 200 return DefvalData; 201 } 202 203 /****************************************************************************************/ 204 203 204 /****************************************************************************************/ 205 -
trunk/yao/src/interface/src/HatNameWindow.cpp
r67 r71 6 6 7 7 /*************************************** Implémentation du constructeur **************************************************/ 8 HatNameWindow::HatNameWindow( vector<string> *theHeaderList,string projectName, QWidget *parent): QWidget(parent) {8 HatNameWindow::HatNameWindow(string projectName, QWidget *parent): QWidget(parent) { 9 9 10 setTheHeaderList(theHeaderList);10 //setTheHeaderList(theHeaderList); 11 11 localProjectName = projectName + ".h"; 12 12 //hatHeaderList = theHeaderList; … … 19 19 m_comboHatName = new QComboBox(this); //Champ de selection d'une constante 20 20 m_boutonAjouter = new QPushButton("Ajouter", this); //Déclaration du bouton "ajouter" 21 m_enregHatName = new QPushButton("Enregistrer", this);21 //m_enregHatName = new QPushButton("Enregistrer", this); 22 22 m_supHatName = new QPushButton("Supprimer", this) ; //Déclaration du bouton "supprimmer" 23 23 m_boutonouvrir = new QPushButton(this); //Déclaration du bouton "ouvrir" permettant de selectionner un fichier. … … 30 30 //m_boutonouvrir->setGeometry(1,1,1,1); 31 31 m_boutonouvrir->raise(); 32 m_quitHatName = new QPushButton(" Quitter", this); //Déclaration du bouton "Enreg. et quitter"32 m_quitHatName = new QPushButton("Enreg. et quitter", this); //Déclaration du bouton "Enreg. et quitter" 33 33 34 34 m_layoutH1HatName = new QHBoxLayout; // Un gestionnaire horizontal contenant: 35 m_layoutH1HatName->addWidget(m_enregHatName);35 //m_layoutH1HatName->addWidget(m_enregHatName); 36 36 m_layoutH1HatName->addWidget(m_supHatName); //le bouton supprimer 37 37 m_layoutH1HatName->addWidget(m_quitHatName);//et le bouton quitter … … 39 39 m_layoutH2HatName = new QHBoxLayout ; // Un gestionnaire horizontal contenant: 40 40 m_layoutH2HatName->addWidget(m_comboHatName); //(1): Un afficheur de texte. 41 m_layoutH2HatName->addItem(m_spacer); //(2): Un champ de saisie du nom du projet.41 //m_layoutH2HatName->addItem(m_spacer); //(2): Un champ de saisie du nom du projet. 42 42 m_layoutH2HatName->addWidget(m_boutonouvrir); //(3): Un bouton "ouvrir" permettant de selectionner un fichier stocké. 43 43 44 44 m_layoutModelHatName = new QVBoxLayout ; //Gestionnaire principal de la fenetre. 45 //string test = projectName; 46 //setFileList(projectName + ".h"); 47 //for(vector<string>::iterator it = hatHeaderList.begin(); it != hatHeaderList.end(); it++) 48 listeFichiers << localProjectName.c_str(); 45 for(QStringList::iterator it = listeFichiers.begin(); it != listeFichiers.end(); it++) 46 listeFichiers << *it;//localProjectName.c_str(); 49 47 //listeFichiers.append(it.c_str()); 50 48 modeleFichiers = new QStringListModel(listeFichiers); 51 52 49 53 50 //m_layoutV1HatName->addWidget(m_boutonAjouter); … … 60 57 m_layoutH3HatName->addWidget(m_boutonAjouter); 61 58 62 m_layout1HatName 59 m_layout1HatName = new QFormLayout ; 63 60 m_layout1HatName->addRow(m_texte); 64 61 m_layout1HatName->addRow(m_layoutH2HatName); … … 76 73 77 74 connect(m_quitHatName, SIGNAL(clicked()), this, SLOT(close())); 78 connect(m_supHatName, SIGNAL(clicked()), this, SLOT( appelSup()));75 connect(m_supHatName, SIGNAL(clicked()), this, SLOT(deleteHatRow())); 79 76 connect(m_boutonouvrir , SIGNAL(clicked()), this, SLOT(ouvrirProjetExistant())); 80 77 connect(m_quitHatName, SIGNAL(clicked()), this, SLOT(ecrireFichier())); 81 78 connect(m_enregHatName, SIGNAL(clicked()), this, SLOT(appelEnregistrer())); 82 connect(m_boutonAjouter, SIGNAL(clicked()), this, SLOT(a ppelAjout()));79 connect(m_boutonAjouter, SIGNAL(clicked()), this, SLOT(addHatRow())); 83 80 } 84 81 … … 94 91 return m_comboHatName->currentText().toStdString(); 95 92 } 96 /************************************ Implémentation de la méthode appelEnregistrer() ************************************/97 void HatNameWindow::appelEnregistrer() {98 //hatHeaderList->clear();99 //listeFichiers.removeFirst();100 for(QStringList::iterator it=listeFichiers.begin(); it!=listeFichiers.end(); it++)101 hatHeaderList.push_back(it->toStdString());102 }103 104 93 /************************************** Implémentation de la méthode setFileList *****************************************/ 105 94 void HatNameWindow::setFileList(string localString) { … … 114 103 /****************************************************************************************/ 115 104 116 void HatNameWindow::a ppelAjout() {105 void HatNameWindow::addHatRow() { 117 106 118 107 hatFile = getNomFichierHat(); … … 143 132 hatFile.append(".h"); 144 133 QString fichier = hatFile.c_str(); 145 //setFileList();146 //listeFichiers.removeFirst();147 134 listeFichiers.append(fichier); 148 135 … … 161 148 } 162 149 163 QString fichier = hatFile.c_str();164 listeFichiers.append(fichier);165 166 modeleFichiers->setStringList(listeFichiers);167 testPresenceFichier();168 169 170 150 initialiserChamps(); 171 151 } 172 152 173 153 /****************************************************************************************/ 174 void HatNameWindow:: appelSup() {154 void HatNameWindow::deleteHatRow() { 175 155 176 156 QItemSelectionModel *selection = vueFichiers->selectionModel(); … … 190 170 } 191 171 192 /****************************************************************************************/ 193 void HatNameWindow::ecrireFichier() 194 { 195 QFile file(cheminFichier); 196 /*if (!file.open(QIODevice::Append)) { 197 std::cerr << "Ouverture impossible en écriture: " 198 << qPrintable(file.errorString()) << std::endl; 199 200 }*/ 201 202 //QTextStream out(&file); 203 172 /************************************ Implémentation de la méthode appelEnregistrer() ************************************/ 173 void HatNameWindow::appelEnregistrer() { 174 //hatHeaderList->clear(); 175 //listeFichiers.removeFirst(); 176 for(QStringList::iterator it=listeFichiers.begin(); it!=listeFichiers.end(); it++) 177 hatHeaderList.push_back(it->toStdString()); 204 178 } 205 179 … … 223 197 vector<string> HatNameWindow::getTheHeaderList() { 224 198 225 hatHeaderList.push_back("test");199 //hatHeaderList.push_back("test"); 226 200 return hatHeaderList; 227 201 } 228 202 229 203 /****************************************************************************************/ 230 void HatNameWindow::setTheHeaderList(vector<string> *theHeaderList) { 231 232 233 204 void HatNameWindow::setTheHeaderList(string theHeaderList) { 205 206 hatHeaderList.push_back(theHeaderList); 234 207 } 235 208 /****************************************************************************************/ 209 QStringList HatNameWindow::getHatName() 210 { 211 return listeFichiers; 212 } 213 -
trunk/yao/src/interface/src/Include/HatNameWindow.h
r66 r71 2 2 #define HATNAME_H 3 3 4 //#include <iostream>5 //#include <QWidget>6 //#include <QTextStream>7 4 #include <QVBoxLayout> 8 5 #include <QPushButton> … … 12 9 #include <QStandardItemModel> 13 10 #include <QTableWidget> 14 //#include <QString>15 11 #include <QMessageBox> 16 12 #include <QFileDialog> … … 18 14 #include <QStringListModel> 19 15 #include <QComboBox> 20 //#include <QIODevice>21 16 #include <QStringList> 22 17 #include <QSpacerItem> … … 45 40 */ 46 41 47 HatNameWindow(std:: vector<std::string> *theHeaderList, std::string projectName = NULL, QWidget *parent=0);42 HatNameWindow(std::string projectName = NULL, QWidget *parent=0); 48 43 void setNomFichierHat(QString nomFichierHat); /*!< This function sets the file's name. */ 49 44 std::string getNomFichierHat(); /*!< This function returns the fil's name */ 50 45 void testPresenceFichier(); 51 46 QStringList getHatName(); 52 47 /*! 53 48 * \brief SLOT functions … … 60 55 public slots : 61 56 62 void a ppelAjout();/*!< This function is called to insert data in the model. */63 void appelSup();/*!< This function is called to delete data from the model. */57 void addHatRow(); /*!< This function is called to insert data in the model. */ 58 void deleteHatRow(); /*!< This function is called to delete data from the model. */ 64 59 void initialiserChamps(); /*!< This function is called to initialize the lineEdit. */ 65 void ecrireFichier(); /*!< This function is called to write data in file model. */60 //void ecrireFichier(); /*!< This function is called to write data in file model. */ 66 61 void ouvrirProjetExistant(); /*!< This function is called to open an existing project. */ 67 62 void appelEnregistrer(); /*!< This function is called to save the current project in the file model */ 68 63 void setFileList(std::string localString); 69 void setTheHeaderList(std:: vector<std::string> *theHeaderList);64 void setTheHeaderList(std::string theHeaderList); 70 65 std::vector<std::string> getTheHeaderList(); 71 72 66 /*! 73 67 * \brief private functions -
trunk/yao/src/interface/src/Include/MainWindowController.h
r67 r71 26 26 public : 27 27 MainWindowController(); 28 29 void setDefval(); 28 30 DefvalWindow *getDefval(); 29 void setDefval(); 30 void setProjectName(std::string projectName); 31 std::string getProjectName(); 31 32 void setProjectNameInMWC(std::string projectName); 33 std::string getProjectNameFromMWC(); 34 35 void setFileListController(std::string fileController); 36 void setTheHeaderList(string theHeaderListSring); 37 38 std::vector<std::string> getTheHeaderList(); 39 void setFileListController(); 40 32 41 HatNameWindow *getHatName(); 33 42 OptionWindow *getOption(); … … 40 49 OrderWindow *getOrder(); 41 50 InsertFCTWindow *getInsertFCT(); 42 void setFileListController(std::string fileController);43 void setTheHeaderList(string theHeaderListSring);44 std::vector<std::string> getTheHeaderList();45 void setFileListController();46 51 NewProjectWindow *getNewProjectInstance(); 47 52 NewProjectWindow *getNP(); 53 48 54 SpaceController *getSpaceController(); 49 55 50 56 yao::Table<yao::Trajectory> getTheTrajectoryTable(); 51 52 57 53 58 -
trunk/yao/src/interface/src/MainWindow.cpp
r67 r71 24 24 espace = new QWorkspace; //Crée un espace de travail. Ici, ça serait notre zone centrale 25 25 26 copyProjectName = mwc.getProjectName();26 //copyProjectName = mwc.getProjectName(); 27 27 28 28 fenetreProjet = new QDockWidget("Projet", this);// Réservation de l'espace pour la fenêtre projet … … 390 390 if(!description.is_open()) 391 391 throw ofstream::failure("couldn't create " + filename); 392 392 393 393 for (QStringList::iterator it = m_defvalCopy->getDataDefval().begin(); it != m_defvalCopy->getDataDefval().end(); it++) 394 394 description << "defval " << it->toStdString() << endl; 395 396 //for(vector<string>::iterator it = theHeaderList.begin(); it != theHeaderList.end(); it++) 397 // description << "hat_name \"" << it->c_str() << "\"" << endl; 398 // description << endl; 395 description << endl; 396 397 for(QStringList::iterator it = m_hatCopy->getHatName().begin(); it != m_hatCopy->getHatName().end(); it++) 398 description << "hat_name \"" << it->toStdString() << "\"" << endl; 399 description << endl; 399 400 400 401 for (QStringList::iterator it = m_trajCopy->getDataTraj().begin(); it != m_trajCopy->getDataTraj().end(); it++) 401 402 description << "traj " << it->toStdString() << endl; 403 description << endl; 402 404 403 405 for (QStringList::iterator it = m_spaceCopy->getData().begin(); it != m_spaceCopy->getData().end(); it++) 404 description << it->toStdString() << endl; 406 description << "space " << it->toStdString() << endl; 407 description << endl; 405 408 406 409 for (QStringList::iterator it = m_ctinCopy->getDataCtin().begin(); it != m_ctinCopy->getDataCtin().end(); it++) 407 410 description << "ctin " << it->toStdString() << endl; 408 409 //genererDefval(); 411 description << endl; 412 413 //genererDefval(); 410 414 //genererHat(); 411 415 //genererSpace(); 412 416 413 description.close();417 //description.close(); 414 418 } 415 419 -
trunk/yao/src/interface/src/MainWindowController.cpp
r67 r71 12 12 13 13 /*******************************************************************************************************************************************************/ 14 void MainWindowController::setProjectName (string name ) {14 void MainWindowController::setProjectNameInMWC(string name ) { 15 15 16 16 m_projectNameInMWC = name; … … 18 18 19 19 /*******************************************************************************************************************************************************/ 20 string MainWindowController::getProjectName () {21 20 string MainWindowController::getProjectNameFromMWC() { 21 setProjectNameInMWC(np->getNewProjectName()); 22 22 return m_projectNameInMWC; 23 23 } … … 43 43 HatNameWindow *MainWindowController::getHatName() { 44 44 45 return m_hat = new HatNameWindow( &m_theHeaderList,np->getNewProjectName());45 return m_hat = new HatNameWindow(np->getNewProjectName()); 46 46 47 47 } … … 137 137 //std::string MainWindowController::getNewProjectName() { 138 138 139 // return 139 // return; 140 140 //} 141 141 -
trunk/yao/src/interface/src/ModulWindow.cpp
r69 r71 61 61 //----------------------------------------------- 62 62 63 horizontalLayoutWidgetOut = new QWidget(centralWidget); 64 horizontalLayoutWidgetOut->setGeometry(QRect(10, 110, 300, 81)); 65 horizontalLayoutOut = new QHBoxLayout(horizontalLayoutWidgetOut); 66 horizontalLayoutOut->setSpacing(6); 67 horizontalLayoutOut->setMargin(11); 68 horizontalLayoutOut->setContentsMargins(0, 0, 0, 0); 63 //Les gestionnaires de positionnement 64 m_modulLayout->addRow("Modul name: ", m_modulName); 65 m_modulLayout->addRow("Spacename (or operaname): ", m_SpaceOrOperaName); 66 m_modulLayout->addRow("Input: ", m_modulInput); 67 m_modulLayout->addRow("Input: ", m_modulOutput); 68 m_modulLayout->addRow("Tempo: ", m_modulTempo); 69 m_modulLayout->addRow("Cout ", m_modulCout); 70 m_modulLayout->addRow(m_modulLayoutH1); 69 71 70 72 /*labelOutput = new QLabel("Output:",horizontalLayoutWidgetOut);
Note: See TracChangeset
for help on using the changeset viewer.