Changeset 71


Ignore:
Timestamp:
12/11/09 12:44:01 (15 years ago)
Author:
yerima
Message:
 
Location:
trunk/yao/src/interface/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/yao/src/interface/src/DefvalWindow.cpp

    r67 r71  
    163163 
    164164/****************************************************************************************/ 
     165void 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/****************************************************************************************************************************/ 
     179QStringList DefvalWindow::getDataDefval() { 
     180 
     181     return DefvalData; 
     182} 
     183 
     184 
     185/****************************************************************************************/ 
    165186/*void DefvalWindow::ecrireFichier() 
    166187{ 
     
    180201}*/ 
    181202 
    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  
    66 
    77/*************************************** Implémentation du constructeur **************************************************/ 
    8 HatNameWindow::HatNameWindow(vector<string> *theHeaderList, string projectName, QWidget *parent): QWidget(parent) { 
     8HatNameWindow::HatNameWindow(string projectName, QWidget *parent): QWidget(parent) { 
    99  
    10         setTheHeaderList(theHeaderList); 
     10        //setTheHeaderList(theHeaderList); 
    1111        localProjectName = projectName + ".h"; 
    1212        //hatHeaderList = theHeaderList; 
     
    1919        m_comboHatName          = new QComboBox(this);                 //Champ de selection d'une constante 
    2020        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); 
    2222        m_supHatName            = new QPushButton("Supprimer", this) ; //Déclaration du bouton "supprimmer" 
    2323        m_boutonouvrir          = new QPushButton(this);               //Déclaration du bouton "ouvrir" permettant de selectionner un fichier. 
     
    3030                 //m_boutonouvrir->setGeometry(1,1,1,1); 
    3131        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" 
    3333 
    3434        m_layoutH1HatName       = new QHBoxLayout; // Un gestionnaire horizontal contenant:  
    35                 m_layoutH1HatName->addWidget(m_enregHatName); 
     35                //m_layoutH1HatName->addWidget(m_enregHatName); 
    3636                m_layoutH1HatName->addWidget(m_supHatName); //le bouton supprimer 
    3737                m_layoutH1HatName->addWidget(m_quitHatName);//et le bouton quitter 
     
    3939         m_layoutH2HatName      = new QHBoxLayout ; // Un gestionnaire horizontal contenant:  
    4040            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. 
    4242            m_layoutH2HatName->addWidget(m_boutonouvrir);       //(3): Un bouton "ouvrir" permettant de selectionner un fichier stocké. 
    4343 
    4444        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(); 
    4947        //listeFichiers.append(it.c_str()); 
    5048        modeleFichiers = new QStringListModel(listeFichiers); 
    51  
    5249 
    5350        //m_layoutV1HatName->addWidget(m_boutonAjouter); 
     
    6057                m_layoutH3HatName->addWidget(m_boutonAjouter); 
    6158 
    62                 m_layout1HatName                = new QFormLayout ; 
     59                m_layout1HatName = new QFormLayout ; 
    6360                m_layout1HatName->addRow(m_texte); 
    6461                m_layout1HatName->addRow(m_layoutH2HatName); 
     
    7673         
    7774        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())); 
    7976        connect(m_boutonouvrir , SIGNAL(clicked()), this, SLOT(ouvrirProjetExistant())); 
    8077        connect(m_quitHatName, SIGNAL(clicked()), this, SLOT(ecrireFichier())); 
    8178        connect(m_enregHatName, SIGNAL(clicked()), this, SLOT(appelEnregistrer())); 
    82         connect(m_boutonAjouter, SIGNAL(clicked()), this, SLOT(appelAjout())); 
     79        connect(m_boutonAjouter, SIGNAL(clicked()), this, SLOT(addHatRow())); 
    8380} 
    8481 
     
    9491    return m_comboHatName->currentText().toStdString(); 
    9592} 
    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  
    10493/************************************** Implémentation de la méthode setFileList *****************************************/ 
    10594void HatNameWindow::setFileList(string localString) { 
     
    114103/****************************************************************************************/ 
    115104 
    116 void HatNameWindow::appelAjout() { 
     105void HatNameWindow::addHatRow() { 
    117106 
    118107hatFile = getNomFichierHat(); 
     
    143132            hatFile.append(".h"); 
    144133            QString fichier = hatFile.c_str(); 
    145             //setFileList(); 
    146             //listeFichiers.removeFirst(); 
    147134            listeFichiers.append(fichier); 
    148135 
     
    161148      } 
    162149 
    163 QString fichier = hatFile.c_str(); 
    164 listeFichiers.append(fichier); 
    165  
    166 modeleFichiers->setStringList(listeFichiers); 
    167 testPresenceFichier(); 
    168  
    169  
    170150initialiserChamps(); 
    171151} 
    172152 
    173153/****************************************************************************************/ 
    174 void HatNameWindow::appelSup() { 
     154void HatNameWindow::deleteHatRow() { 
    175155 
    176156    QItemSelectionModel *selection = vueFichiers->selectionModel(); 
     
    190170} 
    191171 
    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() ************************************/ 
     173void 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()); 
    204178} 
    205179 
     
    223197vector<string> HatNameWindow::getTheHeaderList() { 
    224198 
    225     hatHeaderList.push_back("test"); 
     199    //hatHeaderList.push_back("test"); 
    226200    return hatHeaderList; 
    227201 } 
    228202 
    229203/****************************************************************************************/ 
    230 void HatNameWindow::setTheHeaderList(vector<string> *theHeaderList) { 
    231  
    232  
    233  
     204void HatNameWindow::setTheHeaderList(string theHeaderList) { 
     205 
     206        hatHeaderList.push_back(theHeaderList); 
    234207 } 
    235  
     208/****************************************************************************************/ 
     209QStringList HatNameWindow::getHatName() 
     210{ 
     211        return listeFichiers; 
     212    } 
     213 
  • trunk/yao/src/interface/src/Include/HatNameWindow.h

    r66 r71  
    22#define HATNAME_H 
    33 
    4 //#include <iostream> 
    5 //#include <QWidget> 
    6 //#include <QTextStream> 
    74#include <QVBoxLayout> 
    85#include <QPushButton> 
     
    129#include <QStandardItemModel> 
    1310#include <QTableWidget> 
    14 //#include <QString> 
    1511#include <QMessageBox> 
    1612#include <QFileDialog> 
     
    1814#include <QStringListModel> 
    1915#include <QComboBox> 
    20 //#include <QIODevice> 
    2116#include <QStringList> 
    2217#include <QSpacerItem> 
     
    4540             */ 
    4641 
    47             HatNameWindow(std::vector<std::string> *theHeaderList, std::string projectName = NULL, QWidget *parent=0); 
     42            HatNameWindow(std::string projectName = NULL, QWidget *parent=0); 
    4843            void setNomFichierHat(QString nomFichierHat);                       /*!< This function sets the file's name. */ 
    4944            std::string getNomFichierHat();                                         /*!< This function returns the fil's name */ 
    5045            void testPresenceFichier(); 
    51  
     46            QStringList getHatName(); 
    5247            /*! 
    5348             *  \brief SLOT functions 
     
    6055        public slots : 
    6156 
    62                 void appelAjout();              /*!< 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. */ 
    6459                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. */ 
    6661                void ouvrirProjetExistant();    /*!< This function is called to open an existing project. */ 
    6762                void appelEnregistrer();        /*!< This function is called to save the current project in the file model */ 
    6863                void setFileList(std::string localString); 
    69                 void setTheHeaderList(std::vector<std::string> *theHeaderList); 
     64                void setTheHeaderList(std::string theHeaderList); 
    7065                std::vector<std::string>  getTheHeaderList(); 
    71  
    7266            /*! 
    7367             *  \brief private functions 
  • trunk/yao/src/interface/src/Include/MainWindowController.h

    r67 r71  
    2626        public : 
    2727                MainWindowController(); 
     28 
     29                void setDefval(); 
    2830                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 
    3241                HatNameWindow *getHatName(); 
    3342                OptionWindow *getOption(); 
     
    4049                OrderWindow *getOrder(); 
    4150                InsertFCTWindow *getInsertFCT(); 
    42                 void setFileListController(std::string fileController); 
    43                 void setTheHeaderList(string theHeaderListSring); 
    44                 std::vector<std::string> getTheHeaderList(); 
    45                 void setFileListController(); 
    4651                NewProjectWindow *getNewProjectInstance(); 
    4752                NewProjectWindow *getNP(); 
     53 
    4854                SpaceController *getSpaceController(); 
    4955 
    5056                yao::Table<yao::Trajectory> getTheTrajectoryTable(); 
    51  
    5257 
    5358                 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r67 r71  
    2424        espace = new QWorkspace;    //Crée un espace de travail. Ici, ça serait notre zone centrale 
    2525 
    26         copyProjectName = mwc.getProjectName(); 
     26        //copyProjectName = mwc.getProjectName(); 
    2727 
    2828        fenetreProjet                 = new QDockWidget("Projet", this);// Réservation de l'espace pour la fenêtre projet 
     
    390390        if(!description.is_open()) 
    391391                throw ofstream::failure("couldn't create " + filename); 
    392         
     392 
    393393       for (QStringList::iterator it = m_defvalCopy->getDataDefval().begin(); it != m_defvalCopy->getDataDefval().end(); it++) 
    394394            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; 
    399400 
    400401       for (QStringList::iterator it = m_trajCopy->getDataTraj().begin(); it != m_trajCopy->getDataTraj().end(); it++) 
    401402           description << "traj " << it->toStdString() << endl; 
     403            description << endl; 
    402404 
    403405      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; 
    405408 
    406409       for (QStringList::iterator it = m_ctinCopy->getDataCtin().begin(); it != m_ctinCopy->getDataCtin().end(); it++) 
    407410           description << "ctin " << it->toStdString() << endl; 
    408  
    409     //genererDefval(); 
     411            description << endl; 
     412 
     413     //genererDefval(); 
    410414    //genererHat(); 
    411415    //genererSpace(); 
    412416 
    413     description.close(); 
     417    //description.close(); 
    414418} 
    415419 
  • trunk/yao/src/interface/src/MainWindowController.cpp

    r67 r71  
    1212 
    1313/*******************************************************************************************************************************************************/ 
    14 void MainWindowController::setProjectName(string name ) { 
     14void MainWindowController::setProjectNameInMWC(string name ) { 
    1515 
    1616    m_projectNameInMWC = name; 
     
    1818 
    1919/*******************************************************************************************************************************************************/ 
    20 string MainWindowController::getProjectName() { 
    21  
     20string MainWindowController::getProjectNameFromMWC() { 
     21    setProjectNameInMWC(np->getNewProjectName()); 
    2222  return m_projectNameInMWC; 
    2323} 
     
    4343HatNameWindow *MainWindowController::getHatName() { 
    4444 
    45     return m_hat = new HatNameWindow(&m_theHeaderList, np->getNewProjectName()); 
     45    return m_hat = new HatNameWindow(np->getNewProjectName()); 
    4646 
    4747} 
     
    137137//std::string MainWindowController::getNewProjectName() { 
    138138         
    139 //      return 
     139  //      return; 
    140140//} 
    141141 
  • trunk/yao/src/interface/src/ModulWindow.cpp

    r69 r71  
    6161        //----------------------------------------------- 
    6262 
    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); 
    6971 
    7072        /*labelOutput = new QLabel("Output:",horizontalLayoutWidgetOut); 
Note: See TracChangeset for help on using the changeset viewer.