RXtoRINEX
V2.1
RXtoRINEX provides tools to collect data from GPS / GNSS receivers in mobile devices, convert them to RINEX or RTK formats, and process RINEX files.
|
#include "Utilities.h"
#include <sstream>
#include <algorithm>
#include <ctype.h>
#include <time.h>
#include <math.h>
Functions | |
vector< string > | getTokens (string source, char separator) |
bool | isBlank (char *buffer, int n) |
void | formatGPStime (char *buffer, int bufferSize, char *fmtYtoM, char *fmtSec, int week, double tow) |
void | formatLocalTime (char *buffer, int bufferSize, char *fmt) |
int | getGPSweek (int year, int month, int day, int hour, int min, float sec) |
int | getGPSweek (double secs) |
double | getGPStow (int year, int month, int day, int hour, int min, float sec) |
double | getGPStow (double secs) |
void | setWeekTow (int year, int month, int day, int hour, int min, double sec, int &week, double &tow) |
double | getSecsGPSEphe (int year, int month, int day, int hour, int min, float sec) |
double | getSecsGPSEphe (int week, double tow) |
string | strToUpper (string strToConvert) |
int | getTwosComplement (unsigned int number, unsigned int nbits) |
int | getSigned (unsigned int number, int nbits) |
unsigned int | reverseWord (unsigned int wordToReverse, int nBits) |
unsigned int | getBits (unsigned int *stream, int bitpos, int len) |
Contains the implementation of routines used in several places.
void formatGPStime | ( | char * | buffer, |
int | bufferSize, | ||
char * | fmtYtoM, | ||
char * | fmtSec, | ||
int | week, | ||
double | tow | ||
) |
formatGPStime format a GPS time point giving text GPS calendar data using time formats provided.
buffer | the text buffer where calendar data are placed |
bufferSize | of the text buffer in bytes |
fmtYtoM | the format to be used for year, month, day, hour and minute (all int), as per strftime |
fmtSec | the format to be used for seconds (a double), as per sprintf |
week | the GPS week from 6/1/1980 |
tow | the GPS time of week, or seconds from the beginning of the week |
void formatLocalTime | ( | char * | buffer, |
int | bufferSize, | ||
char * | fmt | ||
) |
formatLocalTime gives text calendar data of local time using the format provided (as per strftime).
buffer | the text buffer where calendar data are placed |
bufferSize | of the text buffer in bytes |
fmt | the format to be used for conversion, as per strftime |
double getGPStow | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | min, | ||
float | sec | ||
) |
getGPStow compute the Time Of Week (seconds from the begeing of week at Sunday 00:00h ) for a given GPS date and time
year | of the date |
month | of the date |
day | of the date |
hour | of the date |
min | of the date |
sec | second of the date |
double getGPStow | ( | double | secs | ) |
getGPStow compute the Time Of Week (seconds from the begeing of week at Sunday 00:00h ) for a given instant
secs | seconds from of the GPS ephemeris (6/1/1980 00:00:0.0) |
int getGPSweek | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | min, | ||
float | sec | ||
) |
getGPSweek compute number of weeks from the GPS ephemeris (6/1/1980) to a given GPS date and time
year | of the date |
month | of the date |
day | of the date |
hour | of the date |
min | of the date |
sec | second of the date |
int getGPSweek | ( | double | secs | ) |
getGPSweek compute number of weeks from the GPS ephemeris (6/1/1980) to a given instant in seconds
secs | seconds from of the GPS ephemeris (6/1/1980 00:00:0.0) |
double getSecsGPSEphe | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | min, | ||
float | sec | ||
) |
getSecsGPSEphe computes time instant in seconds from the GPS ephemeris (6/1/1980) to a given date and time
year | of the date |
month | of the date |
day | of the date |
hour | of the date |
min | of the date |
sec | second of the date |
double getSecsGPSEphe | ( | int | week, |
double | tow | ||
) |
getSecsGPSEphe compute instant in seconds from the GPS ephemeris (6/1/1980) to a given date stated in GPS week and tow
week | the GPS week number (continuous, without roll over) |
tow | the time of week |
int getSigned | ( | unsigned int | number, |
int | nbits | ||
) |
getSigned converts a signed representation from a given number of bits to standard 32 bits signed representation (two's complement). Number is an integer containing a bit stream of nbits length which represents a nbits signed integer, that is:
number | the 32 bits pattern with the number to be interpreted |
nbits | the number of significative bits in the pattern |
vector<string> getTokens | ( | string | source, |
char | separator | ||
) |
getTokens gets tokens from a string separated by the given separator
source | a string to be split into tokens |
separator | the character used to separate tokens |
int getTwosComplement | ( | unsigned int | number, |
unsigned int | nbits | ||
) |
getTwosComplement converts a two's complement representation from a given number of bits to 32 bits. Number is an integer containing a bit stream of nbits length which represents a nbits integer in two's complement, that is:
number | the 32 bits pattern with the number to be interpreted |
nbits | the number of significative bits in the pattern |
bool isBlank | ( | char * | buffer, |
int | n | ||
) |
isBlank checks if in the given char buffer all chars are blanks
buffer | the array of chars to check |
n | the length to check |
void setWeekTow | ( | int | year, |
int | month, | ||
int | day, | ||
int | hour, | ||
int | min, | ||
double | sec, | ||
int & | week, | ||
double & | tow | ||
) |
setWeekTow compute GPS week and tow for a given GPS date and time
year | of the date |
month | of the date |
day | of the date |
hour | of the date |
min | of the date |
sec | second of the date |
week | GPS week to be computed |
tow | GPS tow to be computed |
string strToUpper | ( | string | strToConvert | ) |
strToUpper converts the characters in the given string to upper case
strToConvert | the string to convert to upper case |