From b88f16194ab0d3c890fa2c804dee86e788ad6ad8 Mon Sep 17 00:00:00 2001 From: OSQZSS Date: Sat, 2 Sep 2023 11:40:59 +0900 Subject: [PATCH] Add constant power option --- gpssim.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gpssim.c b/gpssim.c index 2587d22..c490021 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1707,6 +1707,7 @@ void usage(void) " -s Sampling frequency [Hz] (default: 2600000)\n" " -b I/Q data format [1/8/16] (default: 16)\n" " -i Disable ionospheric delay for spacecraft scenario\n" + " -p Disable path loss and hold power level constant\n" " -v Show details about simulated channels\n", ((double)USER_MOTION_SIZE) / 10.0, STATIC_MAX_DURATION); @@ -1775,6 +1776,7 @@ int main(int argc, char *argv[]) int timeoverwrite = FALSE; // Overwrite the TOC and TOE in the RINEX file ionoutc_t ionoutc; + int path_loss_enable = TRUE; //////////////////////////////////////////////////////////// // Read options @@ -1798,7 +1800,7 @@ int main(int argc, char *argv[]) exit(1); } - while ((result=getopt(argc,argv,"e:u:x:g:c:l:o:s:b:T:t:d:iv"))!=-1) + while ((result=getopt(argc,argv,"e:u:x:g:c:l:o:s:b:T:t:d:ipv"))!=-1) { switch (result) { @@ -1890,6 +1892,9 @@ int main(int argc, char *argv[]) case 'i': ionoutc.enable = FALSE; // Disable ionospheric correction break; + case 'p': + path_loss_enable = FALSE; // Disable path loss + break; case 'v': verb = TRUE; break; @@ -2243,7 +2248,10 @@ int main(int argc, char *argv[]) ant_gain = ant_pat[ibs]; // Signal gain - gain[i] = (int)(path_loss*ant_gain*128.0); // scaled by 2^7 + if (path_loss_enable == TRUE) + gain[i] = (int)(path_loss * ant_gain * 128.0); // scaled by 2^7 + else + gain[i] = 128; // hold the power level constant } }