- Timestamp:
- 10/27/10 18:25:55 (14 years ago)
- Location:
- trunk/yao/src/interface
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/projects/demo/demo.d
r467 r470 12 12 #TRAJ name type uptime offtime dtime steptime ------------------------------------------ 13 13 traj toc_1 M 20 0 1 30 14 traj toc_2 M 10 0 1 21 15 traj toc_3 M 8 0 1 11 16 traj toc_4 M 7 0 1 9 14 17 15 18 #SPACE name type dim1 [[dim2]---[dim3]] traj --------------------------------------------------- 16 19 space soc_0 M 1 3 5 toc_1 20 space soc_1 M 3 5 toc_4 21 space soc_2 M 1 3 5 toc_2 22 space soc_3 M 7 3 5 toc_3 23 space soc_4 M 5 5 3 toc_4 24 space soc_5 M 4 3 5 toc_1 17 25 18 26 #NETWARD netname indegree outdegree … … 21 29 netward NNTd 4 1 22 30 netward NNInvtau 9 1 31 32 modul mod_1 space soc_0 input 4 output 1 33 modul mod_2 space soc_1 input 3 34 modul mod_3 space soc_0 input 49 output 13 35 modul mod_4 space soc_1 input 22 36 modul mod_5 space soc_0 input 41 output 10 37 modul mod_6 space soc_1 input 12 23 38 24 39 #INSERTFCT -
trunk/yao/src/interface/src/MainWindow.cpp
r467 r470 34 34 */ 35 35 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) 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), confirmationFlag(false) 37 37 { 38 38 … … 216 216 actionGenerationD->setText("Générer le fichier .d"); 217 217 218 connect(actionGenerationD, SIGNAL(triggered()), this, SLOT( generateDFile()));218 connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(callGenerateDFile())); 219 219 //connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(information())); 220 220 … … 535 535 emit newProjectIsCreated();//Emits the signal that the project is created. 536 536 activateToolBarButtons(); // To active the toolbar buttons. 537 actionSaveAsProject->setEnabled(true); // Option désactivée par défaut. 537 538 } 538 539 fv->updateTheView(); //Permet de mettre à jour automatiquement la liste des fichiers visibles dans filesviewer. … … 590 591 591 592 } 593 594 /**************************************** Implementation of the method callgenerateDFile() (SLOT) *******************************************************/ 595 void 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 } 592 601 /**************************************** Implementation of the method saveAs() (SLOT) *******************************************************/ 593 602 void MainWindow::saveAs() { … … 611 620 generateDFile(m_projectPath + "/"); 612 621 //cout << cheminFichier.toStdString() << endl; 622 623 actionGenerationD->setEnabled(true); 613 624 614 625 } … … 633 644 test = builder.readAll();//the results are saved in a string format. 634 645 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; 636 647 vector <int> theShapeVector; 637 648 … … 717 728 if (aString.getExtension() == ".nw3") { 718 729 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(); 719 735 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") { 723 749 parent = aString.getTitle(); 724 750 //cout << parent << endl; … … 728 754 729 755 }*/ 756 730 757 //For INSERTFCT 731 758 if (aString.getExtension() == ".fct1") { … … 750 777 actionSaveAsProject->setEnabled(true); 751 778 } 752 779 780 781 753 782 //connect(m_trajectoryWindow, SIGNAL(trajRowIsAdded(bool)), m_spaceButton, SLOT(setEnabled(bool))); 754 783 //connect(m_trajectoryWindow, SIGNAL(trajRowIsAdded(bool)), m_operaButton, SLOT(setEnabled(bool))); … … 887 916 } 888 917 889 /**************************************** Implementation of the method generateDFile( ) (SLOT) ****************************************************/918 /**************************************** Implementation of the method generateDFile(string destination) (SLOT) *****************************/ 890 919 void MainWindow::generateDFile(string destination) { 891 920 … … 952 981 for (Table<Modul>::iterator it = theModulTable.begin(); it != theModulTable.end(); it++) { 953 982 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; 955 987 } 956 988 description << endl; … … 978 1010 979 1011 description.close(); 980 QMessageBox::about(this, "Avis", "Le fichier <B>"+ QString(filename.c_str()) + ".d</B> a été généré avec succÚs.");981 1012 } 982 1013 … … 1184 1215 1185 1216 }*/ 1186 1217 /********************************** **/ 1187 1218 1188 1219 /*********************************** Implementation of the destructor method (~MainWindow()) *******************************************************/ -
trunk/yao/src/interface/src/include/MainWindow.hpp
r466 r470 97 97 void desactivateToolBarButtons(); 98 98 void generateDFile(std::string destination = "projects/"); 99 void callGenerateDFile();// used only for the execution button 99 100 void generateIFile(std::string destination = "projects/"); 100 101 void instructionFileManager(); … … 274 275 275 276 bool m_activeProject; 277 bool confirmationFlag; 276 278 277 279 QDateEdit *date;
Note: See TracChangeset
for help on using the changeset viewer.