1 | #ifndef MAINWINDOW_HPP |
---|
2 | #define MAINWINDOW_HPP |
---|
3 | |
---|
4 | #include <cstring> |
---|
5 | #include <exception> |
---|
6 | #include <cstdlib> |
---|
7 | #include <sstream> |
---|
8 | #include <iostream> |
---|
9 | |
---|
10 | #include "../YAOObjects/Modul.hpp" |
---|
11 | |
---|
12 | #include <QtGui> |
---|
13 | #include <QMainWindow> |
---|
14 | #include <iostream> |
---|
15 | //#include <QStringList> |
---|
16 | |
---|
17 | #include "ConstantWindow.hpp" |
---|
18 | #include "InsertFCTWindow.hpp" |
---|
19 | #include "InstructionWindow.hpp" |
---|
20 | #include "ModulWindow.hpp" |
---|
21 | #include "NetwardWindow.hpp" |
---|
22 | #include "SpaceController.hpp" |
---|
23 | #include "SpaceWindow.hpp" |
---|
24 | #include "TrajectoryWindow.hpp" |
---|
25 | #include "OperaWindow.hpp" |
---|
26 | #include "ContextWindow.hpp" |
---|
27 | #include "OrderWindow.hpp" |
---|
28 | #include "ConnectionWindow.hpp" |
---|
29 | #include "NewProjectWindow.hpp" |
---|
30 | #include "editor.h" |
---|
31 | |
---|
32 | |
---|
33 | class QDateEdit; |
---|
34 | class QTextCodec; |
---|
35 | class FilesViewer; |
---|
36 | class QTableView; |
---|
37 | class QTextCodec; |
---|
38 | class QWorkspace; |
---|
39 | class QStringList; |
---|
40 | class QStringListModel; |
---|
41 | class HatNameWindow; |
---|
42 | |
---|
43 | /*! |
---|
44 | * \class MainWindow |
---|
45 | * \brief MainWindow class for visual_YAO. |
---|
46 | */ |
---|
47 | |
---|
48 | class MainWindow : public QMainWindow { |
---|
49 | Q_OBJECT |
---|
50 | |
---|
51 | public : |
---|
52 | /*! |
---|
53 | * \brief Constructor |
---|
54 | * |
---|
55 | * Constructor of the class MainWindow |
---|
56 | * |
---|
57 | */ |
---|
58 | |
---|
59 | MainWindow(QWidget *parent = 0); |
---|
60 | MainWindow(yao::Table <yao::Constant> aConstantTable); |
---|
61 | |
---|
62 | void toolBarActions(QWorkspace &espace); |
---|
63 | void createActions(); |
---|
64 | void createToolBar(); |
---|
65 | void createMenus(); |
---|
66 | void setProjectName(std::string chaine); //!< Sets project's name. |
---|
67 | std::string getProjectName(); //!< Gets project's name. |
---|
68 | void setProjectPath(string aPath); |
---|
69 | std::string getProjectPath(); |
---|
70 | void directivesManager(); |
---|
71 | void setActiveProject(const bool aBool); |
---|
72 | bool isActiveProject(); |
---|
73 | bool contextTest; |
---|
74 | |
---|
75 | /*template <class R, class S> void createDefvalWindow(R *directive, S *espace) { |
---|
76 | |
---|
77 | if (directive == NULL) { //to test if the object is already created. |
---|
78 | |
---|
79 | directive = new directive ; |
---|
80 | espace->addWindow(directive)->move(0, 0); //Put the object in the workspace |
---|
81 | directive->show();// shows the object. |
---|
82 | } |
---|
83 | |
---|
84 | connect(directive, SIGNAL(rowIsAdded()), this, SLOT(hatUpdate())); |
---|
85 | connect(directive, SIGNAL(rowIsDeleted(QString )), this, SLOT(hatUpdate(QString ))); |
---|
86 | connect(directive, SIGNAL(windowIsClosed(int )), this, SLOT(initializeWindow(int ))); |
---|
87 | |
---|
88 | }*/ |
---|
89 | |
---|
90 | //~MainWindow(); |
---|
91 | protected : |
---|
92 | //void closeEvent(QCloseEvent *event); |
---|
93 | //private slots: |
---|
94 | |
---|
95 | public slots: |
---|
96 | |
---|
97 | void clearAllStructures(); |
---|
98 | void activateToolBarButtons(); |
---|
99 | void cacherBarreOutils(); |
---|
100 | void desactivateToolBarButtons(); |
---|
101 | void generateDFile(std::string destination = "projects/"); |
---|
102 | void callGenerateDFile();// used only for the execution button |
---|
103 | void generateIFile(std::string destination = "projects/"); |
---|
104 | void instructionFileManager(); |
---|
105 | void montrerActionCompilation(); |
---|
106 | void montrerActionGenererD(); |
---|
107 | void createNewProjectWindow(); |
---|
108 | void openProject(); |
---|
109 | //void helpMessage(); |
---|
110 | void createDefvalWindow(); |
---|
111 | void createHatNameWindow(); |
---|
112 | void createContextWindow(); |
---|
113 | void createTrajectoryWindow(); |
---|
114 | void createSpaceWindow(); |
---|
115 | void createOperaWindow(); |
---|
116 | void createNetwardWindow(); |
---|
117 | void createModulWindow(); |
---|
118 | void createCtinWindow(); |
---|
119 | void createOrderWindow(); |
---|
120 | void createInsertFCTWindow(); |
---|
121 | void initializeWindow(int anInt); |
---|
122 | void changeButtonColor(QPushButton *aButton); |
---|
123 | void changeColorConstantButton(); |
---|
124 | void changeColorHatButton(); |
---|
125 | void changeColorContextButton(); |
---|
126 | void changeColorTrajButton(); |
---|
127 | void changeColorSpaceButton(); |
---|
128 | void changeColorOperaButton(); |
---|
129 | void changeColorModulButton(); |
---|
130 | void changeColorCtinButton(); |
---|
131 | void changeColorNetwardButton(); |
---|
132 | void changeColorInsertFCTButton(); |
---|
133 | void changeColorOrderButton(); |
---|
134 | //void createProjectDirectory(); |
---|
135 | //void openPathWindow(); |
---|
136 | void setTitle(); |
---|
137 | void hatUpdate(); |
---|
138 | void hatUpdate(QString choix ); |
---|
139 | void trajUpdate(); |
---|
140 | //void contextUpdate(); |
---|
141 | void mainWindowIsModified(); |
---|
142 | void saveAs(); |
---|
143 | void save(); |
---|
144 | void enableIAction(); |
---|
145 | void createEditor(); |
---|
146 | |
---|
147 | signals : |
---|
148 | void modified(); |
---|
149 | void newProjectIsCreated(); |
---|
150 | void newProjectIsCreated(QString chaine); |
---|
151 | void WindowTitleChanged(); |
---|
152 | //void activeTheIAction(); |
---|
153 | |
---|
154 | private : |
---|
155 | |
---|
156 | MainWindowController the_mwc; |
---|
157 | InstructionWindow *iw; |
---|
158 | // Les attributs des menus |
---|
159 | QMenu *menuFichier; |
---|
160 | QMenu *menuEdition; |
---|
161 | QMenu *menuAffichage; |
---|
162 | QMenu *menuExecution; |
---|
163 | QMenu *menuConfig; |
---|
164 | QMenu *menuAide; |
---|
165 | |
---|
166 | // Les actions du menu Fichier |
---|
167 | QAction *actionFichierDescription; |
---|
168 | QAction *actionFichierHat; |
---|
169 | QAction *actionModule; |
---|
170 | QAction *actionFichierInstruction; |
---|
171 | QAction *actionGrapheModulaire; |
---|
172 | QAction *actionInfosProjet; |
---|
173 | QAction *actionNouveauProjet; |
---|
174 | QAction *actionOuvrirProjet; |
---|
175 | QAction *actionOuvrirProjetsRecents; |
---|
176 | QAction *actionImporterProjet; |
---|
177 | QAction *actionSaveProject; |
---|
178 | QAction *actionSaveAsProject; |
---|
179 | QAction *actionImprimerProjet; |
---|
180 | QAction *actionSortieProjet; |
---|
181 | |
---|
182 | // Les actions du menu edition |
---|
183 | //QAction *actionAnnuler; |
---|
184 | //QAction *actionRevenir; |
---|
185 | //QAction *actionCouper; |
---|
186 | //QAction *actionCopier; |
---|
187 | //QAction *actionColler; |
---|
188 | //QAction *actionSelectionnerTout; |
---|
189 | |
---|
190 | // Les actions du menu affichage |
---|
191 | QAction *actionCacherBarreOutils; |
---|
192 | QAction *actionCacherFenetreApercu; |
---|
193 | QAction *actionCacherFenetreProjet; |
---|
194 | QAction *actionCacherFenetreDialog; |
---|
195 | //QAction *actionPleinEcran; |
---|
196 | |
---|
197 | // Les actions du menu Execution |
---|
198 | QAction *actionGenerationD; |
---|
199 | QAction *actionGenerationI; |
---|
200 | QAction *actionCompilation; |
---|
201 | QAction *actionExecution; |
---|
202 | |
---|
203 | // Les actions du menu configuration |
---|
204 | QAction *actionEditeur; |
---|
205 | |
---|
206 | // Les actions du menu aide |
---|
207 | QAction *actionDocYao; |
---|
208 | QAction *actionRapport; |
---|
209 | |
---|
210 | // La barre d'outils |
---|
211 | QPushButton *m_constantButton; |
---|
212 | QPushButton *m_hatNameButton; |
---|
213 | QPushButton *m_contextButton; |
---|
214 | QPushButton *m_trajButton; |
---|
215 | QPushButton *m_spaceButton; |
---|
216 | QPushButton *m_operaButton; |
---|
217 | QPushButton *m_netwardButton; |
---|
218 | QPushButton *m_modulButton; |
---|
219 | QPushButton *m_ctinButton; |
---|
220 | QPushButton *m_orderButton; |
---|
221 | QPushButton *m_insertFCTButton; |
---|
222 | |
---|
223 | QToolBar *yaoToolBar; //Crée une barre d'outils |
---|
224 | QStatusBar *barreEtat; |
---|
225 | QWorkspace espace; |
---|
226 | QWorkspace *pt_espace; |
---|
227 | QTableWidget *tableWidget; |
---|
228 | QString curFile; |
---|
229 | QDockWidget *fenetreProjet; |
---|
230 | ConstantWindow *m_constantWindow; |
---|
231 | HatNameWindow *m_hatnameWindow; |
---|
232 | ContextWindow *m_contextWindow; |
---|
233 | TrajectoryWindow *m_trajectoryWindow; |
---|
234 | SpaceWindow *m_spaceWindow; |
---|
235 | OperaWindow *m_operaWindow; |
---|
236 | NetwardWindow *m_netwardWindow; |
---|
237 | ModulWindow *m_modulWindow; |
---|
238 | ConnectionWindow *m_ctinWindow; |
---|
239 | OrderWindow *m_orderWindow; |
---|
240 | InsertFCTWindow *m_insertFCTWindow; |
---|
241 | |
---|
242 | NewProjectWindow *m_newProjectWindow; |
---|
243 | NewProjectWindow *m_newProjectWindow2; |
---|
244 | |
---|
245 | FilesViewer *fv; |
---|
246 | std::string filename; |
---|
247 | std::string filepath; |
---|
248 | //!< les onglets |
---|
249 | QTabWidget *tabWidget; |
---|
250 | QWidget *page1; |
---|
251 | QWidget *page2; |
---|
252 | QLineEdit *m_lineDirName; |
---|
253 | QLineEdit *m_linePath; |
---|
254 | QTextEdit *ligneInfos; |
---|
255 | //QDialog *newProjectWindow; |
---|
256 | std::string m_newProjectName; |
---|
257 | std::string m_projectPath; |
---|
258 | |
---|
259 | // Yao structures are follow: |
---|
260 | yao::Constant m_theConstant; |
---|
261 | yao::Table <yao::Constant> theConstantTable; |
---|
262 | yao::Table <yao::Constant> &theConstantTablePt; |
---|
263 | |
---|
264 | std::vector <string> theHeaderList; |
---|
265 | yao::Context theContext; |
---|
266 | //yao::Modul theModul; |
---|
267 | yao::Table <yao::Trajectory> theTrajectoryTable; |
---|
268 | yao::Table <yao::Space> theSpaceTable; |
---|
269 | yao::Table <yao::Operator> theOperaTable; |
---|
270 | yao::Table <yao::Neuron> theNeuronTable; |
---|
271 | yao::Table <yao::Modul> theModulTable; |
---|
272 | yao::Table <yao::Connection> theConnectionTable; |
---|
273 | yao::Table <yao::Order> theOrderTable; |
---|
274 | yao::Table <yao::Function> theFunctionTable; |
---|
275 | |
---|
276 | std::string theContextData; |
---|
277 | |
---|
278 | std::vector <std::string> theInstructionData; |
---|
279 | |
---|
280 | bool m_activeProject; |
---|
281 | bool confirmationFlag; |
---|
282 | |
---|
283 | QDateEdit *date; |
---|
284 | |
---|
285 | }; |
---|
286 | #endif // FENETREPRINCIPALE_HPP |
---|