- Timestamp:
- 06/29/10 09:46:34 (14 years ago)
- Location:
- trunk/yao/src/interface
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/ConstantWindow.cpp
r363 r366 31 31 m_ligneNom->setValidator(new QRegExpValidator(regExp, this)); 32 32 m_ligneValeur->setValidator(new QRegExpValidator(regExp2, this)); 33 if(isConstantTableEmpty()) m_delButton ->setDisabled(true); /*!< setDisabled is true. */ 33 34 if(isConstantTableEmpty()) m_delButton ->setDisabled(true); /*!< setDisabled is true. */ 34 35 35 36 m_defvalModel = new QStandardItemModel(0, 2);//Nombre de lignes et colonnes du modÚle. … … 38 39 for (Table<Constant>::iterator it = m_localConstantTable->begin(); it != m_localConstantTable->end(); it++) 39 40 { 40 m_defvalModel->setItem(m_defvalModel->rowCount(), 0, new QStandardItem(QString(it->getName().c_str())));41 m_defvalModel->setItem(m_defvalModel->rowCount()-1, 1, new QStandardItem(QString(it->getText().c_str())));//Apres le 1er ajout, la ligne vaut i+141 m_defvalModel->setItem(m_defvalModel->rowCount(), 0, new QStandardItem(QString(it->getName().c_str()))); 42 m_defvalModel->setItem(m_defvalModel->rowCount()-1, 1, new QStandardItem(QString(it->getText().c_str())));//Apres le 1er ajout, la ligne vaut i+1 42 43 } 43 44 //if (mwc->isStringLiteral("malkj")) cout << "cest bon ça" << endl; else cout << "Oh dommage!" << endl; 44 45 46 47 48 45 m_tableView->setModel(m_defvalModel); 46 m_tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); /*!< this ligne give no edit mode*/ 47 m_tableView->setShowGrid(false); /*!< this ligne cover the grille in table */ 48 m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows); /*!< this ligne give a section of the ligne */ 49 m_tableView->resizeColumnsToContents(); 49 50 50 51 … … 66 67 QString Val = m_ligneValeur->text(); 67 68 68 //int last;69 70 //index71 72 //for(int i1 = 0; i1 < Nom.size(); i1++) {73 // if(!((Nom.at(i1) >= QChar('a')&& Nom.at(i1) <= QChar('z')) || (Nom.at(i1) >= QChar('A')&& Nom.at(i1) <= QChar('Z'))74 // || (Nom.at(i1) >= QChar('0')&& Nom.at(i1) <= QChar('9')) || (Nom.at(i1) == QChar('_')))) {75 76 /* if (!localMwc->isIdentifier(Nom.toStdString())) {77 QMessageBox::critical(this, "Avertissement", "CaractÚre(s) non permis dans le champ \"Nom constante\".");78 return; // Arrêt de la méthode79 }80 else81 82 if((Nom.at(0) >= QChar('0') && Nom.at(0) <= QChar('9'))) {83 84 QMessageBox::critical(this, "Avertissement", "Le premier caractÚre du nom de la constante ne doit pas être un chiffre!");85 return; // Arrêt de la méthode86 }87 */88 89 //for(int i2 = 0; i2 < Val.size(); i2++)90 // if(!((Val.at(i2) >= QChar('a') && Val.at(i2) <= QChar('z')) || (Val.at(i2) >= QChar('A')&& Val.at(i2) <= QChar('Z'))91 // ||(Val.at(i2) >= QChar('0') && Val.at(i2) <= QChar('9')) || (Val.at(i2) == QChar('_')) || (Val.at(i2) == QChar('-'))92 // || (Val.at(i2) == QChar('E')) || (Val.at(i2) == QChar('e')) || (Val.at(i2) == QChar('+')) || (Val.at(i2) == QChar('.')))) {93 94 /* if (!(localMwc->isStringLiteral(Val.toStdString()) || localMwc->isExponent(Val.toStdString()))) {95 QMessageBox::critical(this, "Erreur", "CaractÚre(s) non permis dans le champ \"Valeur constante\".");96 return; // Arrêt de la méthode97 }98 */99 69 if ((m_ligneNom->text().isEmpty()) || (m_ligneValeur->text().isEmpty())) { 100 70 … … 108 78 Constant localConstant (Nom.toStdString(), Val.toStdString()); 109 79 m_localConstantTable->push_back(localConstant); 110 // for (Table<Constant>::iterator it = m_localConstantTable->begin(); it != m_localConstantTable->end(); it++)111 // if ((it->getName() != Nom.toStdString()))// (it->getText() != localConstant))///*<< dynamic_cast <string>(*it)*/ << endl;112 113 80 114 81 m_defvalModel->setItem(m_defvalModel->rowCount(), 0, new QStandardItem(m_ligneNom->text())); -
trunk/yao/src/interface/src/HatNameWindow.cpp
r365 r366 74 74 //cout << "After the move() method, my coodinate is " << x() << endl; 75 75 } 76 77 /************************************* Implémentation de la méthode setNomFichierHat *************************************/78 //! \fn void setNomFichierHat(QString nomFichierHat)79 80 //void HatNameWindow::setNomFichierHat(QString nomFichierHat) {81 82 //}83 76 84 77 /************************************* Impémentation de la méthode getNomFichierHat() *************************************/ -
trunk/yao/src/interface/src/InsertFCTWindow.cpp
r365 r366 31 31 connect(m_insertFCTHelpButton, SIGNAL(clicked()), this, SLOT(callInsertFCTHelp())); /*!< This slot opens */ 32 32 33 setFixedWidth(baseSize().width() + 3 35);33 setFixedWidth(baseSize().width() + 345); 34 34 } 35 35 … … 40 40 int row = m_insertFCTModel->rowCount();//To have the current row of the tableView. 41 41 string name = m_insertFCTNameLine->text().toStdString(); 42 //string reg;43 42 bool arg = m_insertFCTAgumentCheckBox->isChecked(); //? "oui" : "non" ; 44 //bool arg = reg == "oui"? true: false; 43 ostringstream reg; 44 reg << arg; 45 45 46 //Function *F;47 48 //F = localFunctionTable->find(name);49 50 //if (F != NULL)51 // { //C'est alors une constante.52 53 //name = localFunctionTable->find()->getText();54 46 if (!name.empty()) 55 47 { 56 48 localFunctionTable->push_back(Function(name, arg)); 57 49 m_insertFCTModel->setItem(row, 0, new QStandardItem(QString(name.c_str()))); 58 //arg == true ? reg = "oui" : reg = "non"; 59 //m_insertFCTModel->setItem(row, 1, new QStandardItem(QString(name.c_str()))) ; 50 reg.str() == "0" ? m_insertFCTModel->setItem(row, 1, new QStandardItem("non")) : m_insertFCTModel->setItem(row, 1, new QStandardItem("oui")); 51 m_insertFCTNameLine->setText(""); 52 m_insertFCTAgumentCheckBox->setCheckState(Qt::Unchecked); 60 53 } 61 54 else 62 55 QMessageBox::critical(this, "Erreur", "Le champ \"Nom fonction\" ne doit pas être vide!"); 63 // }64 56 65 57 } … … 76 68 void InsertFCTWindow::deleteRowFCT() { 77 69 78 try { 70 try 71 { 72 QItemSelectionModel *selection = m_insertFCTTableView->selectionModel(); 73 index = selection->currentIndex(); 74 QVariant element = m_insertFCTModel->data(index, Qt::DisplayRole); 75 int r = index.row(); 76 if (selection->hasSelection())// Permet de supprimer la ligne qui est selectionnée. Evite ainsi certains effets indesirables. 77 { 78 m_insertFCTModel->removeRows(m_insertFCTTableView->currentIndex().row(), 1); 79 localFunctionTable->erase(localFunctionTable->begin() + r); 80 81 } 82 83 //if (isSpaceTableEmpty()) m_spaceDeleteButton->setDisabled(true); 84 79 85 80 }86 } 81 87 82 catch(...)83 {88 catch(...) 89 { 84 90 85 QMessageBox::critical(this, "Erreur", "Erreur dans la méthode deleteInsertRow()");86 }91 QMessageBox::critical(this, "Erreur", "Erreur dans la méthode deleteInsertRow()"); 92 } 87 93 } 88 94 -
trunk/yao/src/interface/src/MainWindow.cpp
r365 r366 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("") {37 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("") 37 { 38 38 39 39 setWindowTitle(" Visual YAO "); //Gives a title to the mainwindow. … … 85 85 void MainWindow::createMenus() { 86 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 87 menuFichier = menuBar()->addMenu(tr("&Fichier")); 88 menuFichier->addAction(actionNouveauProjet); 89 menuFichier->addAction(actionOuvrirProjet); 90 menuFichier->addAction(actionOuvrirProjetsRecents); 91 menuFichier->addSeparator(); // Met une ligne horizontale entre les menus 92 //menuFichier->addAction(actionImporterProjet); 93 menuFichier->addSeparator(); 94 menuFichier->addAction(actionEnregistrerProjet); 95 menuFichier->addAction(actionEnregistrerSousProjet); 96 menuFichier->addSeparator(); 97 menuFichier->addAction(actionSortieProjet); 98 menuEdition = menuBar()->addMenu("&Edition"); 99 menuEdition->addAction(actionFichierDescription); 100 menuEdition->addAction(actionFichierHat); 101 //nouveau->addAction(actionModule); 102 menuEdition->addAction(actionFichierInstruction); 103 menuEdition->addAction(actionGrapheModulaire); 104 menuEdition->addAction(actionInfosProjet); 105 106 menuAffichage = menuBar()->addMenu("&Affichage"); 107 menuAffichage->addAction(actionCacherBarreOutils); 108 109 menuAffichage->addAction(actionCacherFenetreApercu); 110 menuAffichage->addAction(actionCacherFenetreProjet); 111 menuAffichage->addAction(actionCacherFenetreDialog); 112 menuExecution = menuBar()->addMenu("&Exécution"); 113 menuExecution->addAction(actionGenerationD); 114 menuExecution->addAction(actionCompilation); 115 menuExecution->addAction(actionExecution); 116 menuConfig = menuBar()->addMenu("&Configuration"); 117 menuConfig->addAction(actionEditeur); 118 menuAide = menuBar()->addMenu(tr("&Aide")); 119 menuAide->addAction(actionDocYao); 120 menuAide->addAction(actionRapport); 121 121 122 122 } … … 125 125 void MainWindow::createActions() { 126 126 127 // Les actions du menu fichier 128 actionNouveauProjet = new QAction(tr("&Nouveau projet"), this); 129 actionNouveauProjet->setIcon(QIcon("Images/icons/newfile.png")); 130 actionNouveauProjet->setStatusTip("Créer un nouveau projet"); 131 actionNouveauProjet->setShortcut(tr("Ctrl+N")); 132 //connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(activateToolBarButtons())); 133 connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(createNewProjectWindow())); 134 connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(montrerActionGenererD())); 135 actionOuvrirProjet = new QAction(tr("&Ouvrir un projet"), this); 136 actionOuvrirProjet->setIcon(QIcon("Images/icons/openfile.png")); 137 actionOuvrirProjet->setShortcut(tr("Ctrl+O")); 138 actionOuvrirProjet->setStatusTip("Ouvrir un projet existant"); 139 //connect(actionOuvrirProjet, SIGNAL(triggered()), this, SLOT(ouvrirProjet())); 140 //connect(actionOuvrirProjet, SIGNAL(triggered()), this, SLOT(montrerActionCompilation())); 141 actionOuvrirProjetsRecents = new QAction(tr("Ouvrir projets recents"), this); 142 //compilAction->setIcon(QIcon("")); 143 actionOuvrirProjetsRecents->setShortcut(tr("Ctrl+P")); 144 actionOuvrirProjetsRecents->setStatusTip("Projets recemment ouverts"); 145 //connect(compilAction, SIGNAL(triggered()), this, SLOT()); 146 //actionImporterProjet = new QAction(tr("&Importer"), this); 147 //runAction->setIcon(QIcon("")); 148 // actionImporterProjet->setShortcut(tr("Ctrl+E")); 149 // actionImporterProjet->setStatusTip("Importer un projet"); 150 //connect(runAction, SIGNAL(triggered()), this, SLOT()); 151 actionEnregistrerProjet = new QAction(tr("Enregi&strer"), this); 152 actionEnregistrerProjet->setIcon(QIcon("Images/icons/save.png")); 153 actionEnregistrerProjet->setEnabled(false); // Option désactivée par défaut. 154 actionEnregistrerProjet->setStatusTip("Pour sauvegarder le projet en cours"); 155 actionEnregistrerSousProjet = new QAction(tr("Enregistrer sous"), this); 156 actionEnregistrerSousProjet->setIcon(QIcon("Images/icons/saveas.png")); 157 actionEnregistrerSousProjet->setEnabled(false); // Option désactivée par défaut. 158 actionEnregistrerSousProjet->setStatusTip("En le projet sous un autre nom"); 159 actionImprimerProjet = new QAction(tr("Imprimer"), this); 160 actionImprimerProjet->setStatusTip("Options d'impression"); 161 actionSortieProjet = new QAction(tr("&Sortir"), this); 162 actionSortieProjet->setIcon(QIcon("Images/icons/exit.png")); 163 actionSortieProjet->setShortcut(tr("Ctrl+Q")); 164 actionSortieProjet->setStatusTip("Fermer le programme"); 165 connect(actionSortieProjet, SIGNAL(triggered()), this, SLOT(close())); 127 // Les actions du menu fichier 128 actionNouveauProjet = new QAction(tr("&Nouveau projet"), this); 129 actionNouveauProjet->setIcon(QIcon("Images/icons/newfile.png")); 130 actionNouveauProjet->setStatusTip("Créer un nouveau projet"); 131 actionNouveauProjet->setShortcut(tr("Ctrl+N")); 132 133 //connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(activateToolBarButtons())); 134 connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(createNewProjectWindow())); 135 connect(actionNouveauProjet, SIGNAL(triggered()), this, SLOT(montrerActionGenererD())); 136 137 actionOuvrirProjet = new QAction(tr("&Ouvrir un projet"), this); 138 actionOuvrirProjet->setIcon(QIcon("Images/icons/openfile.png")); 139 actionOuvrirProjet->setShortcut(tr("Ctrl+O")); 140 actionOuvrirProjet->setStatusTip("Ouvrir un projet existant"); 141 142 //connect(actionOuvrirProjet, SIGNAL(triggered()), this, SLOT(ouvrirProjet())); 143 //connect(actionOuvrirProjet, SIGNAL(triggered()), this, SLOT(montrerActionCompilation())); 144 145 actionOuvrirProjetsRecents = new QAction(tr("Ouvrir projets recents"), this); 146 //compilAction->setIcon(QIcon("")); 147 actionOuvrirProjetsRecents->setShortcut(tr("Ctrl+P")); 148 actionOuvrirProjetsRecents->setStatusTip("Projets recemment ouverts"); 149 //connect(compilAction, SIGNAL(triggered()), this, SLOT()); 150 //actionImporterProjet = new QAction(tr("&Importer"), this); 151 //runAction->setIcon(QIcon("")); 152 // actionImporterProjet->setShortcut(tr("Ctrl+E")); 153 // actionImporterProjet->setStatusTip("Importer un projet"); 154 155 //connect(runAction, SIGNAL(triggered()), this, SLOT()); 156 actionEnregistrerProjet = new QAction(tr("Enregi&strer"), this); 157 actionEnregistrerProjet->setIcon(QIcon("Images/icons/save.png")); 158 actionEnregistrerProjet->setEnabled(false); // Option désactivée par défaut. 159 actionEnregistrerProjet->setStatusTip("Pour sauvegarder le projet en cours"); 160 actionEnregistrerSousProjet = new QAction(tr("Enregistrer sous"), this); 161 actionEnregistrerSousProjet->setIcon(QIcon("Images/icons/saveas.png")); 162 actionEnregistrerSousProjet->setEnabled(false); // Option désactivée par défaut. 163 actionEnregistrerSousProjet->setStatusTip("En le projet sous un autre nom"); 164 actionImprimerProjet = new QAction(tr("Imprimer"), this); 165 actionImprimerProjet->setStatusTip("Options d'impression"); 166 actionSortieProjet = new QAction(tr("&Sortir"), this); 167 actionSortieProjet->setIcon(QIcon("Images/icons/exit.png")); 168 actionSortieProjet->setShortcut(tr("Ctrl+Q")); 169 actionSortieProjet->setStatusTip("Fermer le programme"); 170 171 connect(actionSortieProjet, SIGNAL(triggered()), this, SLOT(close())); 166 172 167 173 // Les actions du menu Edition 168 169 170 171 172 173 174 175 176 174 actionFichierDescription = new QAction(tr("Fichier de description (.d)"), this); 175 176 connect(actionFichierDescription, SIGNAL(triggered()), this, SLOT(generateDFile())); 177 178 actionFichierHat = new QAction(tr("Fichier (.h)"), this); 179 //actionModule = new QAction(tr("Modul"), this); 180 actionFichierInstruction = new QAction(tr("Fichier instruction (.i)"), this); 181 actionGrapheModulaire = new QAction(tr("Graphe modulaire"), this); 182 actionInfosProjet = new QAction(tr("Edition infos projet"), this); 177 183 178 184 // Les actions du menu Affichage 179 actionCacherBarreOutils = new QAction(tr("Cacher la barre d'outils"), this); 180 actionCacherBarreOutils->setCheckable(true); 181 // connect(actionCacherBarreOutils, SIGNAL(triggered()), this, SLOT(cacherBarreOutils())); 182 actionCacherFenetreApercu = new QAction(tr("Cacher la fenetre apercu"), this); 183 actionCacherFenetreApercu->setCheckable(true); 184 actionCacherFenetreProjet = new QAction(tr("Cacher la fenetre Projet"), this); 185 actionCacherFenetreProjet->setCheckable(true); 186 actionCacherFenetreDialog = new QAction(tr("Cacher la fenetre dialog"), this); 187 actionCacherFenetreDialog->setCheckable(true); 188 //actionPleinEcran = new QAction(tr("Plein ecran"), this); 189 //actionPleinEcran->setCheckable(true); 185 actionCacherBarreOutils = new QAction(tr("Cacher la barre d'outils"), this); 186 actionCacherBarreOutils->setCheckable(true); 187 188 // connect(actionCacherBarreOutils, SIGNAL(triggered()), this, SLOT(cacherBarreOutils())); 189 actionCacherFenetreApercu = new QAction(tr("Cacher la fenetre apercu"), this); 190 actionCacherFenetreApercu->setCheckable(true); 191 actionCacherFenetreProjet = new QAction(tr("Cacher la fenetre Projet"), this); 192 actionCacherFenetreProjet->setCheckable(true); 193 actionCacherFenetreDialog = new QAction(tr("Cacher la fenetre dialog"), this); 194 actionCacherFenetreDialog->setCheckable(true); 195 //actionPleinEcran = new QAction(tr("Plein ecran"), this); 196 //actionPleinEcran->setCheckable(true); 190 197 191 198 // Les actions du menu Execution 192 actionGenerationD = new QAction(tr("Generer le fichier .d"), this); 193 actionGenerationD->setEnabled(false); 194 connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(generateDFile())); 195 196 actionCompilation = new QAction(tr("Compilation"), this); 197 actionCompilation->setEnabled(false); 198 actionExecution = new QAction(tr("Execution"), this); 199 actionExecution->setEnabled(false); 199 actionGenerationD = new QAction(tr("Generer le fichier .d"), this); 200 actionGenerationD->setEnabled(false); 201 202 connect(actionGenerationD, SIGNAL(triggered()), this, SLOT(generateDFile())); 203 204 actionCompilation = new QAction(tr("Compilation"), this); 205 actionCompilation->setEnabled(false); 206 actionExecution = new QAction(tr("Execution"), this); 207 actionExecution->setEnabled(false); 200 208 201 209 // Les actions du menu Configuration 202 210 actionEditeur = new QAction(tr("Editeur par defaut"), this); 203 211 204 212 // Les actions du menu Aide 205 206 207 213 actionDocYao = new QAction(tr("Doc Yao"), this); 214 actionRapport = new QAction(tr("Rapport"), this); 215 //aproposYao = new QAction(tr("A propos de Yao"), this); 208 216 209 217 // Les actions de la barre d'outils 210 218 211 219 toolBarActions(espace); 212 220 213 221 } … … 217 225 void MainWindow::createToolBar() { 218 226 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 227 yaoToolBar = addToolBar(tr("&YaoToolbar")); 228 229 yaoToolBar->addWidget(m_constantButton); 230 yaoToolBar->addWidget(m_hatNameButton); 231 yaoToolBar->addWidget(m_contextButton); 232 yaoToolBar->addWidget(m_trajButton); 233 yaoToolBar->addWidget(m_spaceButton); 234 yaoToolBar->addWidget(m_operaButton); 235 yaoToolBar->addWidget(m_netwardButton); 236 yaoToolBar->addWidget(m_modulButton); 237 yaoToolBar->addWidget(m_ctinButton); 238 yaoToolBar->addWidget(m_orderButton); 239 yaoToolBar->addWidget(m_insertFCTButton); 240 yaoToolBar->addSeparator(); 241 yaoToolBar->addAction(actionSortieProjet); 234 242 235 243 } … … 244 252 } 245 253 /********************************** Implementation of the method Implementation de la methode toolBarActions() ****************************************/ 246 void MainWindow::toolBarActions(QWorkspace &espace) { 247 248 m_constantButton = new QPushButton(tr("Defval"), this); 249 m_constantButton->setToolTip("Bouton désactivé. Vous devez d'abord creer un nouveau projet ou en ouvrir un."); 250 connect(m_constantButton, SIGNAL(clicked()), this, SLOT(createDefvalWindow())); 251 connect(m_constantButton, SIGNAL(clicked()), this, SLOT(changeColorConstantButton())); 254 void MainWindow::toolBarActions(QWorkspace &espace) 255 { 256 257 m_constantButton = new QPushButton(tr("Defval"), this); 258 m_constantButton->setToolTip("Bouton désactivé. Vous devez d'abord creer un nouveau projet ou en ouvrir un."); 259 260 connect(m_constantButton, SIGNAL(clicked()), this, SLOT(createDefvalWindow())); 261 connect(m_constantButton, SIGNAL(clicked()), this, SLOT(changeColorConstantButton())); 252 262 253 254 connect(m_hatNameButton, SIGNAL(clicked()), this, SLOT(createHatNameWindow()));255 263 m_hatNameButton = new QPushButton(tr("Hatname"), this); 264 connect(m_hatNameButton, SIGNAL(clicked()), this, SLOT(createHatNameWindow())); 265 connect(m_hatNameButton, SIGNAL(clicked()), this, SLOT(changeColorHatButton())); 256 266 257 m_contextButton = new QPushButton(tr("Option"), this); 258 connect(m_contextButton, SIGNAL(clicked()), this, SLOT(createContextWindow())); 259 connect(m_contextButton, SIGNAL(clicked()), this, SLOT(changeColorContextButton())); 260 261 m_trajButton = new QPushButton(tr("Trajectory"), this); 262 connect(m_trajButton, SIGNAL(clicked()), this, SLOT(createTrajectoryWindow())); 263 connect(m_trajButton, SIGNAL(clicked()), this, SLOT(changeColorTrajButton())); 264 m_spaceButton = new QPushButton(tr("Space"), this); 265 connect(m_spaceButton, SIGNAL(clicked()), this, SLOT(createSpaceWindow())); 266 connect(m_spaceButton, SIGNAL(clicked()), this, SLOT(changeColorSpaceButton())); 267 m_operaButton = new QPushButton(tr("Operator"), this); 268 connect(m_operaButton, SIGNAL(clicked()), this, SLOT(createOperaWindow())); 269 connect(m_operaButton, SIGNAL(clicked()), this, SLOT(changeColorOperaButton())); 270 271 m_netwardButton = new QPushButton(tr("Netward"), this); 272 connect(m_netwardButton, SIGNAL(clicked()), this, SLOT(createNetwardWindow())); 273 connect(m_netwardButton, SIGNAL(clicked()), this, SLOT(changeColorNetwardButton())); 274 275 m_modulButton = new QPushButton(tr("Modul"), this); 276 connect(m_modulButton, SIGNAL(clicked()), this, SLOT(createModulWindow())); 277 connect(m_modulButton, SIGNAL(clicked()), this, SLOT(changeColorModulButton())); 278 m_ctinButton = new QPushButton(tr("Connection"), this); 279 connect(m_ctinButton, SIGNAL(clicked()), this, SLOT(createCtinWindow())); 280 connect(m_ctinButton, SIGNAL(clicked()), this, SLOT(changeColorCtinButton())); 281 m_orderButton = new QPushButton(tr("Order"), this); 282 connect(m_orderButton, SIGNAL(clicked()), this, SLOT(createOrderWindow())); 283 connect(m_orderButton, SIGNAL(clicked()), this, SLOT(changeColorOrderButton())); 284 285 m_insertFCTButton = new QPushButton(tr("Insert_fct"), this); 286 connect(m_insertFCTButton, SIGNAL(clicked()), this, SLOT(createInsertFCTWindow())); 287 connect(m_insertFCTButton, SIGNAL(clicked()), this, SLOT(changeColorInsertFCTButton())); 288 289 desactivateToolBarButtons(); // Désactive tous les boutons de la barre d'outils 267 m_contextButton = new QPushButton(tr("Option"), this); 268 connect(m_contextButton, SIGNAL(clicked()), this, SLOT(createContextWindow())); 269 connect(m_contextButton, SIGNAL(clicked()), this, SLOT(changeColorContextButton())); 270 271 m_trajButton = new QPushButton(tr("Trajectory"), this); 272 connect(m_trajButton, SIGNAL(clicked()), this, SLOT(createTrajectoryWindow())); 273 connect(m_trajButton, SIGNAL(clicked()), this, SLOT(changeColorTrajButton())); 274 m_spaceButton = new QPushButton(tr("Space"), this); 275 connect(m_spaceButton, SIGNAL(clicked()), this, SLOT(createSpaceWindow())); 276 connect(m_spaceButton, SIGNAL(clicked()), this, SLOT(changeColorSpaceButton())); 277 m_operaButton = new QPushButton(tr("Operator"), this); 278 connect(m_operaButton, SIGNAL(clicked()), this, SLOT(createOperaWindow())); 279 connect(m_operaButton, SIGNAL(clicked()), this, SLOT(changeColorOperaButton())); 280 m_netwardButton = new QPushButton(tr("Netward"), this); 281 connect(m_netwardButton, SIGNAL(clicked()), this, SLOT(createNetwardWindow())); 282 connect(m_netwardButton, SIGNAL(clicked()), this, SLOT(changeColorNetwardButton())); 283 m_modulButton = new QPushButton(tr("Modul"), this); 284 connect(m_modulButton, SIGNAL(clicked()), this, SLOT(createModulWindow())); 285 connect(m_modulButton, SIGNAL(clicked()), this, SLOT(changeColorModulButton())); 286 m_ctinButton = new QPushButton(tr("Connection"), this); 287 connect(m_ctinButton, SIGNAL(clicked()), this, SLOT(createCtinWindow())); 288 connect(m_ctinButton, SIGNAL(clicked()), this, SLOT(changeColorCtinButton())); 289 m_orderButton = new QPushButton(tr("Order"), this); 290 connect(m_orderButton, SIGNAL(clicked()), this, SLOT(createOrderWindow())); 291 connect(m_orderButton, SIGNAL(clicked()), this, SLOT(changeColorOrderButton())); 292 m_insertFCTButton = new QPushButton(tr("Insert_fct"), this); 293 connect(m_insertFCTButton, SIGNAL(clicked()), this, SLOT(createInsertFCTWindow())); 294 connect(m_insertFCTButton, SIGNAL(clicked()), this, SLOT(changeColorInsertFCTButton())); 295 296 desactivateToolBarButtons(); // Désactive tous les boutons de la barre d'outils 290 297 } 291 298 /*********************************************** Implementation of the method createDefvalWindow() *************************************************/ 292 void MainWindow::createDefvalWindow() { 299 void MainWindow::createDefvalWindow() 300 { 293 301 294 302 if (m_constantWindow == NULL) { //to test if the object is already created. 295 303 296 m_constantWindow = new ConstantWindow(&theConstantTable, &theHeaderList, &the_mwc); //Then create the object and initialize it.297 298 304 m_constantWindow = new ConstantWindow(&theConstantTable, &theHeaderList, &the_mwc); //Then create the object and initialize it. 305 espace.addWindow(m_constantWindow)->move(0, 0); //Put the object in the workspace (here, espace is the QWorkspace's object.) 306 m_constantWindow->show();// shows the object. 299 307 } 300 308 … … 309 317 if (m_hatnameWindow == NULL) { //to test if the object is already created. 310 318 311 m_hatnameWindow = new HatNameWindow(&theHeaderList, &theConstantTable); //Then create the object and initialize it.312 313 319 m_hatnameWindow = new HatNameWindow(&theHeaderList, &theConstantTable); //Then create the object and initialize it. 320 espace.addWindow(m_hatnameWindow)->move(350, 0); //Put the object in the workspace (here, espace is the QWorkspace's object.) 321 m_hatnameWindow->show();// shows the object. 314 322 } 315 323 … … 321 329 if (m_contextWindow == NULL) { //to test if the object is already created. 322 330 323 324 325 331 m_contextWindow = new ContextWindow(&theContext, &theConstantTable, &the_mwc); //mwc.getContext(); 332 espace.addWindow(m_contextWindow)->move(5, 0); 333 m_contextWindow->show(); 326 334 } 327 335 … … 333 341 if (m_trajectoryWindow == NULL) { //to test if the object is already created. 334 342 335 m_trajectoryWindow = new TrajectoryWindow(&theTrajectoryTable, &theConstantTable); //mwc.getTraj();336 337 m_trajectoryWindow->show();343 m_trajectoryWindow = new TrajectoryWindow(&theTrajectoryTable, &theConstantTable); //mwc.getTraj(); 344 espace.addWindow(m_trajectoryWindow)->move(30, 10); 345 m_trajectoryWindow->show(); 338 346 339 347 } … … 348 356 if (m_spaceWindow == NULL) { //to test if the object is already created. 349 357 350 351 352 m_spaceWindow->show();358 m_spaceWindow = new SpaceWindow(&theSpaceTable, &theTrajectoryTable, &theConstantTable); //mwc.getSpace(); 359 espace.addWindow(m_spaceWindow)->move(30, 20); 360 m_spaceWindow->show(); 353 361 } 354 362 … … 372 380 373 381 if (m_netwardWindow == NULL) { //to test if the object is already created. 374 m_netwardWindow = new NetwardWindow ; //mwc.getNetward();382 m_netwardWindow = new NetwardWindow(&theConstantTable); //mwc.getNetward(); 375 383 espace.addWindow(m_netwardWindow)->move(5, 15); 376 384 m_netwardWindow->show(); … … 444 452 void MainWindow::activateToolBarButtons() { 445 453 446 447 448 449 450 451 452 453 454 455 456 454 m_constantButton->setEnabled(true); 455 m_hatNameButton->setEnabled(true); 456 m_contextButton->setEnabled(true); 457 m_trajButton->setEnabled(true); 458 m_spaceButton->setEnabled(false); 459 m_operaButton->setEnabled(false); 460 m_netwardButton->setEnabled(true); 461 m_modulButton->setEnabled(true); 462 m_ctinButton->setEnabled(true); 463 m_orderButton->setEnabled(true); 464 m_insertFCTButton->setEnabled(true); 457 465 458 466 } … … 476 484 /**************************************** Implementation of the method nouveauProjet (SLOT) *******************************************************/ 477 485 void MainWindow::createNewProjectWindow() { // Affiche la fenetre nouveau projet lorsqu'elle est appelée. 478 //QWorkspace test; 479 //cout << "depuis mainwindow" << m_newProjectName << endl; 486 480 487 m_newProjectWindow = new NewProjectWindow(espace); 481 488 m_newProjectName = m_newProjectWindow->getProjectName(); 482 //cout << "depuis mainwindow " << m_newProjectName << endl;483 489 theHeaderList.push_back(m_newProjectWindow->getProjectName() + ".h"); 490 fv->appelActualiser(); //Permet de mettre à jour automatiquement la liste des fichiers visibles dans filesviewer. 484 491 //connect(m_newProjectWindow, SIGNAL(newProjectIsCreated()), this, SLOT(activateToolBarButtons())); 485 492 activateToolBarButtons(); 486 //m_newProjectWindow->show();487 /* newProjectWindow = new QDialog(pt_espace); // L'objet sera affiché dans "espace".488 //newProjectWindow->setWindowTitle("Création d'un nouveau projet.");489 490 QLabel *m_labelProjetDescription = new QLabel("BrÚve description du projet: ");491 m_lineDirName = new QLineEdit;//Impératif pour le champ de saisie de texte apparaisse dans la fenêtre.492 m_lineDirName->setFocus();//setCursor(Qt::IBeamCursor);493 m_linePath = new QLineEdit;494 m_linePath->setText(QDir::currentPath() + "/projects");495 QVBoxLayout *m_layoutV = new QVBoxLayout(newProjectWindow);496 QHBoxLayout *m_layoutH2 = new QHBoxLayout;497 QHBoxLayout *m_layoutH4 = new QHBoxLayout;498 QHBoxLayout *m_layoutHBottomButton = new QHBoxLayout;499 QFormLayout *m_layoutF = new QFormLayout;500 QPushButton *m_buttonPath = new QPushButton;501 m_buttonPath->setIcon(QIcon("Images/icons/openfile.png"));502 ligneInfos = new QTextEdit; // Le champ de saisie des infos relatives à un projet.503 QPushButton *m_buttonCreateNewProject = new QPushButton("Créer", newProjectWindow); // Le bouton valider.504 QPushButton *m_buttonQuitProjet = new QPushButton("Annuler", newProjectWindow); // Le bouton quitter.505 QPushButton *m_buttonHelp = new QPushButton("De l'aide?", newProjectWindow);506 507 m_layoutH2->addWidget(m_labelProjetDescription);508 m_layoutH2->addWidget(ligneInfos);509 510 m_layoutH4->addWidget(m_linePath);511 m_layoutH4->addWidget(m_buttonPath);512 513 m_layoutF->addRow("Nom du projet: ", m_lineDirName);514 m_layoutF->addRow("Chemin d'accÚs: ", m_layoutH4);515 m_layoutF->addRow(m_layoutH2);516 //m_layoutHBottomButton->addStretch (2);517 //m_layoutHBottomButton->setAlignment(Qt::AlignLeft);518 m_layoutHBottomButton->addWidget(m_buttonHelp, 10, Qt::AlignLeft);519 520 //m_layoutHBottomButton->setAlignment(Qt::AlignRight);521 m_layoutHBottomButton->addWidget(m_buttonCreateNewProject, Qt::AlignRight);522 m_layoutHBottomButton->addWidget(m_buttonQuitProjet, Qt::AlignRight);523 524 m_layoutV->addLayout(m_layoutF);525 m_layoutV->addSpacing(50);526 //m_layoutV->addStretch(20);527 m_layoutV->addLayout(m_layoutHBottomButton);528 newProjectWindow->setLayout(m_layoutV);529 newProjectWindow->setFixedWidth(baseSize().width() + 650);530 newProjectWindow->resize(baseSize().width(), (height()/3)+80); //Permet de refixer les dimensions de la fenetre.531 532 newProjectWindow->hide();533 connect(m_buttonCreateNewProject, SIGNAL(clicked()), this, SLOT(createProjectDirectory())); //Pour la création du répertoire.534 //instance ++; //Permet de compter le nombre de "Nouveau Projet" crées.535 connect(this, SIGNAL(newProjectIsCreated()), newProjectWindow, SLOT(close())); //Fermeture automatique de la fenetre lorsqu'un nouveau projet est crée536 //connect(m_buttonPath, SIGNAL(clicked()), this, SLOT(openPathWindow()));537 connect(m_buttonQuitProjet, SIGNAL(clicked()), newProjectWindow, SLOT(close()));// Pour la fermeture de fenetre.538 //connect(m_buttonHelp, SIGNAL(clicked()), this, SLOT(helpMessage()));// Pour la fermeture de fenetre.539 540 newProjectWindow->exec();541 */542 493 emit WindowTitleChanged(); 543 494 emit newProjectIsCreated(); … … 577 528 return; 578 529 } 579 /********************************************* Implementation of the method helpMessage() *********************************************************/580 /*void MainWindow::helpMessage() {581 582 QMessageBox msgBox;583 msgBox.setWindowTitle("Aide sur la création d'un nouveau projet.");584 msgBox.setText("A ce niveau, l'utilisateur est invité à remplir les différents champs.<br> Le nom du projet doit commencer par une lettre (a-z) sans accent ou un chiffre. Les autres caractÚres ne sont pas acceptés.");585 msgBox.setInformativeText("<p> Cliquez sur <b>ok</b> pour fermer cette fenêtre.");586 //msgBox.setStandardButtons(QMessageBox::Yes);587 msgBox.setDefaultButton(QMessageBox::Yes);588 589 msgBox.exec();590 }*/591 /**************************************************** Implementation of the method openPathWindow() ***********************************************/592 /*void MainWindow::openPathWindow() {593 594 QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), "/home", QFileDialog::ShowDirsOnly |595 QFileDialog::DontResolveSymlinks);596 597 m_linePath->setText(dir);598 599 600 601 }*/602 530 /***************************************** Implementation of the method montrerActionGenererD() ****************************************************/ 603 531 604 532 void MainWindow::montrerActionGenererD() { 605 actionGenerationD->setEnabled(true); 533 534 actionGenerationD->setEnabled(true); 606 535 } 607 536 … … 609 538 void MainWindow::montrerActionCompilation() { 610 539 611 540 actionCompilation->setEnabled(true); 612 541 } 613 542 /************************************************* Implementation of the method setProjectName(string chaine) **************************************/ 614 543 void MainWindow::setProjectName(string chaine) { 615 544 616 545 m_newProjectName = chaine; //To initialize or to give a name for the project. 617 546 618 547 } … … 627 556 void MainWindow::setProjectPath(string aPath) { 628 557 629 630 558 m_projectPath = aPath ; //We store here the project path. Ex: ~/interface/projects 559 } 631 560 632 561 /********************************************* Implementation of the method getProjectPath() ********************************************************/ 633 562 string MainWindow::getProjectPath() { 634 563 635 return m_projectPath; 636 } 637 638 /****************************************** Implementation of the method createProjectDirectory() (SLOT) *******************************************/ 639 /*void MainWindow::createProjectDirectory() { 640 641 // Initilization of the lexer and lexing (wrapped from the object tokenizer) 642 // Tokenizer tokenizer(filename); 643 // Initialization of the parser and parsing (wrapped from the object tokenizer) 644 // Translator translator(tokenizer); 645 // Code generation of the files Y1ProjectName.h and Y2ProjectName.h 646 // translator.descriptionVisualYAO(); 647 648 //for (Table<Constant>::iterator it = translator.theConstantTable.begin(); it != translator.theConstantTable.end(); it++) 649 // cout << "defval " << it->getName() << " " << it->getText() << endl; 650 651 652 setProjectName(m_lineDirName->text().toStdString()); //Fonction permettant d'initialiser le nom du projet. 653 setProjectPath(m_linePath->text().toStdString()); //Fonction permettant d'initialiser le chemin du projet. 654 theHeaderList.push_back(getProjectName() + ".h"); 655 656 if (m_lineDirName->text().isEmpty()) //ContrÃŽle à faire si le champ réservé au nom du projet est délaissé vide. 657 { 658 QMessageBox::critical(this, "Erreur", "Le nom du projet n'est pas spécifié! Réessayez en remplissant correctement le champ correspondant. "); 659 return; // Arrêt de la méthode 660 } 661 662 string projectNameControl; 663 664 projectNameControl = getProjectName(); 665 666 QMessageBox msgBox; 667 msgBox.setWindowTitle("Erreur de saisie."); 668 msgBox.setText("Les caractÚres saisis ne sont pas conformes."); 669 msgBox.setInformativeText("<p> Cliquez sur <b>ok</b> pour fermer cette fenêtre."); 670 //msgBox.setStandardButtons(QMessageBox::Yes); 671 msgBox.setDefaultButton(QMessageBox::Yes); 672 673 if (projectNameControl[0] == '&' || projectNameControl[0] == '@' || projectNameControl[0] == '^' 674 || projectNameControl[0] == '(' || projectNameControl[0] == ')' || projectNameControl[0] == '.' 675 || projectNameControl[0] == '{' || projectNameControl[0] == '}' || projectNameControl[0] == '$' 676 || projectNameControl[0] == '#' || projectNameControl[0] == '~' || projectNameControl[0] == '\'' 677 || projectNameControl[0] == '*' || projectNameControl[0] == '=' || projectNameControl[0] == '?' 678 || projectNameControl[0] == '!' || projectNameControl[0] == ':' || projectNameControl[0] == '-' 679 || projectNameControl[0] == '_' || projectNameControl[0] == '[' || projectNameControl[0] == ']' 680 || projectNameControl[0] == '%' || projectNameControl[0] == ',' || projectNameControl[0] == ';' 681 || projectNameControl[0] == '"' || projectNameControl[0] == '|' ) 682 683 { 684 msgBox.exec(); 685 m_lineDirName->clear(); 686 return ; 687 } 688 689 for(unsigned int i=1; i < projectNameControl.size(); i++) 690 if (projectNameControl[i] == '&' || projectNameControl[i] == '@' || projectNameControl[i] == '^' 691 || projectNameControl[i] == '(' || projectNameControl[i] == ')' || projectNameControl[i] == '.' 692 || projectNameControl[i] == '{' || projectNameControl[i] == '}' || projectNameControl[i] == '$' 693 || projectNameControl[i] == '#' || projectNameControl[i] == '~' || projectNameControl[i] == '\'' 694 || projectNameControl[i] == '*' || projectNameControl[i] == '=' || projectNameControl[i] == '?' 695 || projectNameControl[i] == '!' || projectNameControl[i] == ':' || projectNameControl[i] == '-' 696 || projectNameControl[i] == '/' || projectNameControl[i] == '[' || projectNameControl[i] == ']' 697 || projectNameControl[i] == '%' || projectNameControl[i] == ',' || projectNameControl[i] == ';' 698 || projectNameControl[i] == '"' || projectNameControl[i] == '|' ) 699 700 { 701 msgBox.exec(); 702 m_lineDirName->clear(); 703 return ; 704 } 705 706 QDir rep(QString(getProjectPath().c_str())); 707 if (!rep.exists(QString(getProjectName().c_str()))) // c_str is used for having the Qt string form (this form is QString) 708 { rep.mkdir(QString(getProjectName().c_str())); 709 createFile("", ".d"); 710 generateDefaultHFile(); 711 createFile(ligneInfos->toPlainText().toStdString(), ".txt"); 712 fv->appelActualiser(); //Permet de mettre à jour automatiquement la liste des fichiers visibles dans filesviewer. 713 QMessageBox msgBox; 714 msgBox.setWindowTitle("Opération réussie."); 715 msgBox.setText("Le projet <b> <i>\"" + QString(getProjectName().c_str()) + "\"</i></b> a été crée avec succÚs."); 716 msgBox.setInformativeText("<p> Cliquez sur <b>ok</b> pour fermer cette fenêtre."); 717 msgBox.setDefaultButton(QMessageBox::Yes); 718 msgBox.exec(); 719 activateToolBarButtons(); 720 } 721 else { 722 QMessageBox::about(this, tr("Nouveau projet"), tr("<p>Le projet existe! <p> Donnez s'il vous plait un autre nom.")); 723 m_lineDirName->clear(); 724 m_lineDirName->setCursor(Qt::IBeamCursor); 725 return; 726 727 } 728 729 emit newProjectIsCreated(); 730 emit WindowTitleChanged(); 731 }*/ 564 return m_projectPath; 565 } 566 732 567 /********************************************* Implementation of the method setWindowTitle(const QString &title) ***********************************/ 733 568 void MainWindow::setActiveProject(const bool aBool) { … … 735 570 m_activeProject = aBool; 736 571 } 572 737 573 /********************************************* Implementation of the method setWindowTitle(const QString &title) ***********************************/ 738 574 bool MainWindow::isActiveProject() { … … 740 576 return m_activeProject; 741 577 } 742 /************************************** Implementation of the method createFile(string data, string extension) ************************************/ 743 /*void MainWindow::createFile(string data, string extension) { 744 745 string filename = getProjectName() + extension; 746 string filepath = getProjectPath() + "/" + getProjectName() + "/" + getProjectName() + extension; // Respectivement le chemin, le répertoire et le fichier dans le repertoire. 747 ofstream h_file(filepath.c_str(), ios::out | ios::binary | ios::trunc); 748 if(!h_file.is_open()) 749 throw ofstream::failure("couldn't create " + filename); 750 h_file << data << endl; 751 752 h_file.close(); 753 } 754 */ 578 755 579 /**************************************** Implementation of the method generateDFile() (SLOT) ****************************************************/ 756 580 void MainWindow::generateDFile() { 757 try { 758 filename = getProjectName(); 759 filepath = "projects/" + filename + "/" + filename + ".d"; //"projects/test/test.d"; 760 ofstream description(filepath.c_str(), ios::out | ios::binary | ios::trunc); 761 if(!description.is_open()) 762 throw ofstream::failure("couldn't create " + filename); 763 //try { 764 // throw 8; 765 // } 766 //catch (int &i) 767 // { 768 // i++; 769 // throw; 770 //} 771 try { 772 description << "//DEFVAL name value -------------------------------------------------------" << endl; 773 for (Table<Constant>::iterator it = theConstantTable.begin(); it != theConstantTable.end(); it++) 774 description << "defval " << it->getName() << " " << it->getText() << endl;///*<< dynamic_cast <string>(*it)*/ << endl; 775 description << endl; 776 777 description << "//HATNAME --------------------------------------------------------------------------" << endl; 778 for(vector <string>::iterator it = theHeaderList.begin(); it != theHeaderList.end(); it++) 779 description << "hat_name \"" << it->c_str() << "\"" << endl; 780 description << endl; 781 //description << "//Contexts ----------------------------------------------------------------------" << endl; 782 783 //for(QStringList::iterator it = m_contextWindow->getContextData().begin(); it != m_contextWindow->getContextData().end(); it++) 784 // description << "option " << it->toStdString() << endl; 785 // description << endl; 786 787 description << "//TRAJECTOIRES name type uptime offtime dtime steptime -------------" << endl; 788 789 /* for(vector <string>::iterator it = m_contextWindow->getContextData().begin(); it != m_contextWindow->getContextData().end(); it++) 790 description << "option " << it->toStdString() << endl; 791 description << endl; 581 582 try 583 { 584 585 filename = getProjectName(); 586 filepath = "projects/" + filename + "/" + filename + ".d"; //"projects/test/test.d"; 587 ofstream description(filepath.c_str(), ios::out | ios::binary | ios::trunc); 588 589 if(!description.is_open()) 590 throw ofstream::failure("couldn't create " + filename); 591 description << "//DEFVAL name value -------------------------------------------------------" << endl; 592 for (Table<Constant>::iterator it = theConstantTable.begin(); it != theConstantTable.end(); it++) 593 description << "defval " << it->getName() << " " << it->getText() << endl;///*<< dynamic_cast <string>(*it)*/ << endl; 594 description << endl; 595 596 description << "//HATNAME --------------------------------------------------------------------------" << endl; 597 for(vector <string>::iterator it = theHeaderList.begin(); it != theHeaderList.end(); it++) 598 description << "hat_name \"" << it->c_str() << "\"" << endl; 599 description << endl; 600 //description << "//Contexts ----------------------------------------------------------------------" << endl; 601 602 //for(QStringList::iterator it = m_contextWindow->getContextData().begin(); it != m_contextWindow->getContextData().end(); it++) 603 // description << "option " << it->toStdString() << endl; 604 // description << endl; 605 606 description << "//TRAJECTOIRES name type uptime offtime dtime steptime -------------" << endl; 607 608 /* for(vector <string>::iterator it = m_contextWindow->getContextData().begin(); it != m_contextWindow->getContextData().end(); it++) 609 description << "option " << it->toStdString() << endl; 610 description << endl; 611 */ 612 613 for (Table<Trajectory>::iterator it = theTrajectoryTable.begin(); it != theTrajectoryTable.end(); it++) 614 description << "traj " << it->getName() << " " << it->getType() << " " << it->getBoot() << " " << it->getOffset() << " " << it->getStep() << " " << it->getSize()<< " " << endl; 615 description << endl; 616 description << "//SPACE name type dim1 [[dim2]---[dim3]] traj------------------" << endl; 617 618 for (Table<Space>::iterator it = theSpaceTable.begin(); it != theSpaceTable.end(); it++) 619 description << "space " << it->getProperty(0) << " " << it->getProperty(1) << " " << it->getProperty(2) << endl;//<< " " << it->getBoot() << " " << it->getSize() << " " << it->getStep() << " " << it->getOffset() << " " << it->getType() << endl; 620 description << endl; 621 description << "//DIMENSION ---------------------------------------------" << endl; 622 623 624 // for (QStringList::iterator it = m_spaceWindow->getData().begin(); it != m_spaceWindow->getData().end(); it++) 625 // description << "space " << it->toStdString() << endl; 626 // description << endl; 627 628 //description << "//NETWARD ---------------------------------------------------------------------------" << endl; 629 630 /*for (QStringList::iterator it = m_netwardWindow->getDataNetward().begin(); it != m_netwardWindow->getDataNetward().end(); it++) 631 description << "netward " << it->toStdString() << endl; 632 description << endl;*/ 633 // description << "//MODUL --------------------------------------------------------------------------" << endl; 634 635 /* for (QStringList::iterator it = m_modulWindow->getDataModul().begin(); it != m_modulWindow->getDataModul().end(); it++) 636 description << "modul " << it->toStdString() << endl; 637 description << endl;*/ 638 //description << "//CONNECTIONS----------------------------------------------------------------------" << endl; 639 640 /* for (QStringList::iterator it = m_ctinWindow->getDataCtin().begin(); it != m_ctinWindow->getDataCtin().end(); it++) 641 description << "ctin " << it->toStdString() << endl; */ 642 // description << "//USER FUNCTIONS ----------------------------------------------------------------" << endl; 643 //description << endl; 644 645 /* for (QStringList::iterator it = m_insertFCTWindow->getDataFCT().begin(); it != m_insertFCTWindow->getDataFCT().end(); it++) 646 description << "insert_fct " << it->toStdString() << endl; 647 description << endl; 792 648 */ 793 794 for (Table<Trajectory>::iterator it = theTrajectoryTable.begin(); it != theTrajectoryTable.end(); it++) 795 description << "traj " << it->getName() << " " << it->getType() << " " << it->getBoot() << " " << it->getOffset() << " " << it->getStep() << " " << it->getSize()<< " " << endl; 796 description << endl; 797 description << "//SPACE name type dim1 [[dim2]---[dim3]] traj------------------" << endl; 798 799 for (Table<Space>::iterator it = theSpaceTable.begin(); it != theSpaceTable.end(); it++) 800 description << "space " << it->getProperty(0) << " " << it->getProperty(1) << " " << it->getProperty(2) << endl;//<< " " << it->getBoot() << " " << it->getSize() << " " << it->getStep() << " " << it->getOffset() << " " << it->getType() << endl; 801 description << endl; 802 description << "//DIMENSION ---------------------------------------------" << endl; 803 804 805 // for (QStringList::iterator it = m_spaceWindow->getData().begin(); it != m_spaceWindow->getData().end(); it++) 806 // description << "space " << it->toStdString() << endl; 807 // description << endl; 808 809 //description << "//NETWARD ---------------------------------------------------------------------------" << endl; 810 811 /*for (QStringList::iterator it = m_netwardWindow->getDataNetward().begin(); it != m_netwardWindow->getDataNetward().end(); it++) 812 description << "netward " << it->toStdString() << endl; 813 description << endl;*/ 814 // description << "//MODUL --------------------------------------------------------------------------" << endl; 815 816 /* for (QStringList::iterator it = m_modulWindow->getDataModul().begin(); it != m_modulWindow->getDataModul().end(); it++) 817 description << "modul " << it->toStdString() << endl; 818 description << endl;*/ 819 //description << "//CONNECTIONS----------------------------------------------------------------------" << endl; 820 821 /* for (QStringList::iterator it = m_ctinWindow->getDataCtin().begin(); it != m_ctinWindow->getDataCtin().end(); it++) 822 description << "ctin " << it->toStdString() << endl; */ 823 // description << "//USER FUNCTIONS ----------------------------------------------------------------" << endl; 824 //description << endl; 825 826 /* for (QStringList::iterator it = m_insertFCTWindow->getDataFCT().begin(); it != m_insertFCTWindow->getDataFCT().end(); it++) 827 description << "insert_fct " << it->toStdString() << endl; 828 description << endl; 829 //genererConstant(); 830 //genererHat(); 831 */ 832 } 833 834 catch (...) { 835 836 cout << "Sortie du programme!" << endl; 837 throw; 838 839 } 840 description.close(); 841 } 842 catch (...) { 843 844 QMessageBox::critical(this, "Erreur", "Erreur dans la generation du fichier .d"); 845 } 649 650 description.close(); 651 } 652 653 catch (...) 654 { 655 656 QMessageBox::critical(this, "Erreur", "Erreur dans la generation du fichier .d"); 657 } 846 658 } 847 659 … … 902 714 void MainWindow::changeButtonColor(QPushButton *aButton) { 903 715 904 716 aButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 905 717 906 718 } … … 910 722 void MainWindow::changeColorConstantButton() { 911 723 912 724 changeButtonColor(m_constantButton); 913 725 914 726 } … … 923 735 void MainWindow::changeColorContextButton() { 924 736 925 737 m_contextButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 926 738 } 927 739 … … 929 741 void MainWindow::changeColorTrajButton() { 930 742 931 743 m_trajButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 932 744 } 933 745 … … 935 747 void MainWindow::changeColorSpaceButton() { 936 748 937 749 m_spaceButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 938 750 939 751 } … … 941 753 void MainWindow::changeColorOperaButton() { 942 754 943 755 m_operaButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 944 756 945 757 } … … 948 760 void MainWindow::changeColorModulButton() { 949 761 950 762 m_modulButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 951 763 } 952 764 … … 954 766 void MainWindow::changeColorCtinButton() { 955 767 956 768 m_ctinButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 957 769 958 770 } … … 961 773 void MainWindow::changeColorNetwardButton() { 962 774 963 775 m_netwardButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 964 776 965 777 } … … 967 779 void MainWindow::changeColorInsertFCTButton() { 968 780 969 781 m_insertFCTButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 970 782 971 783 } … … 974 786 void MainWindow::changeColorOrderButton() { 975 787 976 788 m_orderButton->setStyleSheet("background-color: rgb(180, 180, 180)"); 977 789 978 790 } -
trunk/yao/src/interface/src/MainWindowController.cpp
r365 r366 189 189 NetwardWindow *MainWindowController::getNetward() { 190 190 191 return m_netward = new NetwardWindow;191 //return m_netward = new NetwardWindow; 192 192 } 193 193 -
trunk/yao/src/interface/src/NetwardWindow.cpp
r357 r366 1 1 //! \file NetwardWindow.cpp 2 2 //! \brief Implementation of the Netward window for visual_YAO. 3 //! \version 2010/06/2 2(yyyy/mm/dd)3 //! \version 2010/06/28 (yyyy/mm/dd) 4 4 //! \author MAYAKI Abdouramane. 5 6 /*7 Nom du Fichier: .8 Nom de classe:9 Role:10 Nombre de methodes:11 Nombre d'attributs:12 */13 5 14 6 //! \class NetwardWindow(QWidget *parent) : QWidget(parent) … … 18 10 #include "include/NetwardWindow.hpp" 19 11 20 NetwardWindow::NetwardWindow(QWidget *parent) : QWidget(parent) { /*!< The constructor. */ 12 using namespace std; 13 using namespace yao; 14 15 NetwardWindow::NetwardWindow(Table <Constant> *aSpaceTable, QWidget *parent) : QWidget(parent) { /*!< The constructor. */ 21 16 setupUi(this); 22 17 23 18 19 m_netwardNbiCombo->setEditable(true); 20 m_netwardNbiCombo->insertItem(0, ""); 21 22 m_netwardNbsCombo->setEditable(true); 23 m_netwardNbsCombo->insertItem(0, ""); 24 25 // for (Table<Constant>::reverse_iterator it = localConstantTable->rbegin(); it != localConstantTable->rend(); it++) { 26 27 // m_spaceD1->insertItem(1, QString(it->getName().c_str())); 28 // m_spaceD2->insertItem(1, QString(it->getName().c_str())); 29 // m_spaceD3->insertItem(1, QString(it->getName().c_str())); 30 //} 31 24 32 25 33 //QStringList horizontalHeaders; … … 38 46 39 47 40 // connect(m_quitNetward, SIGNAL(clicked()), this, SLOT(close()));48 //connect(m_AjoutNetward, SIGNAL(clicked()), this, SLOT(addNetwardRow())); 41 49 //connect(m_SuppNetward, SIGNAL(clicked()), this, SLOT(deleteNetwardRow())); 42 //connect(m_AjoutNetward, SIGNAL(clicked()), this, SLOT(addNetwardRow()));43 //connect(m_AideNetward, SIGNAL(clicked()), this, SLOT(callNetwardHelp()));50 connect(m_netwardQuitButton, SIGNAL(clicked()), this, SLOT(close())); 51 connect(m_netwardHelpButton, SIGNAL(clicked()), this, SLOT(callNetwardHelp())); 44 52 //connect(m_enregNetward, SIGNAL(clicked()), this, SLOT(saveNetwardData())); 45 53 … … 183 191 }*/ 184 192 /**************************************************************************************/ 185 /*void NetwardWindow::callNetwardHelp() {193 void NetwardWindow::callNetwardHelp() { 186 194 187 195 QMessageBox::about(this, tr("Aide sur la directive Netward."),("<p> Cette directive permet de créer le code nécessaire à une implémentation aisée, dans des modules, des fonctions réseaux de neurones.<p> Pour plus d'informations sur la directive, <a href=\"help/netward_aide.html\">cliquez ici.</a>")); 188 196 189 } */197 } 190 198 /**********************************************************************/ 191 199 void NetwardWindow::closeEvent(QCloseEvent *event) { -
trunk/yao/src/interface/src/TrajectoryWindow.cpp
r365 r366 147 147 } 148 148 149 //upTime = <static_cast> QString(boot).c_str();150 //upTime = localConstantTable->find(upTime.toStdString())->getName();151 //constantValue.append(".h");152 //modeleHatName->setItem(modeleHatName->rowCount(), new QStandardItem(QString(constantValue.c_str())));153 //localHeaderList->push_back(hatFile);154 //eraseDataFromLineEdit();155 //m_delHatButton->setEnabled(true);156 //cout << "In addrow method, my coodinate is " << x() << endl;157 149 } 158 150 -
trunk/yao/src/interface/src/include/ConstantWindow.hpp
r357 r366 48 48 private: 49 49 50 /*QLabel *m_nameLabel;51 QLabel *m_valueLabel;52 53 QLineEdit *m_ligneNom;54 QLineEdit *m_ligneValeur;55 56 QPushButton *m_addButton;57 QPushButton *m_delButton;58 QPushButton *m_saveButton;59 QPushButton *m_quitButton;60 QPushButton *m_helpButton;61 62 QGridLayout *m_layoutGrid;63 */64 50 QTimer *m_constantTimer; 65 51 yao::Table <yao::Constant> *m_localConstantTable; … … 72 58 QStandardItemModel *m_defvalModel; 73 59 QModelIndex index; 74 //QTableView *m_tableView;75 60 MainWindowController *localMwc; 76 61 //ConstantWindowController *localConstantController; -
trunk/yao/src/interface/src/include/HatNameWindow.hpp
r357 r366 4 4 #include <QVBoxLayout> 5 5 #include <QPushButton> 6 class QPushButton;7 6 #include <QFormLayout> 8 7 #include <QLineEdit> 9 8 #include <QListView> 10 9 #include <QStandardItemModel> 11 #include <QTableWidget>12 10 #include <QMessageBox> 13 11 #include <QCloseEvent> -
trunk/yao/src/interface/src/include/InsertFCTWindow.hpp
r365 r366 14 14 #include <QStandardItemModel> 15 15 #include <QMessageBox> 16 #include <QStringList> 16 #include <QMessageBox> 17 #include <sstream> 17 18 18 19 class InsertFCTWindow : public QWidget, public Ui::InsertFCTWindow { … … 39 40 private : 40 41 QStandardItemModel *m_insertFCTModel; 42 QModelIndex index; 41 43 yao::Table <yao::Function> *localFunctionTable; 42 44 -
trunk/yao/src/interface/src/include/NetwardWindow.hpp
r357 r366 9 9 #ifndef NETWARD_HPP 10 10 #define NETWARD_HPP 11 #include "../../../YAOObjects/Constant.hpp" 12 #include "../../../YAOObjects/Table.hpp" 11 13 12 14 #include "../../ui_netwardwindow.h" … … 27 29 * 28 30 */ 29 NetwardWindow( QWidget *parent=0); /*!< This function sets the file's name. */31 NetwardWindow(yao::Table <yao::Constant> *aSpaceTable, QWidget *parent=0); /*!< This function sets the file's name. */ 30 32 31 33 //--void addRowNetward(); … … 35 37 //void addNetwardRow(); /*!< This function is called to add row in the visual window model. */ 36 38 //void deleteNetwardRow(); /*!< This function is called to delete row from the Yao model. */ 37 //void callNetwardHelp(); /*!< This function is called to help of this directive.*/39 void callNetwardHelp(); /*!< This function is called to help of this directive.*/ 38 40 39 41 signals: -
trunk/yao/src/interface/src/ui_/netwardwindow.ui
r362 r366 90 90 </item> 91 91 <item> 92 <widget class="QComboBox" name="m_ comboNbi"/>92 <widget class="QComboBox" name="m_netwardNbiCombo"/> 93 93 </item> 94 94 <item> 95 <widget class="QComboBox" name="m_ comboNbs"/>95 <widget class="QComboBox" name="m_netwardNbsCombo"/> 96 96 </item> 97 97 </layout> … … 126 126 <layout class="QVBoxLayout" name="verticalLayout"> 127 127 <item> 128 <widget class="QPushButton" name="m_ addNetwardButton">128 <widget class="QPushButton" name="m_netwardAddButton"> 129 129 <property name="text"> 130 130 <string>Ajouter</string> … … 136 136 </item> 137 137 <item> 138 <widget class="QPushButton" name="m_ delNetwardButton">138 <widget class="QPushButton" name="m_netwardDeleteButton"> 139 139 <property name="text"> 140 140 <string>Supprimer</string> … … 143 143 </item> 144 144 <item> 145 <widget class="QPushButton" name="m_ quitNetwardButton">145 <widget class="QPushButton" name="m_netwardQuitButton"> 146 146 <property name="text"> 147 147 <string>Quitter</string> … … 154 154 </layout> 155 155 </widget> 156 <widget class="QPushButton" name="m_ helpNetwardButton">156 <widget class="QPushButton" name="m_netwardHelpButton"> 157 157 <property name="geometry"> 158 158 <rect> … … 183 183 </widget> 184 184 <tabstops> 185 <tabstop>m_ comboNbi</tabstop>186 <tabstop>m_ comboNbs</tabstop>187 <tabstop>m_ addNetwardButton</tabstop>188 <tabstop>m_ delNetwardButton</tabstop>185 <tabstop>m_netwardNbiCombo</tabstop> 186 <tabstop>m_netwardNbsCombo</tabstop> 187 <tabstop>m_netwardAddButton</tabstop> 188 <tabstop>m_netwardDeleteButton</tabstop> 189 189 <tabstop>m_netwardTableView</tabstop> 190 <tabstop>m_ quitNetwardButton</tabstop>191 <tabstop>m_ helpNetwardButton</tabstop>190 <tabstop>m_netwardQuitButton</tabstop> 191 <tabstop>m_netwardHelpButton</tabstop> 192 192 </tabstops> 193 193 <resources/> -
trunk/yao/src/interface/ui_newprojectwindow.h
r363 r366 2 2 ** Form generated from reading UI file 'newprojectwindow.ui' 3 3 ** 4 ** Created: Sun Jun 27 08:21:3320104 ** Created: Mon Jun 28 16:52:10 2010 5 5 ** by: Qt User Interface Compiler version 4.6.2 6 6 **
Note: See TracChangeset
for help on using the changeset viewer.