Changeset 11191 in ntrip


Ignore:
Timestamp:
Nov 10, 2026, 12:11:31 PM (less than one hour ago)
Author:
stuerze
Message:

Structured logging improved

Location:
trunk/BNC/src
Files:
7 edited

Legend:

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

    r11057 r11191  
    9090    bool   _height_f;
    9191    int    _message;
     92    t_typeInfo _source;   // RTCM message of the information (RTCM scan)
    9293  };
    9394
    9495  struct t_antInfo {
    9596    t_antInfo() {
     97      _descriptor[0] = _serialnumber[0] = 0;
    9698    };
    9799    char _descriptor[256];
    98100    char _serialnumber[256];
     101    t_typeInfo _source;   // RTCM message of the information (RTCM scan)
    99102  };
    100103
    101104  struct t_recInfo {
    102105    t_recInfo() {
     106      _descriptor[0] = _serialnumber[0] = _firmware[0] = 0;
    103107    };
    104108    char _descriptor[256];
    105109    char _serialnumber[256];
    106110    char _firmware[256];
     111    t_typeInfo _source;   // RTCM message of the information (RTCM scan)
    107112  };
    108113
    … …  
    184189  QList<t_rtcmCrs>        _rtcmCrs;            // RTCM CRS
    185190  QString                 _gloFrq;             // GLONASS slot
     191  t_typeInfo              _gloFrqSource;       // RTCM message of _gloFrq
    186192  t_GloBiasInfo           _gloBiasInfo;          // RTCM GLO bias information message
     193  t_typeInfo              _gloBiasSource;      // RTCM message of _gloBiasInfo
     194  t_typeInfo              _currMsg;            // RTCM message being decoded
    187195  bncRinex*               _rnx;                // RINEX writer
    188196};
  • trunk/BNC/src/RTCM/RTCM2Decoder.cpp

    r11023 r11191  
    214214        _antList.back()._type = t_antRefPoint::APC;
    215215        _antList.back()._message = _PP.ID();
     216        _antList.back()._source  = _typeList.back();
    216217      }
    217218    } else if (_PP.ID() == 23) {
    … …  
    224225          memcpy(_antType.back()._descriptor, _msg23.antType.c_str(), antlen);
    225226          _antType.back()._descriptor[antlen] = 0;
     227          _antType.back()._source = _typeList.back();
    226228          if (serlen) {
    227229            memcpy(_antType.back()._serialnumber,  _msg23.antSN.c_str(), serlen);
    … …  
    243245        _antList.back()._type = t_antRefPoint::ARP;
    244246        _antList.back()._message = _PP.ID();
     247        _antList.back()._source  = _typeList.back();
    245248      }
    246249    }
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r11185 r11191  
    139139    CurrentObs._time = CurrentObsTime;
    140140    CurrentObs._type = type;
     141    CurrentObs._size = int(_currMsg._size);
    141142
    142143    GETBITS(sv, 6)
    … …  
    734735          CurrentObs._time = CurrentObsTime;
    735736          CurrentObs._type = type;
     737          CurrentObs._size = int(_currMsg._size);
    736738          if (sys == 'S')
    737739            CurrentObs._prn.set(sys, 20 - 1 + RTCM3_MSM_NUMSAT - i);
    … …  
    965967    CurrentObs._time = CurrentObsTime;
    966968    CurrentObs._type = type;
     969    CurrentObs._size = int(_currMsg._size);
    967970
    968971    GETBITS(sv, 6)
    … …  
    13481351    GLOFreq[sv - 1] = 100 + eph._frq_num ; /* store frequency for other users (MSM) */
    13491352    _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frq_num, 2, 'f', 0);
     1353    _gloFrqSource = _currMsg;
    13501354
    13511355    if (eph.validMdata()) {
    … …  
    20212025    memcpy(_antType.back()._descriptor, antenna, antnum);
    20222026    _antType.back()._descriptor[antnum] = 0;
     2027    _antType.back()._source = _currMsg;
    20232028  }
    20242029  SKIPBITS(8) /* antenna setup ID */
    … …  
    20412046      memcpy(_recType.back()._descriptor, receiver, recnum);
    20422047      _recType.back()._descriptor[recnum] = 0;
     2048      _recType.back()._source = _currMsg;
    20432049      if (recfirnum > -1 && recfirnum < 265) {
    20442050        memcpy(_recType.back()._firmware, rec_firmware, recfirnum);
    … …  
    20672073  _antList.push_back(t_antRefPoint());
    20682074  _antList.back()._type = t_antRefPoint::ARP;
     2075  _antList.back()._source = _currMsg;
    20692076  SKIPBITS(22)
    20702077  GETBITSSIGN(x, 38)
    … …  
    21272134  if (_gloBiasInfo != gloBiasInfo) {
    21282135    _gloBiasInfo.set(gloBiasInfo);
     2136    _gloBiasSource = _currMsg;
    21292137  }
    21302138  return true;
    … …  
    21532161  if (_serviceCrs.empty() ||
    21542162      (strncmp(_serviceCrs.back()._name, serviceCrs._name, servicecrsnum) != 0)) {
     2163    serviceCrs._msgType = _currMsg._type;
     2164    serviceCrs._msgSize = int(_currMsg._size);
    21552165    _serviceCrs.push_back(serviceCrs);
    21562166    GETFLOAT(_serviceCrs.back()._CE, 16, 1/100.0)
    … …  
    21842194  if (_rtcmCrs.empty() ||
    21852195      (strncmp(_rtcmCrs.back()._name, rtcmCrs._name, rtcmcrsnum) != 0)) {
     2196    rtcmCrs._msgType = _currMsg._type;
     2197    rtcmCrs._msgSize = int(_currMsg._size);
    21862198    _rtcmCrs.push_back(rtcmCrs);
    21872199
    … …  
    22482260    }
    22492261  }
     2262  helmertPar._msgType = _currMsg._type;
     2263  helmertPar._msgSize = int(_currMsg._size);
    22502264  _helmertPar.push_back(helmertPar);
    22512265
    … …  
    23002314      _typeList.back()._type = id;
    23012315      _typeList.back()._size = _BlockSize -6; /* header + crc */
     2316      _currMsg = _typeList.back();
    23022317
    23032318      /* SSR I+II data handled in another function, already pass the
  • trunk/BNC/src/RTCM3/crs.h

    r11124 r11191  
    1919    _coordinateEpoch = 0;
    2020    _CE              = 0;
     21    _msgType         = 0;
     22    _msgSize         = 0;
    2123  }
    2224  ~t_serviceCrs() {
    … …  
    4143    double   _coordinateEpoch;
    4244    double   _CE;
     45    int      _msgType;   // RTCM message of the information (RTCM scan)
     46    int      _msgSize;
    4347  };
    4448
    … …  
    4953      _anchor = 0;
    5054      _plateNumber = 0;
     55      _msgType = 0;
     56      _msgSize = 0;
    5157    }
    5258
    … …  
    7581    int              _plateNumber;      // 0.. unknown, 7.. Eurasia
    7682    QStringList      _databaseLinks;
     83    int              _msgType;          // RTCM message of the information (RTCM scan)
     84    int              _msgSize;
    7785  };
    7886
    … …  
    97105       _sc  = 0.0;
    98106       _scr = 0.0;
     107       _msgType = 0;
     108       _msgSize = 0;
    99109     }
    100110
    … …  
    190200     double         _sc;  // scale
    191201     double         _scr; // scale rate
     202     int            _msgType; // RTCM message of the information (RTCM scan)
     203     int            _msgSize;
    192204   };
    193205
  • trunk/BNC/src/bncgetthread.cpp

    r11190 r11191  
    909909        }
    910910        if (!allFound) {
     911          GPSDecoder::t_typeInfo source;   // message with the new type(s)
     912          source._type = obs._type;
     913          source._size = obs._size;
    911914          QString msg;
    912915          QTextStream str(&msg);
    … …  
    915918            str << " " << rnxTypes[iType];
    916919          }
    917           emitContent(_staID + ": Observation Types: " + msg.toLatin1(),  true);
     920          emitContent(_staID + ": Observation Types: " + msg.toLatin1(),  true, source);
    918921        }
    919922      }
    … …  
    923926      for (int ii = 0; ii < decoder()->_antType.size(); ii++) {
    924927        QString ant1 = QString(": Antenna Descriptor: %1 ").arg(decoder()->_antType[ii]._descriptor);
    925         emitContent(_staID + ant1.toLatin1(), true);
     928        emitContent(_staID + ant1.toLatin1(), true, decoder()->_antType[ii]._source);
    926929        if (strlen(decoder()->_antType[ii]._serialnumber)) {
    927930          QString ant2 = QString(": Antenna Serial Number: %1 ").arg(decoder()->_antType[ii]._serialnumber);
    928           emitContent(_staID + ant2.toLatin1(), true);
     931          emitContent(_staID + ant2.toLatin1(), true, decoder()->_antType[ii]._source);
    929932        }
    930933      }
    … …  
    943946        ant2 = QString("%1 ").arg(decoder()->_antList[ii]._yy, 0, 'f', 4).toLatin1();
    944947        ant3 = QString("%1 ").arg(decoder()->_antList[ii]._zz, 0, 'f', 4).toLatin1();
    945         emitContent(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true);
    946         emitContent(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true);
    947         emitContent(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true);
     948        emitContent(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true, decoder()->_antList[ii]._source);
     949        emitContent(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true, decoder()->_antList[ii]._source);
     950        emitContent(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true, decoder()->_antList[ii]._source);
    948951        double hh = 0.0;
    949952        if (decoder()->_antList[ii]._height_f) {
    … …  
    951954          QByteArray ant4 = QString("%1 ").arg(hh, 0, 'f', 4).toLatin1();
    952955          emitContent(
    953               _staID + ": Antenna height above marker " + ant4 + "m", true);
     956              _staID + ": Antenna height above marker " + ant4 + "m", true,
     957              decoder()->_antList[ii]._source);
    954958        }
    955959        emit(newAntCrd(_staID, decoder()->_antList[ii]._xx,
    … …  
    963967        QString rec2 = QString(": Receiver Firmware Version: %1 ").arg(decoder()->_recType[ii]._firmware);
    964968        QString rec3 = QString(": Receiver Serial Number: %1 ").arg(decoder()->_recType[ii]._serialnumber);
    965         emitContent(_staID + rec1.toLatin1(), true);
    966         emitContent(_staID + rec2.toLatin1(), true);
    967         emitContent(_staID + rec3.toLatin1(), true);
     969        emitContent(_staID + rec1.toLatin1(), true, decoder()->_recType[ii]._source);
     970        emitContent(_staID + rec2.toLatin1(), true, decoder()->_recType[ii]._source);
     971        emitContent(_staID + rec3.toLatin1(), true, decoder()->_recType[ii]._source);
    968972      }
    969973
    … …  
    982986          emitContent(
    983987              _staID + ": GLONASS Slot:Freq " + _gloSlots.join(" ").toLatin1(),
    984               true);
     988              true, decoder()->_gloFrqSource);
    985989        }
    986990      }
    … …  
    990994      if (decoder()->_gloBiasInfo.changed()) {
    991995        QString gloCodePhaseBiases = decoder()->_gloBiasInfo.toString();
    992         emitContent(_staID + gloCodePhaseBiases.toLatin1(), true);
     996        emitContent(_staID + gloCodePhaseBiases.toLatin1(), true, decoder()->_gloBiasSource);
    993997        decoder()->_gloBiasInfo.setChanged(false);
    994998      }
    … …  
    9991003        // Service CRS
    10001004        for (int ii = 0; ii < decoder()->_serviceCrs.size(); ii++) {
     1005          GPSDecoder::t_typeInfo source;
     1006          source._type = decoder()->_serviceCrs[ii]._msgType;
     1007          source._size = decoder()->_serviceCrs[ii]._msgSize;
    10011008          QString servicecrsname  = QString(": Service CRS Name: %1 ").arg(decoder()->_serviceCrs[ii]._name);
    10021009          QString coordinateEpoch = QString(": Service CRS Coordinate Epoch: %1 ").arg(decoder()->_serviceCrs[ii]._coordinateEpoch);
    10031010          //QString ce = QString(": CE: %1 ").arg(decoder()->_serviceCrs[ii]._CE);
    1004           emitContent(_staID + servicecrsname.toLatin1(), true);
    1005           emitContent(_staID + coordinateEpoch.toLatin1(), true);
     1011          emitContent(_staID + servicecrsname.toLatin1(), true, source);
     1012          emitContent(_staID + coordinateEpoch.toLatin1(), true, source);
    10061013          //emitContent(_staID + ce.toLatin1(), true);
    10071014        }
    10081015        // RTCM CRS
    10091016        for (int ii = 0; ii < decoder()->_rtcmCrs.size(); ii++) {
     1017          GPSDecoder::t_typeInfo source;
     1018          source._type = decoder()->_rtcmCrs[ii]._msgType;
     1019          source._size = decoder()->_rtcmCrs[ii]._msgSize;
    10101020          QString rtcmcrsname = QString(": RTCM CRS Name: %1 ").arg(decoder()->_rtcmCrs[ii]._name);
    10111021          QString anchor      = QString(": RTCM CRS Anchor: %1 ").arg(decoder()->_rtcmCrs[ii]._anchor);
    10121022          QString platenumber = QString(": RTCM CRS Plate Number: %1 ").arg(decoder()->_rtcmCrs[ii]._plateNumber);
    1013           emitContent(_staID + rtcmcrsname.toLatin1(), true);
    1014           emitContent(_staID + anchor.toLatin1(), true);
    1015           emitContent(_staID + platenumber.toLatin1(), true);
     1023          emitContent(_staID + rtcmcrsname.toLatin1(), true, source);
     1024          emitContent(_staID + anchor.toLatin1(), true, source);
     1025          emitContent(_staID + platenumber.toLatin1(), true, source);
    10161026          for (int i = 0; i<decoder()->_rtcmCrs[ii]._databaseLinks.size(); i++) {
    10171027            QString dblink = QString(": Database Link: %1 ").arg(decoder()->_rtcmCrs[ii]._databaseLinks[i]);
    1018             emitContent(_staID + dblink.toLatin1(), true);
     1028            emitContent(_staID + dblink.toLatin1(), true, source);
    10191029          }
    10201030        }
    … …  
    10241034        for (int ii = 0; ii < decoder()->_helmertPar.size(); ii++) {
    10251035          t_helmertPar& helmertPar = decoder()->_helmertPar[ii];
     1036          GPSDecoder::t_typeInfo source;
     1037          source._type = helmertPar._msgType;
     1038          source._size = helmertPar._msgSize;
    10261039          bncTime t; t.setmjd(0, helmertPar._mjd); QString dateStr = QString::fromStdString(t.datestr());
    10271040          QString sourcename  = QString(": MT1301 Source Name: %1 ").arg(helmertPar._sourceName);
    … …  
    10371050              .arg(helmertPar._oxr).arg(helmertPar._oyr).arg(helmertPar._ozr);
    10381051          QString parscale = QString(": MT1301 Helmert Par Scale: sc = %1, scr = %2").arg(helmertPar._sc).arg(helmertPar._scr);
    1039           emitContent(_staID + sourcename.toLatin1(), true);
    1040           emitContent(_staID + targetname.toLatin1(), true);
    1041           emitContent(_staID + sysidentnum.toLatin1(), true);
    1042           emitContent(_staID + trafomessageind.toLatin1(), true);
    1043           emitContent(_staID + epoch.toLatin1(), true);
    1044           emitContent(_staID + partrans.toLatin1(), true);
    1045           emitContent(_staID + parrot.toLatin1(), true);
    1046           emitContent(_staID + parscale.toLatin1(), true);
     1052          emitContent(_staID + sourcename.toLatin1(), true, source);
     1053          emitContent(_staID + targetname.toLatin1(), true, source);
     1054          emitContent(_staID + sysidentnum.toLatin1(), true, source);
     1055          emitContent(_staID + trafomessageind.toLatin1(), true, source);
     1056          emitContent(_staID + epoch.toLatin1(), true, source);
     1057          emitContent(_staID + partrans.toLatin1(), true, source);
     1058          emitContent(_staID + parrot.toLatin1(), true, source);
     1059          emitContent(_staID + parscale.toLatin1(), true, source);
    10471060        }
    10481061      }
    … …  
    11631176}
    11641177
    1165 // Content of the stream found by the RTCM scan (miscScanRTCM)
     1178// Content of the stream found by the RTCM scan (miscScanRTCM), with type
     1179// and size of the RTCM message carrying the information
    11661180////////////////////////////////////////////////////////////////////////////
    1167 void bncGetThread::emitContent(const QByteArray& msg, bool showOnScreen) {
    1168   emit newLogRecord(t_logRecord(t_logRecord::info, "stream", "stream_content", _staID, msg),
    1169                     showOnScreen);
    1170 }
     1181void bncGetThread::emitContent(const QByteArray& msg, bool showOnScreen,
     1182                               const GPSDecoder::t_typeInfo& source) {
     1183  t_logRecord rec(t_logRecord::info, "stream", "stream_content", _staID, msg);
     1184  if (source._type) {
     1185    rec.add("message_type", source._type);
     1186  }
     1187  if (source._size) {
     1188    rec.add("size", int(source._size));
     1189  }
     1190  emit newLogRecord(rec, showOnScreen);
     1191}
  • trunk/BNC/src/bncgetthread.h

    r11185 r11191  
    4040#include "rinex/rnxobsfile.h"
    4141
    42 class GPSDecoder;
     42#include "GPSDecoder.h"
    4343class QextSerialPort;
    4444class latencyChecker;
    … …  
    103103   t_irc        initDecoder();
    104104   void         emitFormat(const char* text, const char* decoder);
    105    void         emitContent(const QByteArray& msg, bool showOnScreen);
     105   void         emitContent(const QByteArray& msg, bool showOnScreen,
     106                            const GPSDecoder::t_typeInfo& source);
    106107   GPSDecoder* decoder();
    107108
  • trunk/BNC/src/satObs.h

    r11047 r11191  
    5454  t_satObs() {
    5555    _type = 0;
     56    _size = 0;
    5657  }
    5758  t_satObs(const t_satObs& other) { // copy constructor (deep copy)
    … …  
    8485    _staID.clear();
    8586    _type = 0;
     87    _size = 0;
    8688  }
    8789
    … …  
    9092  bncTime                _time;
    9193  int                    _type; // MT
     94  int                    _size; // size of the message [bytes], 0 if unknown
    9295  std::vector<t_frqObs*> _obs;
    9396
    … …  
    98101    _time  = other._time;
    99102    _type  = other._type;
     103    _size  = other._size;
    100104    for (unsigned ii = 0; ii < other._obs.size(); ii++) {
    101105      _obs.push_back(new t_frqObs(*other._obs[ii]));
Note: See TracChangeset for help on using the changeset viewer.