Red de conocimiento informático - Aprendizaje de código fuente - Procese los datos sin procesar del receptor GPS en coordenadas específicas de longitud, latitud y altitud e impleméntelos en C#. Por favor, deme el código y gracias.

Procese los datos sin procesar del receptor GPS en coordenadas específicas de longitud, latitud y altitud e impleméntelos en C#. Por favor, deme el código y gracias.

int GPS_RMC_Parse(char *line, GPS_INFO *GPS)

{

char unsigned, estado, tmp;

float lati_cent_tmp , lati_ second_tmp;

float long_cent_tmp, long_ second_tmp;

float speed_tmp;

char *buf = line /// Obtener caché

ch = buf[5];

status = buf[GetComma(2, buf)];

if (ch == 'C') /// Si el quinto carácter es C, ($GPRMC)

{

if (status == 'A') /// Si los datos son válidos, el análisis ha sido posicionado

{

GPS -> NS = buf[GetComma(4, buf)];

GPS -> EW = buf[GetComma(6, buf)];

GPS->latitud = Get_Double_Number(&buf[GetComma(3, buf)]);

GPS->longitud = Get_Double_Number(&buf[GetComma( 5, buf)]);

GPS->latitude_Degree = (int)GPS->latitud / 100; /// Latitud de separación

lati_cent_tmp = (GPS->latitud - GPS->latitude_Degree * 100);

GPS->latitud_Cent = (int)lati_cent_tmp;

lati_segundo_tmp = (lati_cent_tmp - GPS->latitud_Cent) * 60;

GPS->latitud_Second = (int)lati_segundo_tmp;

p>

GPS->longitude_Degree = (int)GPS->longitude / 100; /// Longitud de separación

long_cent_tmp = (GPS->longitude - GPS->longitude_Degree * 100 );

GPS->longitude_Cent = (int)long_cent_tmp;

long_segundo_tmp = (long_cent_tmp - GPS->longitude_Cent) * 60;

GPS->longitude_Second = (int)long_segundo_tmp;

speed_tmp = Get_Float_Number(&buf[GetComma(7, buf)]); /// Velocidad (unidad: millas náuticas/hora)

GPS->speed = speed_tmp * 1.85; // 1 milla náutica = 1,85 kilómetros

GPS->direction = Get_Float_Number(&buf[GetComma(8, buf)] /// Ángulo

GPS->D.hora = (buf[ 7] - '0') * 10 + (buf[8] - '0'); /// Hora

GPS->D.minuto = (buf[9] - ' 0') * 10 + (buf[10] - '0');

GPS->D.segundo = (buf[11] - '0') * 10 + (buf[12] - '0') ;

tmp = GetComma(9, buf);

GPS->D.día = (buf[tmp + 0] - '0') * 10 + (buf[tmp + 1] - '0'); //Fecha

GPS->D.mes = (buf[tmp + 2] - '0') * 10 + (buf[tmp + 3] - ' 0');

GPS->D.año = (buf[tmp + 4] - '0') * 10 + (buf[tmp + 5] - '0')+ 2000;

UTC2BTC(&GPS->D);

devuelve 1;

}

}

devolver 0;

}