Révision 336
Ajouté par Mourougen MARIMOUTOU-POUGARY il y a environ 3 ans
branch/MARIMOUTOU_Mourougen/main.c | ||
---|---|---|
"$GPVTG,99.4,T,,M,0.4,N,0.7,K*57",
|
||
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
/*Declaration Globale*/
|
||
//Declaration Globale
|
||
|
||
typedef struct
|
||
{
|
||
float Latitude;
|
||
float Longitude;
|
||
}Position;
|
||
|
||
typedef struct
|
||
{
|
||
Position rpos;
|
||
float vitmax;
|
||
}Zone;
|
||
|
||
//Table des zones
|
||
|
||
Zone zones[]=
|
||
{
|
||
{{44.788762, -3.012},50},
|
||
{{44.788762, -3.013},70},
|
||
|
||
|
||
};
|
||
|
||
//Fonctions Personnels
|
||
|
||
... | ... | |
}
|
||
}
|
||
|
||
int test_decode_int()//A verifer
|
||
int test_decode_int()//test de la fonction decode int
|
||
{
|
||
int verif=1;
|
||
if(decode_int('0')!=0)
|
||
... | ... | |
|
||
Position decode_position(char *trame,Position* P)//Fonction qui stocke la latitude dans la structure Position
|
||
{
|
||
(*P).Latitude=decode_latitude(trame);
|
||
(*P).Longitude=decode_latitude(trame);
|
||
P->Latitude=decode_latitude(trame);
|
||
P->Longitude=decode_latitude(trame);
|
||
//return (*P).Latitude;
|
||
}
|
||
|
||
... | ... | |
return Vitesse;
|
||
}
|
||
|
||
int distance_a_la_plus_proche_zone(Position p,Zone r[],int nb_zones,float*d)//fONCTION QUI RETOURNE
|
||
{
|
||
int i;
|
||
while(r[i])
|
||
{
|
||
if(r.Latitude==p.Latitude && r.Longitude==p.Longitude)
|
||
{
|
||
|
||
}
|
||
|
||
}exit(-1);
|
||
|
||
}
|
||
//
|
||
|
||
//Fonction ? modifier !!!!!
|
||
... | ... | |
}*/
|
||
/*printf("%d\n",decode_nombre("4545",3,0));
|
||
|
||
//Test de decode latitude et longitude
|
||
printf("%f\n",decode_latitude("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D"));
|
||
printf("%f\n",decode_longitude("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D"));*/
|
||
//Position pos;
|
||
/*printf("Latitude: %f Longitude: %f\n",decode_position("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",&pos));*/
|
||
//printf(decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",pos));
|
||
|
||
//Test de la fonction decode_trame
|
||
|
||
/*if (decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",pos)!=1){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
... | ... | |
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}*/
|
||
|
||
Position P1,P2;
|
||
//Test calcul distance et vitesse
|
||
/*Position P1,P2;
|
||
Position p_2=decode_position("$GPGGA,141917.00,4545.0242,N,00306.6039,E,1,05,3.4,499.6,M,,M,,*73",&P2);
|
||
Position p_1=decode_position("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",&P1);
|
||
printf("distance: %f\n",calcul_distance(p_1,p_2));
|
||
printf("vitesse: %f\n",calcul_vitesse(p_1,p_2));
|
||
printf("vitesse: %f\n",calcul_vitesse(p_1,p_2));*/
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
Formats disponibles : Unified diff
Debut implemantation de distance la plus proche