Fix ephemeris updates

This commit is contained in:
OSQZSS 2016-08-08 17:44:16 +09:00
parent a00a7c7f2c
commit ec96120bfa

View File

@ -2105,8 +2105,8 @@ int main(int argc, char *argv[])
if (chan[i].prn>0) if (chan[i].prn>0)
{ {
// Refresh code phase and data bit counters // Refresh code phase and data bit counters
int sv = chan[i].prn-1;
range_t rho; range_t rho;
sv = chan[i].prn-1;
// Current pseudorange // Current pseudorange
computeRange(&rho, eph[ieph][sv], &ionoutc, grx, xyz[iumd]); computeRange(&rho, eph[ieph][sv], &ionoutc, grx, xyz[iumd]);
@ -2230,6 +2230,29 @@ int main(int argc, char *argv[])
if (chan[i].prn>0) if (chan[i].prn>0)
generateNavMsg(grx, &chan[i], 0); generateNavMsg(grx, &chan[i], 0);
// Refresh ephemeris and subframes
// Quick and dirty fix. Need more elegant way.
for (sv=0; sv<MAX_SAT; sv++)
{
if (eph[ieph+1][sv].vflg==1)
{
dt = subGpsTime(eph[ieph+1][sv].toc, grx);
if (dt<SECONDS_IN_HOUR)
{
ieph++;
for (i=0; i<MAX_CHAN; i++)
{
// Generate new subframes if allocated
if (chan[i].prn!=0)
eph2sbf(eph[ieph][chan[i].prn-1], ionoutc, chan[i].sbf);
}
}
break;
}
}
// Update channel allocation // Update channel allocation
allocateChannel(chan, eph[ieph], ionoutc, grx, xyz[iumd], elvmask); allocateChannel(chan, eph[ieph], ionoutc, grx, xyz[iumd], elvmask);