1 | #include <iostream>
|
---|
2 | #include <string.h>
|
---|
3 | #include <sstream>
|
---|
4 | #include "ClientSocket.h"
|
---|
5 | #include "SocketException.h"
|
---|
6 | #include <stdio.h>
|
---|
7 | #include <pthread.h>
|
---|
8 | #include <X11/Xlib.h>
|
---|
9 | #include "filetools.h"
|
---|
10 | #include "astro.h"
|
---|
11 | #include "math.h"
|
---|
12 | #include <time.h>
|
---|
13 | #include <unistd.h>
|
---|
14 | #include <sys/time.h>
|
---|
15 |
|
---|
16 |
|
---|
17 | #define red "\033[0;31m"
|
---|
18 | #define blue "\033[0;34m"
|
---|
19 | #define green "\033[0;32m"
|
---|
20 | #define black "\033[0;30m"
|
---|
21 |
|
---|
22 | #define MAXLOG 1000
|
---|
23 | #define MAXOBJETS 100
|
---|
24 | #define MAXANTENNES 100
|
---|
25 |
|
---|
26 | #define larg 600
|
---|
27 | #define haut 10+30*12
|
---|
28 |
|
---|
29 | using namespace std;
|
---|
30 |
|
---|
31 |
|
---|
32 | struct DefAntenne
|
---|
33 | {
|
---|
34 | unsigned char ip;
|
---|
35 |
|
---|
36 | char ok;
|
---|
37 | };
|
---|
38 |
|
---|
39 | struct DefObjets
|
---|
40 | {
|
---|
41 | double JJ;
|
---|
42 | double Duree;
|
---|
43 | char ad[10];
|
---|
44 | char de[10];
|
---|
45 | bool exec;
|
---|
46 | };
|
---|
47 |
|
---|
48 |
|
---|
49 | char Latitude[80];
|
---|
50 | char Longitude[80];
|
---|
51 | char Serveur[80];
|
---|
52 |
|
---|
53 | std::string logs[MAXLOG];
|
---|
54 |
|
---|
55 | std::stringstream os;
|
---|
56 |
|
---|
57 | int Port=0;
|
---|
58 | int delaitransit=0;
|
---|
59 | int delaitracking=0;
|
---|
60 | int lognum=0;
|
---|
61 | int numAntenne=0;
|
---|
62 | int numobjets=0;
|
---|
63 | int runnum=1;
|
---|
64 |
|
---|
65 | struct DefAntenne Antennes[MAXANTENNES];
|
---|
66 | struct DefObjets objets[MAXOBJETS];
|
---|
67 |
|
---|
68 | bool NoExit=true;
|
---|
69 | bool Transit=false;
|
---|
70 | bool run=false;
|
---|
71 | bool exitrun=false;
|
---|
72 |
|
---|
73 | ClientSocket *client_socket;
|
---|
74 | Astro *astro;
|
---|
75 |
|
---|
76 | Display * d;
|
---|
77 | Window w;
|
---|
78 | Pixmap db;
|
---|
79 | GC noir, vert, rouge, gris;
|
---|
80 |
|
---|
81 |
|
---|
82 | void initialiserFenetre();
|
---|
83 | void Dessiner();
|
---|
84 | void rouler(char* reponse);
|
---|
85 | void LireReponse();
|
---|
86 | void *my_thread_process (void * arg);
|
---|
87 | bool Decomposition(std::string chaine, char type, float *a1, float *a2, float *a3);
|
---|
88 | bool DecompositionCommande(std::string chaine, std::string commande, std::string *chaine1, std::string *chaine2);
|
---|
89 | bool EncoyerCoordGeographiques();
|
---|
90 | bool Connect(bool connect);
|
---|
91 | bool Park();
|
---|
92 | bool Abort();
|
---|
93 | bool Goto(std::string ar, std::string dec, bool Transit);
|
---|
94 | bool LectureFichierMouvements(char * fileName);
|
---|
95 | bool Run(std::string fichier);
|
---|
96 | void DecodageFonction(std::string chaine);
|
---|
97 | bool ChargementParametres();
|
---|