1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Make code more readable

This commit is contained in:
Carles Fernandez 2017-05-06 13:17:27 +02:00
parent 3f88fae88f
commit 9ee11b691d
2 changed files with 56 additions and 44 deletions

View File

@ -454,13 +454,25 @@ int satexclude(int sat, int svh, const prcopt_t *opt)
{ {
int sys = satsys(sat, NULL); int sys = satsys(sat, NULL);
if (svh<0) return 1; /* ephemeris unavailable */ if (svh < 0)
{
trace(3, "ephemeris unavailable: sat=%3d svh=%02X\n", sat, svh);
return 1; /* ephemeris unavailable */
}
if (opt) if (opt)
{ {
if (opt->exsats[sat-1] == 1) return 1; /* excluded satellite */ if (opt->exsats[sat-1] == 1)
{
trace(3, "excluded satellite: sat=%3d svh=%02X\n", sat, svh);
return 1; /* excluded satellite */
}
if (opt->exsats[sat-1] == 2) return 0; /* included satellite */ if (opt->exsats[sat-1] == 2) return 0; /* included satellite */
if (!(sys&opt->navsys)) return 1; /* unselected sat sys */ if (!(sys&opt->navsys))
{
trace(3, "unselected sat sys: sat=%3d svh=%02X\n", sat, svh);
return 1; /* unselected sat sys */
}
} }
if (sys == SYS_QZS) svh &= 0xFE; /* mask QZSS LEX health */ if (sys == SYS_QZS) svh &= 0xFE; /* mask QZSS LEX health */
if (svh) if (svh)
@ -3132,12 +3144,12 @@ void traceobs(int level __attribute__((unused)), const obsd_t *obs __attribute__
//void tracelevel(int level) {} //void tracelevel(int level) {}
void trace (int level __attribute__((unused)), const char *format __attribute__((unused)), ...) void trace (int level __attribute__((unused)), const char *format __attribute__((unused)), ...)
{ {
// va_list ap; /*va_list ap;*/
/* print error message to stderr */ /* print error message to stderr */
// printf("RTKLIB TRACE[%i]:",level); /*printf("RTKLIB TRACE[%i]:",level);
// va_start(ap,format); va_start(ap,format);
// vfprintf(stdout,format,ap); vfprintf(stdout,format,ap);
// va_end(ap); va_end(ap);*/
} }
//void tracet (int level, const char *format, ...) {} //void tracet (int level, const char *format, ...) {}
//void tracemat(int level, const double *A, int n, int m, int p, int q) {} //void tracemat(int level, const double *A, int n, int m, int p, int q) {}
@ -4002,8 +4014,8 @@ int expath(const char *path, char *paths[], int nmax)
return n; return n;
} }
void windupcorr(gtime_t time, const double *rs, const double *rr, /* From RTKLIB 2.4.2 */
double *phw) void windupcorr(gtime_t time, const double *rs, const double *rr, double *phw)
{ {
double ek[3], exs[3], eys[3], ezs[3], ess[3], exr[3], eyr[3], eks[3], ekr[3], E[9]; double ek[3], exs[3], eys[3], ezs[3], ess[3], exr[3], eyr[3], eks[3], ekr[3], E[9];
double dr[3], ds[3], drs[3], r[3], pos[3], rsun[3], cosp, ph, erpv[5]={0}; double dr[3], ds[3], drs[3], r[3], pos[3], rsun[3], cosp, ph, erpv[5]={0};
@ -4036,7 +4048,8 @@ void windupcorr(gtime_t time, const double *rs, const double *rr,
/* phase windup effect */ /* phase windup effect */
cross3(ek, eys, eks); cross3(ek, eys, eks);
cross3(ek, eyr, ekr); cross3(ek, eyr, ekr);
for (i=0;i<3;i++) { for (i = 0; i < 3; i++)
{
ds[i] = exs[i]-ek[i]*dot(ek, exs, 3)-eks[i]; ds[i] = exs[i]-ek[i]*dot(ek, exs, 3)-eks[i];
dr[i] = exr[i]-ek[i]*dot(ek, exr, 3)+ekr[i]; dr[i] = exr[i]-ek[i]*dot(ek, exr, 3)+ekr[i];
} }

View File

@ -266,7 +266,6 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun,
void csmooth(obs_t *obs, int ns); void csmooth(obs_t *obs, int ns);
int rtk_uncompress(const char *file, char *uncfile); int rtk_uncompress(const char *file, char *uncfile);
int expath(const char *path, char *paths[], int nmax); int expath(const char *path, char *paths[], int nmax);
void windupcorr(gtime_t time, const double *rs, const double *rr, void windupcorr(gtime_t time, const double *rs, const double *rr, double *phw);
double *phw);
#endif /* GNSS_SDR_RTKLIB_RTKCMN_H_ */ #endif /* GNSS_SDR_RTKLIB_RTKCMN_H_ */