-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
342 lines (296 loc) · 16.7 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#include <iostream>
int firstInput = 0;
int inCalcul = 0;
int manageImput = 0;
char quitInput;
const char oui = 'o';
const char non = 'n';
bool inputOn = false;
int FIRST_INPUT();
int INPUT_WHILE();
int FIRSTINPUT_DETECTOR();
int QUIT_ASK_001();
int QUIT_INPUT_QA001();
int QUIT();
int HELPER();
int CLEAR();
///--------------------------------------------------
int main()
{
// CODE:
std::cout << " Bienvenue dans 'Organ Counter' !" << std::endl;
FIRST_INPUT();
while (inputOn == true)
{
FIRSTINPUT_DETECTOR();
break;
}
return 0;
}
///------------------------------------------------------------------------------------------------------------------------------------------------------
///------------------------------------------------------------------------------------------------------------------------------------------------------
///------------------------------------------------------------------------------------------------------------------------------------------------------
int FIRST_INPUT()
{
if (firstInput != 0)
{
firstInput = 0;
}
std::cout << "Enter une commande." << std::endl;
std::cout << "-------------------" << std::endl;
std::cout << " ====================================================================== " << std::endl;
std::cout << " | [1] --> Commence un nouveau calcul. | <-- Not working." << std::endl;
std::cout << " | [2] --> Ouvrir un fichier calculde organ counter (fichier '.OCCL').| <-- Not working." << std::endl;
std::cout << " | [3] --> Ouvre l'aide. |" << std::endl;
std::cout << " | [4] --> Nettoyer. |" << std::endl;
std::cout << " | [5] --> Quitte 'Organ Counter'. |" << std::endl;
std::cout << " ====================================================================== " << std::endl;
std::cout << ">";
std::cin >> firstInput;
std::cin.ignore();
FIRSTINPUT_DETECTOR();
return 0;
}
int INPUT_WHILE()
{
while (inputOn == true)
{
FIRST_INPUT();
}
inputOn = false;
return 0;
}
int FIRSTINPUT_DETECTOR()
{
if (firstInput < 0 && firstInput > 5) ///entry detect
{
std::cout << "ERR: WRONG_ENTRY." << std::endl;
std::cout << "Please retry..." << std::endl;
INPUT_WHILE();
FIRST_INPUT();
std::cin.ignore();
}
else
{
if (firstInput == 1) ///start new calcul
{
//bla bla bla...
inputOn = true;
}
if (firstInput == 2) ///open .occl file
{
//bla bla bla...
inputOn = true;
}
if (firstInput == 3) ///open help
{
//bla bla bla...
inputOn = true;
HELPER();
FIRST_INPUT();
}
if (firstInput == 4) ///clear prompt
{
CLEAR();
FIRST_INPUT();
inputOn = true;
}
if (firstInput == 5) ///quit program
{
//bla bla bla
inputOn = true;
QUIT_ASK_001();
}
}
firstInput = 0;
return 0;
}
int CLEAR()
{
system("cls");
return 0;
//system("clear"); /* Sous Unix et dérivé */
//system("cls"); /* Sous Windows */
}
//system("clear"); /* Sous Unix et dérivé */
//system("cls"); /* Sous Windows */
int QUIT_ASK_001()
{
std::cout << "Etes-vous sure de vouloir quite Organ Counter ? [O/n]" << std::endl;
std::cout << ">";
std::cin >> quitInput;
QUIT_INPUT_QA001();
return 0;
}
int QUIT_INPUT_QA001()
{
if (quitInput == oui)
{
QUIT();
}
if (quitInput == non)
{
FIRST_INPUT();
}
else
{
FIRST_INPUT();
}
return 0;
}
int QUIT()
{
exit(0);
return 0;
}
///--------------------------------------------------------------------------------------------------------------------------------------------------
///--------------------------------------------------------------------------------------------------------------------------------------------------
///--------------------------------------------------------------------------------------------------------------------------------------------------
int HELPER()
{
std::cout << "************" << std::endl;
std::cout << "* AIDE *" << std::endl;
std::cout << "************" << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " **************************" << std::endl;
std::cout << " * AIDE AUX COMMANDES *" << std::endl;
std::cout << " **************************" << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " **************************" << std::endl;
std::cout << " * COMMANDES BASIQUES *" << std::endl;
std::cout << " **************************" << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [1] . Commence un nouveau calcul." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Utiliser cette commandes pour commence un nouveau" << std::endl;
std::cout << " calcul." << std::endl;
std::cout << " " << std::endl;
std::cout << " *************************************" << std::endl;
std::cout << " * AIDE : NOUVEAU CALCUL (START) *" << std::endl;
std::cout << " *************************************" << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [STOP] . Arret de l'operation actuelle." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Stop l'operation en cours." << std::endl;
std::cout << " Utiliser 'continue' pour poursuivre l'operation." << std::endl;
std::cout << " Permet egalement d'utiliser 'next', 'back' ou" << std::endl;
std::cout << " 'done'." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [CONTINUE] . Revenir au calcul." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Permet de poursuivre l'operation apres un 'stop'." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [NEXT] . Etape suivante." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Entre 'next' quand Organ Counter declare avoir" << std::endl;
std::cout << " termine l'operation pour passe à l'operation" << std::endl;
std::cout << " suivante." << std::endl;
std::cout << " 'next' peut aussi etre utiliser pour passer" << std::endl;
std::cout << " l'operation actuelle apres un 'stop'." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [BACK] . Etapes precedantes." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Entre 'back' quand Organ Counter declare avoir" << std::endl;
std::cout << " termine l'operation pour revenir à l'operation" << std::endl;
std::cout << " precedante." << std::endl;
std::cout << " 'back' peut aussi être utiliser pour annuler" << std::endl;
std::cout << " l'operation actuelle apres un 'stop'." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [DONE] . Termine l'operation en cours." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Termine l'operation actuelle." << std::endl;
std::cout << " permet egalement de sauvgarder le calcul en cours." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " ***************************************" << std::endl;
std::cout << " * AIDE : COMMANDES DE SAUVEGARDES * <-- Not working." << std::endl;
std::cout << " ***************************************" << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [1] . Sauvegarder le calcul (.txt)." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Sauvegarder le calcul au format '.TXT' dans les" << std::endl;
std::cout << " dossiers de Organ Counter (dossier : saves)." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [2] . Sauvegarder le calcul (.occl)." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Sauvegarder le calculau format '.OCCL' dans les" << std::endl;
std::cout << " dossiers de Organ Counter (dossier : saves)." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
///--------------------------------------------------------------------------------------------------------------------------------------------------
///--------------------------------------------------------------------------------------------------------------------------------------------------
///--------------------------------------------------------------------------------------------------------------------------------------------------
std::cout << " **********************************" << std::endl;
std::cout << " * INFORMATIONS DES COMMANDES *" << std::endl;
std::cout << " **********************************" << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [1] . Commence un nouveau calcul." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Cette commandes permet de démarrer un nouveau" << std::endl;
std::cout << " calcul. Elle execute une fonction appelle" << std::endl;
std::cout << " 'NEW_CALCUL', en entrant une series de variable" << std::endl;
std::cout << " Organ Counter va realiser une series de calcul via" << std::endl;
std::cout << " des boucles de types 'while'." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [2] . Aide." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Pas besoin de l'expliquer vous l'avez devant les" << std::endl;
std::cout << " yeux." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [3] . Ouvrir un fichiers. <-- Not working." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Cette commande execute une fonction permetant" << std::endl;
std::cout << " d'ouvrir un fichier depuis l'explorer ou via le" << std::endl;
std::cout << " chemin d'acces du fichier." << std::endl;
std::cout << " Organ Counter ne peut ouvrir que des fichiers en" << std::endl;
std::cout << " '.OCCL'. Les fichiers '.OCCL' sont des fichiers" << std::endl;
std::cout << " XML." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [4] . Stop." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " La commande 'stop' permet basiquement de stopper " << std::endl;
std::cout << " la tache actuelle. Permetant alors d'effectuer un" << std::endl;
std::cout << " nettoyage du prompt (clear), terminer un calcul" << std::endl;
std::cout << " (done), ou quitte Organ Counter (quit)" << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " [5] . Quiter Organ Counter." << std::endl;
std::cout << " --------------------------------------------------" << std::endl;
std::cout << " Execute une fonction appellé 'QUIT_ASK', qui vous" << std::endl;
std::cout << " demandera alors si vous êtes sur de vouloir quitte" << std::endl;
std::cout << " Organ Counter. Pour quité entre 'o' pour 'Oui'," << std::endl;
std::cout << " pour annuler, entre 'n' pour 'non'." << std::endl;
std::cout << " " << std::endl; //-------------------------------------------------- --- ------------------------------
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
std::cout << " " << std::endl;
///--------------------------------------------------------------------------------------------------------------------------------------------------
return 0;
}
//std::cout << " " << std::endl;
//std::cout << "" << std::endl;
//std::cout << " --------------------------------------------------" << std::endl;
//--------------------------------------------------
//-------------------------------------------------- ---
//-------------------------------------------------- --- ------------------------------
///--------------------------------------------------------------------------------------------------------------------------------------------------