Changeset 10599 in ntrip for trunk/BNC/src/RTCM3


Ignore:
Timestamp:
Jan 31, 2025, 10:30:08 AM (3 months ago)
Author:
stuerze
Message:

ADDED: consideration of NAV type in all applications

Location:
trunk/BNC/src/RTCM3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r10587 r10599  
    7171  _rawFile = rawFile;
    7272
    73   connect(this, SIGNAL(newGPSEph(t_ephGPS)), BNC_CORE,
    74       SLOT(slotNewGPSEph(t_ephGPS)));
    75   connect(this, SIGNAL(newGlonassEph(t_ephGlo)), BNC_CORE,
    76       SLOT(slotNewGlonassEph(t_ephGlo)));
    77   connect(this, SIGNAL(newGalileoEph(t_ephGal)), BNC_CORE,
    78       SLOT(slotNewGalileoEph(t_ephGal)));
    79   connect(this, SIGNAL(newSBASEph(t_ephSBAS)), BNC_CORE,
    80       SLOT(slotNewSBASEph(t_ephSBAS)));
    81   connect(this, SIGNAL(newBDSEph(t_ephBDS)), BNC_CORE,
    82       SLOT(slotNewBDSEph(t_ephBDS)));
     73  connect(this, SIGNAL(newGPSEph(t_ephGPS)),     BNC_CORE, SLOT(slotNewGPSEph(t_ephGPS)));
     74  connect(this, SIGNAL(newGlonassEph(t_ephGlo)), BNC_CORE, SLOT(slotNewGlonassEph(t_ephGlo)));
     75  connect(this, SIGNAL(newGalileoEph(t_ephGal)), BNC_CORE, SLOT(slotNewGalileoEph(t_ephGal)));
     76  connect(this, SIGNAL(newSBASEph(t_ephSBAS)),   BNC_CORE, SLOT(slotNewSBASEph(t_ephSBAS)));
     77  connect(this, SIGNAL(newBDSEph(t_ephBDS)),     BNC_CORE, SLOT(slotNewBDSEph(t_ephBDS)));
    8378
    8479  _MessageSize = _SkipBytes = _BlockSize = _NeedBytes = 0;
     
    134129
    135130    GETBITS(sv, 6)
    136     if (sv < 40)
    137       CurrentObs._prn.set('G', sv);
    138     else
    139       CurrentObs._prn.set('S', sv - 20);
     131    char sys;
     132    int num, flag;
     133    if (sv < 40) {
     134      sys = 'G';
     135      num = sv;
     136    }
     137    else {
     138      sys = 'S';
     139      num = sv - 20;
     140    }
     141    flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
     142    CurrentObs._prn.set(sys, num, flag);
    140143
    141144    t_frqObs *frqObs = new t_frqObs;
     
    706709            /* next satellite */
    707710            ;
    708           if (CurrentObs._obs.size() > 0)
     711          if (CurrentObs._obs.size() > 0) {
     712            char sys = CurrentObs._prn.system();
     713            int  num = CurrentObs._prn.number();
     714            int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
     715            CurrentObs._prn.setFlag(flag);
    709716            _CurrentObsList.push_back(CurrentObs);
     717          }
    710718          CurrentObs.clear();
    711719          CurrentObs._time = CurrentObsTime;
     
    882890      }
    883891      if (CurrentObs._obs.size() > 0) {
     892        char sys = CurrentObs._prn.system();
     893        int  num = CurrentObs._prn.number();
     894        int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
     895        CurrentObs._prn.setFlag(flag);
    884896        _CurrentObsList.push_back(CurrentObs);
    885897      }
     
    939951
    940952    GETBITS(sv, 6)
    941     CurrentObs._prn.set('R', sv);
     953    char sys = 'R';
     954    int flag = t_corrSSR::getSsrNavTypeFlag(sys, sv);
     955    CurrentObs._prn.set(sys, sv, flag);
    942956    GETBITS(code, 1)
    943957    GETBITS(freq, 5)
     
    11351149    eph._TOT = 0.9999e9;
    11361150    eph._type = t_eph::LNAV;
     1151    eph._prn.setFlag(eph._type);
    11371152
    11381153    emit newGPSEph(eph);
     
    13131328    _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frq_num, 2, 'f', 0);
    13141329
    1315     eph._type = t_eph::FDMA;
     1330    if (eph.validMdata()) {
     1331      eph._type = t_eph::FDMA_M;
     1332    }
     1333    else {
     1334      eph._type = t_eph::FDMA;
     1335    }
     1336    eph._prn.setFlag(eph._type);
    13161337    eph._healthflags_unknown = false;
    13171338    eph._statusflags_unknown = false;
     
    15681589    eph._TOT = 0.9999e9;
    15691590    eph._type = t_eph::LNAV;
     1591    eph._prn.setFlag(eph._type);
    15701592
    15711593    emit newGPSEph(eph);
     
    16431665    eph._health = 0;
    16441666    eph._type = t_eph::SBASL1;
     1667    eph._prn.setFlag(eph._type);
    16451668
    16461669    emit newSBASEph(eph);
     
    16611684  GETBITS(i, 12)
    16621685
    1663   if ((i == 1046 && size == 61) || (i == 1045 && size == 60)) {
     1686  if ((i == 1046 && size == 61) ||
     1687      (i == 1045 && size == 60)) {
    16641688    t_ephGal eph;
    16651689    eph._receptDateTime = currentDateAndTimeGPS();
     
    16791703      return false;
    16801704    }
    1681     eph._prn.set('E', i, eph._inav ? 1 : 0);
     1705    eph._prn.set('E', i, eph._inav ? t_eph::INAV : t_eph::FNAV);
    16821706
    16831707    GETBITS(week, 12) //FIXME: roll-over after week 4095!!
     
    17411765    GETFLOATSIGN(eph._BGD_1_5A, 10, 1.0 / (double )(1 << 30) / (double )(1 << 2))
    17421766    if (eph._inav) {
     1767      eph._type = t_eph::INAV;
    17431768      /* set unused F/NAV values */
    17441769      eph._E5a_HS = 0.0;
     
    17671792        return false;
    17681793      }
    1769       eph._type = t_eph::INAV;
    17701794    }
    17711795    else {
     1796      eph._type = t_eph::FNAV;
    17721797      /* set unused I/NAV values */
    17731798      eph._BGD_1_5B = 0.0;
     
    17791804      GETBITS(eph._E5a_HS, 2)
    17801805      GETBITS(eph._E5a_DataInvalid, 1)
    1781       eph._type = t_eph::FNAV;
    17821806    }
    17831807    eph._TOT = 0.9999e9;
     
    19081932      eph._type = t_eph::D2;
    19091933    }
     1934    eph._prn.setFlag(eph._type);
    19101935
    19111936    emit newBDSEph(eph);
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp

    r10572 r10599  
    243243      continue;
    244244    }
    245     char sysCh = ' ';
    246     int flag = 0;
     245    char sys = ' ';
     246    int  num  = _clkOrb.Sat[ii].ID;
     247    int  flag = 0;  // to force NAV type usage according SSR standard
    247248    if      (ii < _clkOrb.NumberOfSat[CLOCKORBIT_SATGPS]) {
    248       sysCh = 'G';
     249      sys = 'G';
     250      flag = t_eph::LNAV;
    249251    }
    250252    else if (ii >= CLOCKORBIT_OFFSETGLONASS &&
    251253        ii < CLOCKORBIT_OFFSETGLONASS + _clkOrb.NumberOfSat[CLOCKORBIT_SATGLONASS]) {
    252       sysCh = 'R';
     254      sys = 'R';
     255      flag = t_eph::FDMA_M;
    253256    }
    254257    else if (ii >= CLOCKORBIT_OFFSETGALILEO &&
    255258        ii < CLOCKORBIT_OFFSETGALILEO + _clkOrb.NumberOfSat[CLOCKORBIT_SATGALILEO]) {
    256       sysCh = 'E';
    257       flag = 1; // I/NAV clock has been chosen as reference clock for Galileo SSR corrections
     259      sys = 'E';
     260      flag = t_eph::INAV;
    258261    }
    259262    else if (ii >= CLOCKORBIT_OFFSETQZSS &&
    260263        ii < CLOCKORBIT_OFFSETQZSS + _clkOrb.NumberOfSat[CLOCKORBIT_SATQZSS]) {
    261       sysCh = 'J';
     264      sys = 'J';
     265      flag = t_eph::LNAV;
    262266    }
    263267    else if (ii >= CLOCKORBIT_OFFSETSBAS &&
    264268        ii < CLOCKORBIT_OFFSETSBAS + _clkOrb.NumberOfSat[CLOCKORBIT_SATSBAS]) {
    265       sysCh = 'S';
     269      sys = 'S';
     270      flag = t_eph::SBASL1;
    266271    }
    267272    else if (ii >= CLOCKORBIT_OFFSETBDS &&
    268273        ii < CLOCKORBIT_OFFSETBDS + _clkOrb.NumberOfSat[CLOCKORBIT_SATBDS]) {
    269       sysCh = 'C';
     274      sys = 'C';
     275      if (num < 6) {// GEO
     276        flag = t_eph::D2;
     277      }
     278      else if (num > 58 && num < 63) { // GEO
     279        flag = t_eph::D2;
     280      }
     281      else {
     282        flag = t_eph::D1;
     283      }
    270284    }
    271285    else {
     
    289303
    290304      t_orbCorr orbCorr;
    291       orbCorr._prn.set(sysCh, _clkOrb.Sat[ii].ID, flag);
     305      orbCorr._prn.set(sys, num, flag);
    292306      orbCorr._staID     = _staID.toStdString();
    293307      orbCorr._iod       = _clkOrb.Sat[ii].IOD;
    294308      orbCorr._time      = _lastTime;
    295309      orbCorr._updateInt = _clkOrb.UpdateInterval;
    296       orbCorr._system    = sysCh;
     310      orbCorr._system    = sys;
    297311      orbCorr._xr[0]     = _clkOrb.Sat[ii].Orbit.DeltaRadial;
    298312      orbCorr._xr[1]     = _clkOrb.Sat[ii].Orbit.DeltaAlongTrack;
     
    323337
    324338      t_clkCorr clkCorr;
    325       clkCorr._prn.set(sysCh, _clkOrb.Sat[ii].ID, flag);
     339      clkCorr._prn.set(sys, _clkOrb.Sat[ii].ID, flag);
    326340      clkCorr._staID      = _staID.toStdString();
    327341      clkCorr._time       = _lastTime;
     
    347361         _clkOrb.messageType == _ssrCorr->COTYPE_SBASHR ||
    348362         _clkOrb.messageType == _ssrCorr->COTYPE_BDSHR) {
    349       t_prn prn(sysCh, _clkOrb.Sat[ii].ID, flag);
     363      t_prn prn(sys, _clkOrb.Sat[ii].ID, flag);
    350364      if (_lastClkCorrections.contains(prn)) {
    351365        t_clkCorr clkCorr;
     
    371385                            + _codeBias.NumberOfSat[CLOCKORBIT_SATBDS];
    372386    ii++) {
    373     char sysCh = ' ';
     387    char sys = ' ';
     388    int  num =  _codeBias.Sat[ii].ID;
     389    int flag = 0;
    374390    if      (ii < _codeBias.NumberOfSat[CLOCKORBIT_SATGPS]) {
    375       sysCh = 'G';
     391      sys = 'G';
     392      flag = t_eph::LNAV;
    376393    }
    377394    else if (ii >= CLOCKORBIT_OFFSETGLONASS &&
    378395        ii < CLOCKORBIT_OFFSETGLONASS + _codeBias.NumberOfSat[CLOCKORBIT_SATGLONASS]) {
    379       sysCh = 'R';
     396      sys = 'R';
     397      flag = t_eph::FDMA_M;
    380398    }
    381399    else if (ii >= CLOCKORBIT_OFFSETGALILEO &&
    382400        ii < CLOCKORBIT_OFFSETGALILEO + _codeBias.NumberOfSat[CLOCKORBIT_SATGALILEO]) {
    383       sysCh = 'E';
     401      sys = 'E';
     402      flag = t_eph::INAV;
    384403    }
    385404    else if (ii >= CLOCKORBIT_OFFSETQZSS &&
    386405        ii < CLOCKORBIT_OFFSETQZSS + _codeBias.NumberOfSat[CLOCKORBIT_SATQZSS]) {
    387       sysCh = 'J';
     406      sys = 'J';
     407      flag = t_eph::LNAV;
    388408    }
    389409    else if (ii >= CLOCKORBIT_OFFSETSBAS &&
    390410        ii < CLOCKORBIT_OFFSETSBAS + _codeBias.NumberOfSat[CLOCKORBIT_SATSBAS]) {
    391       sysCh = 'S';
     411      sys = 'S';
     412      flag = t_eph::SBASL1;
    392413    }
    393414    else if (ii >= CLOCKORBIT_OFFSETBDS &&
    394415        ii < CLOCKORBIT_OFFSETBDS + _codeBias.NumberOfSat[CLOCKORBIT_SATBDS]) {
    395       sysCh = 'C';
     416      sys = 'C';
     417      if (num < 6) {// GEO
     418        flag = t_eph::D2;
     419      }
     420      else if (num > 58 && num < 63) { // GEO
     421        flag = t_eph::D2;
     422      }
     423      else {
     424        flag = t_eph::D1;
     425      }
    396426    }
    397427    else {
     
    399429    }
    400430    t_satCodeBias satCodeBias;
    401     satCodeBias._prn.set(sysCh, _codeBias.Sat[ii].ID);
     431    satCodeBias._prn.set(sys, num, flag);
    402432    satCodeBias._staID     = _staID.toStdString();
    403433    satCodeBias._time      = _lastTime;
     
    406436      const SsrCorr::CodeBias::BiasSat::CodeBiasEntry& biasEntry = _codeBias.Sat[ii].Biases[jj];
    407437      t_frqCodeBias frqCodeBias;
    408       frqCodeBias._rnxType2ch.assign(_ssrCorr->codeTypeToRnxType(sysCh, biasEntry.Type));
     438      frqCodeBias._rnxType2ch.assign(_ssrCorr->codeTypeToRnxType(sys, biasEntry.Type));
    409439      frqCodeBias._value      = biasEntry.Bias;
    410440      if (!frqCodeBias._rnxType2ch.empty()) {
     
    424454                            + _phaseBias.NumberOfSat[CLOCKORBIT_SATBDS];
    425455    ii++) {
    426     char sysCh = ' ';
     456    char sys = ' ';
     457    int num = _phaseBias.Sat[ii].ID;
     458    int flag = 0;
    427459    if      (ii < _phaseBias.NumberOfSat[CLOCKORBIT_SATGPS]) {
    428       sysCh = 'G';
     460      sys = 'G';
     461      flag = t_eph::LNAV;
    429462    }
    430463    else if (ii >= CLOCKORBIT_OFFSETGLONASS &&
    431464        ii < CLOCKORBIT_OFFSETGLONASS + _phaseBias.NumberOfSat[CLOCKORBIT_SATGLONASS]) {
    432       sysCh = 'R';
     465      sys = 'R';
     466      flag = t_eph::FDMA_M;
    433467    }
    434468    else if (ii >= CLOCKORBIT_OFFSETGALILEO &&
    435469        ii < CLOCKORBIT_OFFSETGALILEO + _phaseBias.NumberOfSat[CLOCKORBIT_SATGALILEO]) {
    436       sysCh = 'E';
     470      sys = 'E';
     471      flag = t_eph::INAV;
    437472    }
    438473    else if (ii >= CLOCKORBIT_OFFSETQZSS &&
    439474        ii < CLOCKORBIT_OFFSETQZSS + _phaseBias.NumberOfSat[CLOCKORBIT_SATQZSS]) {
    440       sysCh = 'J';
     475      sys = 'J';
     476      flag = t_eph::LNAV;
    441477    }
    442478    else if (ii >= CLOCKORBIT_OFFSETSBAS &&
    443479        ii < CLOCKORBIT_OFFSETSBAS + _phaseBias.NumberOfSat[CLOCKORBIT_SATSBAS]) {
    444       sysCh = 'S';
     480      sys = 'S';
     481      flag = t_eph::SBASL1;
    445482    }
    446483    else if (ii >= CLOCKORBIT_OFFSETBDS &&
    447484        ii < CLOCKORBIT_OFFSETBDS + _phaseBias.NumberOfSat[CLOCKORBIT_SATBDS]) {
    448       sysCh = 'C';
     485      sys = 'C';
     486      if (num < 6) {// GEO
     487        flag = t_eph::D2;
     488      }
     489      else if (num > 58 && num < 63) { // GEO
     490        flag = t_eph::D2;
     491      }
     492      else {
     493        flag = t_eph::D1;
     494      }
    449495    }
    450496    else {
     
    452498    }
    453499    t_satPhaseBias satPhaseBias;
    454     satPhaseBias._prn.set(sysCh, _phaseBias.Sat[ii].ID);
     500    satPhaseBias._prn.set(sys, num, flag);
    455501    satPhaseBias._staID      = _staID.toStdString();
    456502    satPhaseBias._time       = _lastTime;
     
    463509      const SsrCorr::PhaseBias::PhaseBiasSat::PhaseBiasEntry& biasEntry = _phaseBias.Sat[ii].Biases[jj];
    464510      t_frqPhaseBias frqPhaseBias;
    465       frqPhaseBias._rnxType2ch.assign(_ssrCorr->codeTypeToRnxType(sysCh, biasEntry.Type));
     511      frqPhaseBias._rnxType2ch.assign(_ssrCorr->codeTypeToRnxType(sys, biasEntry.Type));
    466512      frqPhaseBias._value                = biasEntry.Bias;
    467513      frqPhaseBias._fixIndicator         = biasEntry.SignalIntegerIndicator;
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.h

    r10572 r10599  
    3333#include "../RTCM3/clock_and_orbit/clock_orbit_igs.h"
    3434#include "../RTCM3/clock_and_orbit/clock_orbit_rtcm.h"
     35#include "ephemeris.h"
    3536
    3637  class RTCM3coDecoder : public QObject, public GPSDecoder {
Note: See TracChangeset for help on using the changeset viewer.