diff --git a/gpssim.c b/gpssim.c index 9c07c58..b205234 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1383,6 +1383,42 @@ int readUserMotion(double xyz[USER_MOTION_SIZE][3], const char *filename) return (numd); } +/*! \brief Read the list of user motions from the input file + * \param[out] xyz Output array of LatLonHei coordinates for user motion + * \param[[in] filename File name of the text input file with format Lat,Lon,Hei + * \returns Number of user data motion records read, -1 on error + * + * Added by romalvarezllorens@gmail.com + */ +int readUserMotionLLH(double xyz[USER_MOTION_SIZE][3], const char *filename) +{ + FILE *fp; + int numd; + double llh_convert[3]; + char str[MAX_CHAR]; + + if (NULL==(fp=fopen(filename,"rt"))) + return(-1); + + for (numd=0; numd RINEX navigation file for GPS ephemerides (required)\n" " -u User motion file (dynamic mode)\n" + " -x User motion file in Lat,Lon,Height format(dynamic mode)\n" " -g NMEA GGA stream (dynamic mode)\n" " -c ECEF X,Y,Z in meters (static mode) e.g. 3967283.154,1022538.181,4872414.484\n" " -l Lat,Lon,Hgt (static mode) e.g. 35.681298,139.766247,10.0\n" @@ -1702,6 +1739,7 @@ int main(int argc, char *argv[]) int staticLocationMode = FALSE; int nmeaGGA = FALSE; + int umLLH = TRUE; char navfile[MAX_CHAR]; char outfile[MAX_CHAR]; @@ -1764,6 +1802,12 @@ int main(int argc, char *argv[]) strcpy(umfile, optarg); nmeaGGA = FALSE; break; + case 'x': + // Static geodetic coordinates input mode + // Added by romalvarezllorens@gmail.com + strcpy(umfile, optarg); + nmeaGGA = FALSE; + umLLH = TRUE; case 'g': strcpy(umfile, optarg); nmeaGGA = TRUE; @@ -1888,6 +1932,8 @@ int main(int argc, char *argv[]) // Read user motion file if (nmeaGGA==TRUE) numd = readNmeaGGA(xyz, umfile); + else if (umLLH == TRUE) + numd = readUserMotionLLH(xyz, umfile); else numd = readUserMotion(xyz, umfile);