Changeset 11046 in ntrip
- Timestamp:
- Sep 28, 2026, 11:16:50 AM (16 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm_new.cpp
r11042 r11046 11 11 #include <stdio.h> 12 12 #include <string.h> 13 #include <climits> 13 14 #ifndef sparc 14 15 #include <stdint.h> … … 502 503 unsigned int satPositions[64], numSatPositions; 503 504 unsigned int freqPositions[ANT_MAXFREQUENCIES], numFreqPositions; 505 uint64_t satMask; 504 506 505 507 STARTDATA … … 522 524 } 523 525 E_SATELLITE_SET_INDICATOR(a->SatelliteSetIndicator[s]) 524 E_SATELLITE_MASK(a->SatelliteMask[s]) 525 526 /* same MSB-first mask convention as D_SATELLITE_MASK/GetSSR */ 526 527 /* same MSB-first mask convention as D_SATELLITE_MASK/GetSSR; bits 528 beyond the satellites supported for this system are cleared, since 529 no Sat[] data exists for them and the mask must match the blocks */ 527 530 numSatPositions = 0; 531 satMask = 0; 528 532 for (k = 0; k < 64 && satoffset[s] + k < satoffset[s + 1]; ++k) { 529 533 if ((a->SatelliteMask[s] >> (63 - k)) & 1ULL) { 530 534 satPositions[numSatPositions++] = satoffset[s] + k; 531 } 532 } 535 satMask |= 1ULL << (63 - k); 536 } 537 } 538 E_SATELLITE_MASK(satMask) 533 539 numSatBlocks = a->SatelliteSetIndicator[s] ? (numSatPositions ? 1 : 0) : numSatPositions; 534 540 … … 557 563 } 558 564 if (a->NadirAngleDependentCorrectionIndicator[s]) { 565 /* DF+021: NaN (invalid) and values outside the range of 566 int(3 + DF+015) are sent as the invalid value -2^(n-1) */ 567 unsigned int nb = 3 + a->NadirAngleDependentCorrectionRangeExtension[s]; 568 double lim = ldexp(1.0, nb - 1); 559 569 for (deg = 0; deg <= a->maximumOffNadirAngle[s] && deg < ANT_MAXNADIRDEGREES; ++deg) { 560 E_NADIR_ANGLE_DEPENDENT_CORRECTION(satBlock.Freq[f].NadirAngleCorrection[deg], 561 a->NadirAngleDependentCorrectionRangeExtension[s]) 570 double val = satBlock.Freq[f].NadirAngleCorrection[deg]; 571 double mm = std::isnan(val) ? -lim : floor(val * 1000.0 + 0.5); 572 if (mm <= -lim || mm >= lim) { 573 mm = -lim; 574 } 575 ADDBITS(nb, (int64_t)mm) 562 576 } 563 577 } … … 1218 1232 1219 1233 /* DF394 satellite mask: MSB (bit 63) = satellite 1 within this system, 1220 same convention as the MSM satellite mask that shares this field. */ 1221 for (k = 0; k < 64 && satoffset[s] + k < satoffset[s + 1]; ++k) { 1234 same convention as the MSM satellite mask that shares this field. 1235 All 64 bits count: a satellite beyond the number supported for this 1236 system still has its own block on the wire (DF+016 unset), which 1237 must be read to stay aligned - it is marked UINT_MAX and discarded. */ 1238 for (k = 0; k < 64; ++k) { 1222 1239 if ((a->SatelliteMask[s] >> (63 - k)) & 1ULL) 1223 satPositions[numSatPositions++] = satoffset[s] + k; 1240 satPositions[numSatPositions++] = 1241 (satoffset[s] + k < satoffset[s + 1]) ? satoffset[s] + k : UINT_MAX; 1224 1242 } 1225 1243 numSatBlocks = a->SatelliteSetIndicator[s] ? (numSatPositions ? 1 : 0) : numSatPositions; … … 1241 1259 fprintf(stderr, " sat block (shared, PRNs"); 1242 1260 for (k = 0; k < numSatPositions; ++k) 1243 fprintf(stderr, " %d", satPositions[k] - satoffset[s] + 1); 1261 if (satPositions[k] != UINT_MAX) 1262 fprintf(stderr, " %d", satPositions[k] - satoffset[s] + 1); 1244 1263 fprintf(stderr, ") freqSetInd %d freqMask %02x\n", 1245 1264 satBlock.FrequencySetIndicator, satBlock.GnssFrequencyMask); … … 1247 1266 else { 1248 1267 fprintf(stderr, " sat block PRN %d freqSetInd %d freqMask %02x\n", 1249 satPositions[satBlockIdx] - satoffset[s] + 1, 1268 satPositions[satBlockIdx] != UINT_MAX ? (int)(satPositions[satBlockIdx] - satoffset[s] + 1) : -1, 1250 1269 satBlock.FrequencySetIndicator, satBlock.GnssFrequencyMask); 1251 1270 } … … 1267 1286 D_NADIR_CORRECTION(satBlock.Freq[f].NadirCorrection) 1268 1287 if (a->NadirAngleDependentCorrectionIndicator[s]) { 1269 for (deg = 0; deg <= a->maximumOffNadirAngle[s] && deg < ANT_MAXNADIRDEGREES; ++deg) 1270 D_NADIR_ANGLE_DEPENDENT_CORRECTION(satBlock.Freq[f].NadirAngleCorrection[deg], 1271 a->NadirAngleDependentCorrectionRangeExtension[s]) 1288 /* DF+021: int(3 + DF+015) in mm; the minimum value -2^(n-1) 1289 means "invalid" and is stored as NaN */ 1290 unsigned int nb = 3 + a->NadirAngleDependentCorrectionRangeExtension[s]; 1291 for (deg = 0; deg <= a->maximumOffNadirAngle[s] && deg < ANT_MAXNADIRDEGREES; ++deg) { 1292 double raw; 1293 GETSSRFLOATSIGN(raw, nb, 1.0) 1294 satBlock.Freq[f].NadirAngleCorrection[deg] = 1295 (raw == -ldexp(1.0, nb - 1)) ? NAN : raw / 1000.0; 1296 } 1272 1297 } 1273 1298 #ifdef BNC_DEBUG_SSR … … 1288 1313 if (a->SatelliteSetIndicator[s]) { 1289 1314 for (k = 0; k < numSatPositions; ++k) 1290 a->Sat[satPositions[k]] = satBlock; 1291 } 1292 else { 1315 if (satPositions[k] != UINT_MAX) 1316 a->Sat[satPositions[k]] = satBlock; 1317 } 1318 else if (satPositions[satBlockIdx] != UINT_MAX) { 1293 1319 a->Sat[satPositions[satBlockIdx]] = satBlock; 1294 1320 } … … 1296 1322 } 1297 1323 else { 1298 /* COBOFS_ SATANT / COBOFS_REGIONO: message numbers are1324 /* COBOFS_REGIONO: message numbers are 1299 1325 recognized (see setCorType()) but decoding is not implemented yet */ 1300 1326 return GCOBR_UNKNOWNTYPE; … … 1522 1548 if (freqIndex == 0) return "C2"; // B1 1523 1549 if (freqIndex == 1) return "C6"; // B3 1524 if (freqIndex == 2) return "C7"; // B2 1525 if (freqIndex == 3) return "C5"; // B2a 1526 if (freqIndex == 4) return "C7"; // B2b (same t_frequency::type as B2) 1550 if (freqIndex == 2) return "C7"; // B2 (BDS-2) 1551 if (freqIndex == 3) return "C5"; // B2a 1552 if (freqIndex == 4) return "C7b"; // B2b (BDS-3) - same carrier and t_frequency::type as B2, 1553 // own label so that PPP can select by satellite generation 1554 // (see t_pppSatObs::cmpModel()) 1527 1555 if (freqIndex == 5) return "C1"; // B1C 1528 1556 break;
Note:
See TracChangeset
for help on using the changeset viewer.
