Last change
on this file was
144,
checked in by rosiere, 14 years ago
|
1) compatible gcc 4.4.3
2) Translation file in MORPHEO_PREFIX directory
|
-
Property svn:keywords set to
Id
|
File size:
1.7 KB
|
Line | |
---|
1 | #ifdef SYSTEMC |
---|
2 | #include "systemc.h" |
---|
3 | #endif |
---|
4 | #include "../include/TTY.h" |
---|
5 | #include <iostream> |
---|
6 | |
---|
7 | using namespace std; |
---|
8 | using namespace environment; |
---|
9 | using namespace environment::tty; |
---|
10 | |
---|
11 | #ifdef SYSTEMC |
---|
12 | int sc_main (int argc, char * argv[]) |
---|
13 | #else |
---|
14 | int main (int argc, char * argv[]) |
---|
15 | #endif |
---|
16 | { |
---|
17 | cout << "<main> Begin" << endl; |
---|
18 | |
---|
19 | uint32_t nb_tty = 4; |
---|
20 | string * name_tty = new string [nb_tty]; |
---|
21 | |
---|
22 | name_tty [0] = "tty_0"; |
---|
23 | name_tty [1] = "tty_1"; |
---|
24 | name_tty [2] = "tty_2"; |
---|
25 | name_tty [3] = "tty_3"; |
---|
26 | |
---|
27 | Parameters * param = new Parameters (nb_tty, |
---|
28 | name_tty, |
---|
29 | true); |
---|
30 | |
---|
31 | TTY * tty = new TTY ("my_tty", param); |
---|
32 | tty->reset(); |
---|
33 | |
---|
34 | cout << *tty << endl; |
---|
35 | |
---|
36 | const char * message_0 = "Ici Londre : Adeline aime la saucisse de Frankort.\nJe repete : Adeline aime la saucisse de Frankort" ; |
---|
37 | const char * message_1 = "Ici Londre : Maurice a garer le camion de bernard dans la cour.\nJe repete Maurice a garer le camion de bernard dans la cour"; |
---|
38 | const char * message_2 = "Ici Londre : Londre est la ville qui diffuse des messages a la con.\nJe repete : Londre est la ville qui diffuse des messages a la con"; |
---|
39 | const char * message_3 = "Ici Londre : Non, le debarquement n'aura pas lieu le 6 juin 1944 en Normandie, et je ne me repete pas"; |
---|
40 | |
---|
41 | const char * message [nb_tty]; |
---|
42 | message[0] = message_0; |
---|
43 | message[1] = message_1; |
---|
44 | message[2] = message_2; |
---|
45 | message[3] = message_3; |
---|
46 | |
---|
47 | for (uint32_t j = 0; j < nb_tty ; j ++) |
---|
48 | { |
---|
49 | for (uint32_t i = 0; i < strlen(message[j]); i++) |
---|
50 | tty->write(j,message[j][i]); |
---|
51 | } |
---|
52 | |
---|
53 | cout << "<main> Press <Enter> to stop the test" << endl; |
---|
54 | getchar(); |
---|
55 | |
---|
56 | delete tty; |
---|
57 | delete param; |
---|
58 | delete [] name_tty; |
---|
59 | cout << "<main> End" << endl; |
---|
60 | |
---|
61 | return EXIT_SUCCESS; |
---|
62 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.