Merge pull request #62 from bitdust/unlimited_duration

Amost unlimited duration for static mode
This commit is contained in:
OSQZSS 2017-03-17 13:11:46 +09:00 committed by GitHub
commit d0c52e33d0
3 changed files with 21 additions and 18 deletions

View File

@ -63,7 +63,7 @@ Options:
-l <location> Lat,Lon,Hgt (static mode) e.g. 30.286502,120.032669,100 -l <location> Lat,Lon,Hgt (static mode) e.g. 30.286502,120.032669,100
-t <date,time> Scenario start time YYYY/MM/DD,hh:mm:ss -t <date,time> Scenario start time YYYY/MM/DD,hh:mm:ss
-T <date,time> Overwrite TOC and TOE to scenario start time -T <date,time> Overwrite TOC and TOE to scenario start time
-d <duration> Duration [sec] (max: 300) -d <duration> Duration [sec] (dynamic mode max: 300 static mode max: 86400)
-o <output> I/Q sampling data file (default: gpssim.bin) -o <output> I/Q sampling data file (default: gpssim.bin)
-s <frequency> Sampling frequency [Hz] (default: 2600000) -s <frequency> Sampling frequency [Hz] (default: 2600000)
-b <iq_bits> I/Q data format [1/8/16] (default: 16) -b <iq_bits> I/Q data format [1/8/16] (default: 16)

View File

@ -1655,13 +1655,13 @@ void usage(void)
" -l <location> Lat,Lon,Hgt (static mode) e.g. 35.681298,139.766247,10.0\n" " -l <location> Lat,Lon,Hgt (static mode) e.g. 35.681298,139.766247,10.0\n"
" -t <date,time> Scenario start time YYYY/MM/DD,hh:mm:ss\n" " -t <date,time> Scenario start time YYYY/MM/DD,hh:mm:ss\n"
" -T <date,time> Overwrite TOC and TOE to scenario start time\n" " -T <date,time> Overwrite TOC and TOE to scenario start time\n"
" -d <duration> Duration [sec] (max: %.0f)\n" " -d <duration> Duration [sec] (dynamic mode max: %.0f static mode max: %d)\n"
" -o <output> I/Q sampling data file (default: gpssim.bin)\n" " -o <output> I/Q sampling data file (default: gpssim.bin)\n"
" -s <frequency> Sampling frequency [Hz] (default: 2600000)\n" " -s <frequency> Sampling frequency [Hz] (default: 2600000)\n"
" -b <iq_bits> I/Q data format [1/8/16] (default: 16)\n" " -b <iq_bits> I/Q data format [1/8/16] (default: 16)\n"
" -i Disable ionospheric delay for spacecraft scenario\n" " -i Disable ionospheric delay for spacecraft scenario\n"
" -v Show details about simulated channels\n", " -v Show details about simulated channels\n",
((double)USER_MOTION_SIZE)/10.0); ((double)USER_MOTION_SIZE) / 10.0, STATIC_MAX_DURATION);
return; return;
} }
@ -1825,12 +1825,6 @@ int main(int argc, char *argv[])
break; break;
case 'd': case 'd':
duration = atof(optarg); duration = atof(optarg);
if (duration<0.0 || duration>((double)USER_MOTION_SIZE)/10.0)
{
printf("ERROR: Invalid duration.\n");
exit(1);
}
iduration = (int)(duration*10.0+0.5);
break; break;
case 'i': case 'i':
ionoutc.enable = FALSE; // Disable ionospheric correction ionoutc.enable = FALSE; // Disable ionospheric correction
@ -1862,6 +1856,13 @@ int main(int argc, char *argv[])
llh[2] = 10.0; llh[2] = 10.0;
} }
if (duration<0.0 || duration>((double)USER_MOTION_SIZE) / 10.0 && !staticLocationMode || duration>STATIC_MAX_DURATION && staticLocationMode)
{
printf("ERROR: Invalid duration.\n");
exit(1);
}
iduration = (int)(duration*10.0 + 0.5);
// Buffer size // Buffer size
samp_freq = floor(samp_freq/10.0); samp_freq = floor(samp_freq/10.0);
iq_buff_size = (int)samp_freq; // samples per 0.1sec iq_buff_size = (int)samp_freq; // samples per 0.1sec
@ -1904,13 +1905,6 @@ int main(int argc, char *argv[])
llh2xyz(llh,xyz[0]); // Convert llh to xyz llh2xyz(llh,xyz[0]); // Convert llh to xyz
numd = iduration; numd = iduration;
for (iumd=1; iumd<numd; iumd++)
{
xyz[iumd][0] = xyz[0][0];
xyz[iumd][1] = xyz[0][1];
xyz[iumd][2] = xyz[0][2];
}
} }
/* /*
printf("xyz = %11.1f, %11.1f, %11.1f\n", xyz[0][0], xyz[0][1], xyz[0][2]); printf("xyz = %11.1f, %11.1f, %11.1f\n", xyz[0][0], xyz[0][1], xyz[0][2]);
@ -2141,7 +2135,10 @@ int main(int argc, char *argv[])
sv = chan[i].prn-1; sv = chan[i].prn-1;
// Current pseudorange // Current pseudorange
if (!staticLocationMode)
computeRange(&rho, eph[ieph][sv], &ionoutc, grx, xyz[iumd]); computeRange(&rho, eph[ieph][sv], &ionoutc, grx, xyz[iumd]);
else
computeRange(&rho, eph[ieph][sv], &ionoutc, grx, xyz[0]);
chan[i].azel[0] = rho.azel[0]; chan[i].azel[0] = rho.azel[0];
chan[i].azel[1] = rho.azel[1]; chan[i].azel[1] = rho.azel[1];
@ -2288,7 +2285,10 @@ int main(int argc, char *argv[])
} }
// Update channel allocation // Update channel allocation
if (!staticLocationMode)
allocateChannel(chan, eph[ieph], ionoutc, grx, xyz[iumd], elvmask); allocateChannel(chan, eph[ieph], ionoutc, grx, xyz[iumd], elvmask);
else
allocateChannel(chan, eph[ieph], ionoutc, grx, xyz[0], elvmask);
// Show ditails about simulated channels // Show ditails about simulated channels
if (verb==TRUE) if (verb==TRUE)

View File

@ -16,6 +16,9 @@
/*! \brief Maximum number of user motion points */ /*! \brief Maximum number of user motion points */
#define USER_MOTION_SIZE (3000) // max duration at 10Hz #define USER_MOTION_SIZE (3000) // max duration at 10Hz
/*! \brief Maximum duration for static mode*/
#define STATIC_MAX_DURATION (86400) // second
/*! \brief Number of subframes */ /*! \brief Number of subframes */
#define N_SBF (5) // 5 subframes per frame #define N_SBF (5) // 5 subframes per frame