| 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 | using namespace std;
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | struct DefAntenne
|
|---|
| 30 | {
|
|---|
| 31 | unsigned char ip;
|
|---|
| 32 |
|
|---|
| 33 | char ok;
|
|---|
| 34 | };
|
|---|
| 35 |
|
|---|
| 36 | struct DefObjets
|
|---|
| 37 | {
|
|---|
| 38 | double JJ;
|
|---|
| 39 | double Duree;
|
|---|
| 40 | char ad[10];
|
|---|
| 41 | char de[10];
|
|---|
| 42 | bool exec;
|
|---|
| 43 | };
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 | char Latitude[80];
|
|---|
| 47 | char Longitude[80];
|
|---|
| 48 | char Serveur[80];
|
|---|
| 49 |
|
|---|
| 50 | std::string logs[MAXLOG];
|
|---|
| 51 |
|
|---|
| 52 | std::stringstream os;
|
|---|
| 53 |
|
|---|
| 54 | int Port=0;
|
|---|
| 55 | int delaitransit=0;
|
|---|
| 56 | int delaitracking=0;
|
|---|
| 57 | int lognum=0;
|
|---|
| 58 | int numAntenne=0;
|
|---|
| 59 | int numobjets=0;
|
|---|
| 60 | int runnum=1;
|
|---|
| 61 |
|
|---|
| 62 | struct DefAntenne Antennes[MAXANTENNES];
|
|---|
| 63 | struct DefObjets objets[MAXOBJETS];
|
|---|
| 64 |
|
|---|
| 65 | bool NoExit=true;
|
|---|
| 66 | bool Transit=false;
|
|---|
| 67 | bool run=false;
|
|---|
| 68 | bool exitrun=false;
|
|---|
| 69 |
|
|---|
| 70 | ClientSocket *client_socket;
|
|---|
| 71 | Astro *astro;
|
|---|
| 72 |
|
|---|
| 73 | Display * d;
|
|---|
| 74 | Window w;
|
|---|
| 75 | GC noir, vert, rouge, gris;
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 | void initialiserFenetre();
|
|---|
| 79 | void Dessiner();
|
|---|
| 80 | void rouler(char* reponse);
|
|---|
| 81 | void LireReponse();
|
|---|
| 82 | void *my_thread_process (void * arg);
|
|---|
| 83 | bool Decomposition(std::string chaine, char type, float *a1, float *a2, float *a3);
|
|---|
| 84 | bool DecompositionCommande(std::string chaine, std::string commande, std::string *chaine1, std::string *chaine2);
|
|---|
| 85 | bool EncoyerCoordGeographiques();
|
|---|
| 86 | bool Connect(bool connect);
|
|---|
| 87 | bool Park();
|
|---|
| 88 | bool Abort();
|
|---|
| 89 | bool Goto(std::string ar, std::string dec, bool Transit);
|
|---|
| 90 | bool LectureFichierMouvements(char * fileName);
|
|---|
| 91 | bool Run(std::string fichier);
|
|---|
| 92 | void DecodageFonction(std::string chaine);
|
|---|
| 93 | bool ChargementParametres();
|
|---|