Changeset 10688 in ntrip


Ignore:
Timestamp:
Jul 4, 2025, 12:13:03 PM (4 weeks ago)
Author:
stuerze
Message:

RTCM message 1230 (on-change) and the size of each RTCM message is added in scanRTCM

Location:
trunk/BNC/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/GPSDecoder.h

    r10619 r10688  
    6060  void setRinexReconnectFlag(bool flag);
    6161
     62  struct t_typeInfo {
     63    t_typeInfo() {
     64      type = 0;
     65      size = 0;
     66    };
     67    int    type;
     68    size_t size;
     69  };
     70
     71
    6272  struct t_antRefPoint {
    6373    enum t_type { ARP, APC };
     
    94104  };
    95105
     106  class t_GloBiasInfo {
     107  public:
     108    t_GloBiasInfo() {
     109      clear();
     110    };
     111    bool operator==(const t_GloBiasInfo& biasInfo2) const {
     112      if (staID     == biasInfo2.staID &&
     113          indicator == biasInfo2.indicator &&
     114          L1C_value == biasInfo2.L1C_value &&
     115          L1P_value == biasInfo2.L1P_value &&
     116          L2C_value == biasInfo2.L2C_value &&
     117          L2P_value == biasInfo2.L2P_value  ) {
     118        return true;
     119      }
     120      else {
     121        return false;
     122      }
     123    }
     124
     125    void set(const t_GloBiasInfo& biasInfo) {
     126      staID     = biasInfo.staID;
     127      indicator = biasInfo.indicator;
     128      L1C_value = biasInfo.L1C_value;
     129      L1P_value = biasInfo.L1P_value;
     130      L2C_value = biasInfo.L2C_value;
     131      L2P_value = biasInfo.L2P_value;
     132      changed = true;
     133    }
     134
     135    void clear() {cout << "init" <<  endl;
     136      staID = 0;
     137      indicator = 0;
     138      L1C_value = 0.0;
     139      L1P_value = 0.0;
     140      L2C_value = 0.0;
     141      L2P_value = 0.0;
     142      changed = false;
     143    }
     144    QString toString() {
     145      QString biasIndicator =  (indicator == 1) ? QString("aligned") : QString("unaligned");
     146      QString biasesStr =
     147          QString(": GLONASS L1/L2 Code-Phase Biases: staID=%1 indicator=%2 L1C=%3 L1P=%4 L2C=%5 L2P=%6")
     148          .arg(staID).arg(biasIndicator)
     149          .arg(L1C_value, 0, 'f', 2)
     150          .arg(L1P_value, 0, 'f', 2)
     151          .arg(L2C_value, 0, 'f', 2)
     152          .arg(L2P_value, 0, 'f', 2);
     153
     154      return biasesStr;
     155    }
     156    int      staID;
     157    int      indicator;
     158    double   L1C_value;
     159    double   L1P_value;
     160    double   L2C_value;
     161    double   L2P_value;
     162    bool     changed;
     163
     164
     165  };
     166
    96167  /** List of observations */
    97168  QList<t_satObs>         _obsList;
    98   QList<int>              _typeList;           // RTCM message types
     169  QList<t_typeInfo>       _typeList;           // RTCM message type as message size
    99170  QList<t_antInfo>        _antType;            // RTCM antenna descriptor
    100171  QList<t_recInfo>        _recType;            // RTCM receiver descriptor
     
    104175  QList<t_rtcmCrs>        _rtcmCrs;            // RTCM CRS
    105176  QString                 _gloFrq;             // GLONASS slot
     177  t_GloBiasInfo           _gloBiases;          // RTCM GLO bias information message
    106178  bncRinex*               _rnx;                // RINEX writer
    107179};
  • trunk/BNC/src/RTCM/RTCM2Decoder.cpp

    r10599 r10688  
    119119
    120120    // Store message number
    121     _typeList.push_back(_PP.ID());
     121    _typeList.push_back(t_typeInfo());
     122    _typeList.back().type = _PP.ID();
     123    //_typeList.back().size = 0;
    122124
    123125    if (_PP.ID() == 18 || _PP.ID() == 19) {
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r10632 r10688  
    16901690  bool decoded = false;
    16911691  uint64_t numbits = 0, bitfield = 0;
    1692   int i, week, mnum;
     1692  int i, week;
    16931693
    16941694  data += 3; /* header */
     
    17041704    eph._inav = (i == 1046);
    17051705    eph._fnav = (i == 1045);
    1706     mnum = i;
     1706    int mnum = i;
    17071707    GETBITS(i, 6)
    17081708    if (i < 1 || i > 36 ) { // max. constellation within I/NAV / F/NAV frames is 36
     
    20462046//
    20472047////////////////////////////////////////////////////////////////////////////
     2048bool RTCM3Decoder::DecodeGLONASSCodePhaseBiases(unsigned char* data, int size) {
     2049  t_GloBiasInfo gloBiases;
     2050  uint64_t numbits = 0, bitfield = 0;
     2051
     2052  data += 3; // header
     2053  size -= 6; // header + crc
     2054
     2055  SKIPBITS(12) // Message Number
     2056  GETBITS(gloBiases.staID, 12)
     2057  GETBITS(gloBiases.indicator, 1) // 0.. not aligned, 1.. aligned
     2058  SKIPBITS(3) // reserved bits
     2059  unsigned bitmask;
     2060  GETBITS(bitmask, 4)
     2061  bool L1C_valid = bitExtracted(unsigned(bitmask), 1, 0);
     2062  bool L1P_valid = bitExtracted(unsigned(bitmask), 1, 1);
     2063  bool L2C_valid = bitExtracted(unsigned(bitmask), 1, 2);
     2064  bool L2P_valid = bitExtracted(unsigned(bitmask), 1, 3);
     2065
     2066  if (L1C_valid) {
     2067    GETBITS(gloBiases.L1C_value, 16)
     2068  }
     2069  if (L1P_valid) {
     2070    GETBITS(gloBiases.L1P_value, 16)
     2071  }
     2072  if (L2C_valid) {
     2073    GETBITS(gloBiases.L2C_value, 16)
     2074  }
     2075  if (L2P_valid) {
     2076    GETBITS(gloBiases.L2P_value, 16)
     2077  }
     2078
     2079  if (!(_gloBiases == gloBiases)) {
     2080    _gloBiases.set(gloBiases);
     2081  }
     2082
     2083  return true;
     2084}
     2085
     2086//
     2087////////////////////////////////////////////////////////////////////////////
    20482088bool RTCM3Decoder::DecodeServiceCRS(unsigned char* data, int size) {
    20492089  t_serviceCrs serviceCrs;
     
    22092249      if (_rawFile)
    22102250        _staID = _rawFile->staID();
    2211       /* store the id into the list of loaded blocks */
    2212       _typeList.push_back(id);
     2251      /* store the id and message size into the list of loaded blocks */
     2252      _typeList.push_back(t_typeInfo());
     2253      _typeList.back().type = id;
     2254      _typeList.back().size = _BlockSize -6; /* header + crc */
    22132255
    22142256      /* SSR I+II data handled in another function, already pass the
     
    23002342            DecodeAntennaPosition(_Message, _BlockSize);
    23012343            break;
     2344          case 1230:
     2345            DecodeGLONASSCodePhaseBiases(_Message, _BlockSize);
     2346            break;
    23022347          case 1300:
    23032348            DecodeServiceCRS(_Message, _BlockSize);
  • trunk/BNC/src/RTCM3/RTCM3Decoder.h

    r10619 r10688  
    176176  bool DecodeServiceCRS(unsigned char* buffer, int bufLen);
    177177  /**
     178   * Extract GLONASS L1 and L2 Code-Phase bias messages from 1230 RTCM3 messages
     179   * @param buffer the buffer containing CLONASS L1 and L2 Code-Phase biases per station
     180   * @param bufLen the length of the buffer (the message length including header+crc)
     181   * @return <code>true</code> when data block was decodable
     182   */
     183  bool DecodeGLONASSCodePhaseBiases(unsigned char* buffer, int bufLen);
     184  /**
    178185   * Extract Helmert transformation parameters from 1301 RTCM3 messages
    179186   * @param buffer the buffer containing Helmert transformation parameters RTCM block
  • trunk/BNC/src/bncgetthread.cpp

    r10664 r10688  
    531531      if (_latencyChecker) {
    532532        _latencyChecker->checkOutage(irc);
    533         QListIterator<int> it(decoder()->_typeList);
     533        QListIterator<GPSDecoder::t_typeInfo> it(decoder()->_typeList);
    534534        _ssrEpoch = static_cast<int>(decoder()->corrGPSEpochTime());
    535535        if (_ssrEpoch != -1) {
     
    572572        }
    573573        while (it.hasNext()) {
    574           int rtcmType = it.next();
     574          int rtcmType = it.next().type;
    575575          if ((rtcmType >= 1001 && rtcmType <= 1004) || // legacy RTCM OBS
    576576              (rtcmType >= 1009 && rtcmType <= 1012) || // legacy RTCM OBS
     
    818818      // ------------------
    819819      for (int ii = 0; ii < decoder()->_typeList.size(); ii++) {
    820         QString type = QString("%1 ").arg(decoder()->_typeList[ii]);
    821         emit(newMessage(_staID + ": Received message type " + type.toLatin1(), true));
     820        QString type = QString("%1 ").arg(decoder()->_typeList[ii].type);
     821        QString size = (decoder()->_typeList[ii].size) ? QString("(size %1)").arg(decoder()->_typeList[ii].size) : "";
     822        emit(newMessage(_staID + ": Received message type " + type.toLatin1() +  size.toLatin1(), true));
    822823      }
    823824
     
    959960        }
    960961      }
     962
     963      // RTCM GLONASS Code-Phase biases (MT 1230)
     964      // ----------------------------------------
     965      if (decoder()->_gloBiases.changed) {
     966        QString gloCodePhaseBiases = decoder()->_gloBiases.toString();
     967        emit(newMessage(_staID + gloCodePhaseBiases.toLatin1(), true));
     968      }
     969
     970      // Service CRS / RTCM CRS
     971      // ------------------------
    961972      if (fmod(decoder()->corrGPSEpochTime(), 60.0) == 0.0) {
    962973        // Service CRS
    963         // -----------
    964974        for (int ii = 0; ii < decoder()->_serviceCrs.size(); ii++) {
    965975          QString servicecrsname  = QString(": Service CRS Name: %1 ").arg(decoder()->_serviceCrs[ii]._name);
     
    970980          //emit(newMessage(_staID + ce.toLatin1(), true));
    971981        }
    972 
    973982        // RTCM CRS
    974         // -----------
    975983        for (int ii = 0; ii < decoder()->_rtcmCrs.size(); ii++) {
    976984          QString rtcmcrsname = QString(": RTCM CRS Name: %1 ").arg(decoder()->_rtcmCrs[ii]._name);
     
    10401048
    10411049  decoder()->_gloFrq.clear();
     1050 // decoder()->_gloBiases.clear();
    10421051  decoder()->_typeList.clear();
    10431052  decoder()->_antType.clear();
  • trunk/BNC/src/ephemeris.cpp

    r10628 r10688  
    620620          _flags_unknown = false;
    621621          // Bit 0:
    622           _intSF = double(bitExtracted(int(statusflags), 1, 0));
     622          _intSF = double(bitExtracted(unsigned(statusflags), 1, 0));
    623623          if (system() == t_eph::QZSS) {
    624624            // Bit 1:
    625             _ephSF = double(bitExtracted(int(statusflags), 1, 1));
     625            _ephSF = double(bitExtracted(unsigned(statusflags), 1, 1));
    626626          }
    627627        }
     
    12691269          // ============
    12701270          // bit 0-1
    1271           _M_P =  double(bitExtracted(int(statusflags), 2, 0));
     1271          _M_P =  double(bitExtracted(unsigned(statusflags), 2, 0));
    12721272          // bit 2-3
    1273           _P1 =   double(bitExtracted(int(statusflags), 2, 2));
     1273          _P1 =   double(bitExtracted(unsigned(statusflags), 2, 2));
    12741274          // bit 4
    1275           _P2 =   double(bitExtracted(int(statusflags), 1, 4));
     1275          _P2 =   double(bitExtracted(unsigned(statusflags), 1, 4));
    12761276          // bit 5
    1277           _P3 =   double(bitExtracted(int(statusflags), 1, 5));
     1277          _P3 =   double(bitExtracted(unsigned(statusflags), 1, 5));
    12781278          // bit 6
    1279           _M_P4 = double(bitExtracted(int(statusflags), 1, 6));
     1279          _M_P4 = double(bitExtracted(unsigned(statusflags), 1, 6));
    12801280          // bit 7-8
    1281           _M_M =  double(bitExtracted(int(statusflags), 2, 7));
     1281          _M_M =  double(bitExtracted(unsigned(statusflags), 2, 7));
    12821282          /// GLO M/K exclusive flags/values only valid if flag M is set to '01'
    12831283          if (!_M_M) {
     
    13121312          // ============
    13131313          // bit 0 (is to be ignored, if bit 1 is zero)
    1314           _almanac_health = double(bitExtracted(int(healthflags), 1, 0));
     1314          _almanac_health = double(bitExtracted(unsigned(healthflags), 1, 0));
    13151315          // bit 1
    13161316          _almanac_health_availablility_indicator =
    1317                             double(bitExtracted(int(healthflags), 1, 1));
     1317                            double(bitExtracted(unsigned(healthflags), 1, 1));
    13181318          //  bit 2; GLO-M/K only, health bit of string 3
    1319           _M_l3 =           double(bitExtracted(int(healthflags), 1, 2));
     1319          _M_l3 =           double(bitExtracted(unsigned(healthflags), 1, 2));
    13201320        }
    13211321      }
     
    13321332        // ============
    13331333        // bit 0-1
    1334         _RT = double(bitExtracted(int(sourceflags), 2, 0));
     1334        _RT = double(bitExtracted(unsigned(sourceflags), 2, 0));
    13351335        // bit 2-3:
    1336         _RE = double(bitExtracted(int(sourceflags), 2, 2));
     1336        _RE = double(bitExtracted(unsigned(sourceflags), 2, 2));
    13371337      }
    13381338    }
     
    19041904      } else {
    19051905        // Bit 0
    1906         _E1B_DataInvalid = bitExtracted(int(SVhealth), 1, 0);
     1906        _E1B_DataInvalid = bitExtracted(unsigned(SVhealth), 1, 0);
    19071907        // Bit 1-2
    1908         _E1B_HS =   double(bitExtracted(int(SVhealth), 2, 1));
     1908        _E1B_HS =   double(bitExtracted(unsigned(SVhealth), 2, 1));
    19091909        // Bit 3
    1910         _E5a_DataInvalid = bitExtracted(int(SVhealth), 1, 3);
     1910        _E5a_DataInvalid = bitExtracted(unsigned(SVhealth), 1, 3);
    19111911        // Bit 4-5
    1912         _E5a_HS =   double(bitExtracted(int(SVhealth), 2, 4));
     1912        _E5a_HS =   double(bitExtracted(unsigned(SVhealth), 2, 4));
    19131913        // Bit 6
    1914         _E5b_DataInvalid = bitExtracted(int(SVhealth), 1, 6);
     1914        _E5b_DataInvalid = bitExtracted(unsigned(SVhealth), 1, 6);
    19151915        // Bit 7-8
    1916         _E5b_HS =   double(bitExtracted(int(SVhealth), 2, 7));
     1916        _E5b_HS =   double(bitExtracted(unsigned(SVhealth), 2, 7));
    19171917        if (_fnav) {
    19181918          _BGD_1_5B = 0.0;
     
    23792379
    23802380// Bit 5
    2381   bool URAindexIs15 =  bitExtracted(int(_health), 1, 5);
     2381  bool URAindexIs15 =  bitExtracted(unsigned(_health), 1, 5);
    23822382  if (URAindexIs15) {
    23832383    // in this case it is recommended
     
    23872387
    23882388  // Bit 4
    2389   bool MT17HealthIsUnavailable = bitExtracted(int(_health), 1, 4);
     2389  bool MT17HealthIsUnavailable = bitExtracted(unsigned(_health), 1, 4);
    23902390  if (MT17HealthIsUnavailable) {
    23912391    return 0;
     
    23932393
    23942394  // Bit 0-3
    2395   int MT17health = bitExtracted(int(_health), 4, 0);
     2395  int MT17health = bitExtracted(unsigned(_health), 4, 0);
    23962396  if (MT17health) {
    23972397    return 1;
  • trunk/BNC/src/orbComp/sp3Comp.cpp

    r10673 r10688  
    282282            epo->_dr[sat1->_prn]  = sat1->_xyz - sat2->_xyz;
    283283            // temporarily included START
    284             if (epo->_dr[sat1->_prn].NormFrobenius() > 1.0) {
     284            if (epo->_dr[sat1->_prn].NormFrobenius() > 10.0) {
    285285              epochOK = false;
    286286               out << "! " << epo->_tt.timestr().c_str() << "  "  << sat1->_prn.toString().c_str() << "excluded \n"
Note: See TracChangeset for help on using the changeset viewer.