Changeset 470 for trunk/yao


Ignore:
Timestamp:
10/27/10 18:25:55 (14 years ago)
Author:
yerima
Message:

updates in a project opening

Location:
trunk/yao/src/interface
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/yao/src/interface/projects/demo/demo.d

    r467 r470  
    1212#TRAJ name type uptime offtime dtime steptime ------------------------------------------ 
    1313traj toc_1 M 20 0 1 30  
     14traj toc_2 M 10 0 1 21 
     15traj toc_3 M 8 0 1 11 
     16traj toc_4 M 7 0 1 9 
    1417 
    1518#SPACE name type dim1 [[dim2]---[dim3]] traj --------------------------------------------------- 
    1619space soc_0 M 1 3 5 toc_1 
     20space soc_1 M 3 5 toc_4 
     21space soc_2 M 1 3 5 toc_2 
     22space soc_3 M 7 3 5 toc_3 
     23space soc_4 M 5 5 3 toc_4 
     24space soc_5 M 4 3 5 toc_1 
    1725 
    1826#NETWARD netname indegree outdegree 
     
    2129netward NNTd        4 1 
    2230netward NNInvtau    9 1 
     31 
     32modul mod_1 space soc_0 input  4 output 1 
     33modul mod_2 space soc_1 input  3  
     34modul mod_3 space soc_0 input  49 output 13 
     35modul mod_4 space soc_1 input  22  
     36modul mod_5 space soc_0 input  41 output 10 
     37modul mod_6 space soc_1 input  12  
    2338 
    2439#INSERTFCT 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r467 r470  
    3434*/ 
    3535 
    36 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_constantWindow(NULL), m_hatnameWindow(NULL), m_contextWindow(NULL), m_trajectoryWindow(NULL), m_spaceWindow(NULL), m_operaWindow(NULL), m_netwardWindow(NULL), m_modulWindow(NULL), m_ctinWindow(NULL), m_orderWindow(NULL), m_insertFCTWindow(NULL), m_newProjectWindow(NULL), m_newProjectName(""), theConstantTablePt(theConstantTable), contextTest(false), iw(NULL)      
     36MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_constantWindow(NULL), m_hatnameWindow(NULL), m_contextWindow(NULL), m_trajectoryWindow(NULL), m_spaceWindow(NULL), m_operaWindow(NULL), m_netwardWindow(NULL), m_modulWindow(NULL), m_ctinWindow(NULL), m_orderWindow(NULL), m_insertFCTWindow(NULL), m_newProjectWindow(NULL), m_newProjectName(""), theConstantTablePt(theConstantTable), contextTest(false), iw(NULL), confirmationFlag(false)      
    3737{ 
    3838 
     
    216216                actionGenerationD->setText("Générer le fichier .d"); 
    217217 
    218                 connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(generateDFile())); 
     218                connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(callGenerateDFile())); 
    219219                //connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(information())); 
    220220 
     
    535535                emit newProjectIsCreated();//Emits the signal that the project is created. 
    536536                activateToolBarButtons(); // To active the toolbar buttons. 
     537                actionSaveAsProject->setEnabled(true); // Option désactivée par défaut. 
    537538        } 
    538539        fv->updateTheView(); //Permet de mettre à jour automatiquement la liste des fichiers visibles dans filesviewer. 
     
    590591 
    591592} 
     593 
     594/**************************************** Implementation of the method callgenerateDFile() (SLOT) *******************************************************/ 
     595void MainWindow::callGenerateDFile() { 
     596         
     597        generateDFile(); 
     598        QMessageBox::about(this, "Avis", "Le fichier <B>"+ QString(getProjectName().c_str()) + ".d</B> a été généré avec succÚs."); 
     599 
     600} 
    592601/**************************************** Implementation of the method saveAs() (SLOT) *******************************************************/ 
    593602void MainWindow::saveAs() { 
     
    611620        generateDFile(m_projectPath + "/"); 
    612621        //cout << cheminFichier.toStdString() << endl; 
     622         
     623        actionGenerationD->setEnabled(true); 
    613624 
    614625} 
     
    633644                test = builder.readAll();//the results are saved in a string format. 
    634645                istringstream iss(test.toStdString()); //To have each word that compose the string. 
    635                 FilePath aString, theShape, name, parent, aType, boot, offset, step, size, netname, indegree, outdegree, arg; 
     646                FilePath aString, theShape, name, parent, aType, boot, offset, step, size, netname, indegree, outdegree, modname, arg; 
    636647                vector <int> theShapeVector; 
    637648 
     
    717728                                if (aString.getExtension() == ".nw3") { 
    718729                                        outdegree = aString.getTitle();  
     730                                        theNeuronTable.push_back(Neuron(netname, m_netwardWindow->toInt(indegree), m_netwardWindow->toInt(outdegree))); 
     731                                } 
     732                                //For MODUL 
     733                                if (aString.getExtension() == ".mod1") { 
     734                                        modname = aString.getTitle();  
    719735                                         
    720                                         theNeuronTable.push_back(Neuron(netname, m_netwardWindow->toInt(indegree), m_netwardWindow->toInt(outdegree))); 
    721                                 } 
    722                                 /*if (aString.getExtension() == ".op1") { 
     736                                } 
     737                                if (aString.getExtension() == ".mod2") { 
     738                                        aType = aString.getTitle();  
     739                                         
     740                                } 
     741                                if (aString.getExtension() == ".mod3") { 
     742                                        parent = aString.getTitle();  
     743                                         
     744                                        Modul mod1(modname, theSpaceTable.find(parent), true); 
     745                                        theModulTable.push_back(mod1);   
     746                                } 
     747                                //For CONNECTION 
     748                                /*if (aString.getExtension() == ".mod1") { 
    723749                                        parent = aString.getTitle();  
    724750                                        //cout << parent << endl; 
     
    728754                                         
    729755                                }*/ 
     756 
    730757                                //For INSERTFCT  
    731758                                if (aString.getExtension() == ".fct1") { 
     
    750777                        actionSaveAsProject->setEnabled(true); 
    751778                } 
    752  
     779         
     780         
     781         
    753782        //connect(m_trajectoryWindow, SIGNAL(trajRowIsAdded(bool)), m_spaceButton, SLOT(setEnabled(bool))); 
    754783        //connect(m_trajectoryWindow, SIGNAL(trajRowIsAdded(bool)), m_operaButton, SLOT(setEnabled(bool))); 
     
    887916} 
    888917 
    889 /**************************************** Implementation of the method generateDFile() (SLOT) ****************************************************/ 
     918/**************************************** Implementation of the method generateDFile(string destination) (SLOT) *****************************/ 
    890919void MainWindow::generateDFile(string destination) { 
    891920         
     
    952981                                for (Table<Modul>::iterator it = theModulTable.begin(); it != theModulTable.end(); it++) { 
    953982                                        string parentType = it->isSpaceOrOperator()? "space " : "operator "; 
    954                                         description << "modul " << it->getName() << " " << parentType << it->getSpaceOrOperator() << " " << "input "<< it->getInput() << " " << "output "<< it->getOutput() << " " << "target " << it->getTarget()<< endl; 
     983                                        string aString =  "modul " + it->getName() + " " + parentType + it->getSpaceOrOperator();  
     984                                        if (!it->getInput()) 
     985                                                aString.append(" input " + it->getInput()); 
     986                                        description << aString << " " << "input "<< it->getInput() << " " << "output "<< it->getOutput() << " " << "target " << it->getTarget()<< endl; 
    955987                                } 
    956988                                        description << endl; 
     
    9781010 
    9791011                        description.close(); 
    980                         QMessageBox::about(this, "Avis", "Le fichier <B>"+ QString(filename.c_str()) + ".d</B> a été généré avec succÚs."); 
    9811012                } 
    9821013 
     
    11841215       
    11851216}*/ 
    1186  
     1217/********************************** **/ 
    11871218 
    11881219/*********************************** Implementation of the destructor method (~MainWindow()) *******************************************************/ 
  • trunk/yao/src/interface/src/include/MainWindow.hpp

    r466 r470  
    9797                        void desactivateToolBarButtons(); 
    9898                        void generateDFile(std::string destination = "projects/"); 
     99                        void callGenerateDFile();// used only for the execution button 
    99100                        void generateIFile(std::string destination = "projects/"); 
    100101                        void instructionFileManager(); 
     
    274275 
    275276                        bool m_activeProject; 
     277                        bool confirmationFlag; 
    276278                                 
    277279                        QDateEdit *date; 
Note: See TracChangeset for help on using the changeset viewer.