Index: trunk/BNC/src/GPSDecoder.h
===================================================================
--- trunk/BNC/src/GPSDecoder.h	(revision 11190)
+++ trunk/BNC/src/GPSDecoder.h	(revision 11191)
@@ -90,19 +90,24 @@
     bool   _height_f;
     int    _message;
+    t_typeInfo _source;   // RTCM message of the information (RTCM scan)
   };
 
   struct t_antInfo {
     t_antInfo() {
+      _descriptor[0] = _serialnumber[0] = 0;
     };
     char _descriptor[256];
     char _serialnumber[256];
+    t_typeInfo _source;   // RTCM message of the information (RTCM scan)
   };
 
   struct t_recInfo {
     t_recInfo() {
+      _descriptor[0] = _serialnumber[0] = _firmware[0] = 0;
     };
     char _descriptor[256];
     char _serialnumber[256];
     char _firmware[256];
+    t_typeInfo _source;   // RTCM message of the information (RTCM scan)
   };
 
@@ -184,5 +189,8 @@
   QList<t_rtcmCrs>        _rtcmCrs;            // RTCM CRS
   QString                 _gloFrq;             // GLONASS slot
+  t_typeInfo              _gloFrqSource;       // RTCM message of _gloFrq
   t_GloBiasInfo           _gloBiasInfo;          // RTCM GLO bias information message
+  t_typeInfo              _gloBiasSource;      // RTCM message of _gloBiasInfo
+  t_typeInfo              _currMsg;            // RTCM message being decoded
   bncRinex*               _rnx;                // RINEX writer
 };
Index: trunk/BNC/src/RTCM/RTCM2Decoder.cpp
===================================================================
--- trunk/BNC/src/RTCM/RTCM2Decoder.cpp	(revision 11190)
+++ trunk/BNC/src/RTCM/RTCM2Decoder.cpp	(revision 11191)
@@ -214,4 +214,5 @@
         _antList.back()._type = t_antRefPoint::APC;
         _antList.back()._message = _PP.ID();
+        _antList.back()._source  = _typeList.back();
       }
     } else if (_PP.ID() == 23) {
@@ -224,4 +225,5 @@
           memcpy(_antType.back()._descriptor, _msg23.antType.c_str(), antlen);
           _antType.back()._descriptor[antlen] = 0;
+          _antType.back()._source = _typeList.back();
           if (serlen) {
             memcpy(_antType.back()._serialnumber,  _msg23.antSN.c_str(), serlen);
@@ -243,4 +245,5 @@
         _antList.back()._type = t_antRefPoint::ARP;
         _antList.back()._message = _PP.ID();
+        _antList.back()._source  = _typeList.back();
       }
     }
Index: trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
===================================================================
--- trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 11190)
+++ trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 11191)
@@ -139,4 +139,5 @@
     CurrentObs._time = CurrentObsTime;
     CurrentObs._type = type;
+    CurrentObs._size = int(_currMsg._size);
 
     GETBITS(sv, 6)
@@ -734,4 +735,5 @@
           CurrentObs._time = CurrentObsTime;
           CurrentObs._type = type;
+          CurrentObs._size = int(_currMsg._size);
           if (sys == 'S')
             CurrentObs._prn.set(sys, 20 - 1 + RTCM3_MSM_NUMSAT - i);
@@ -965,4 +967,5 @@
     CurrentObs._time = CurrentObsTime;
     CurrentObs._type = type;
+    CurrentObs._size = int(_currMsg._size);
 
     GETBITS(sv, 6)
@@ -1348,4 +1351,5 @@
     GLOFreq[sv - 1] = 100 + eph._frq_num ; /* store frequency for other users (MSM) */
     _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frq_num, 2, 'f', 0);
+    _gloFrqSource = _currMsg;
 
     if (eph.validMdata()) {
@@ -2021,4 +2025,5 @@
     memcpy(_antType.back()._descriptor, antenna, antnum);
     _antType.back()._descriptor[antnum] = 0;
+    _antType.back()._source = _currMsg;
   }
   SKIPBITS(8) /* antenna setup ID */
@@ -2041,4 +2046,5 @@
       memcpy(_recType.back()._descriptor, receiver, recnum);
       _recType.back()._descriptor[recnum] = 0;
+      _recType.back()._source = _currMsg;
       if (recfirnum > -1 && recfirnum < 265) {
         memcpy(_recType.back()._firmware, rec_firmware, recfirnum);
@@ -2067,4 +2073,5 @@
   _antList.push_back(t_antRefPoint());
   _antList.back()._type = t_antRefPoint::ARP;
+  _antList.back()._source = _currMsg;
   SKIPBITS(22)
   GETBITSSIGN(x, 38)
@@ -2127,4 +2134,5 @@
   if (_gloBiasInfo != gloBiasInfo) {
     _gloBiasInfo.set(gloBiasInfo);
+    _gloBiasSource = _currMsg;
   }
   return true;
@@ -2153,4 +2161,6 @@
   if (_serviceCrs.empty() ||
       (strncmp(_serviceCrs.back()._name, serviceCrs._name, servicecrsnum) != 0)) {
+    serviceCrs._msgType = _currMsg._type;
+    serviceCrs._msgSize = int(_currMsg._size);
     _serviceCrs.push_back(serviceCrs);
     GETFLOAT(_serviceCrs.back()._CE, 16, 1/100.0)
@@ -2184,4 +2194,6 @@
   if (_rtcmCrs.empty() ||
       (strncmp(_rtcmCrs.back()._name, rtcmCrs._name, rtcmcrsnum) != 0)) {
+    rtcmCrs._msgType = _currMsg._type;
+    rtcmCrs._msgSize = int(_currMsg._size);
     _rtcmCrs.push_back(rtcmCrs);
 
@@ -2248,4 +2260,6 @@
     }
   }
+  helmertPar._msgType = _currMsg._type;
+  helmertPar._msgSize = int(_currMsg._size);
   _helmertPar.push_back(helmertPar);
 
@@ -2300,4 +2314,5 @@
       _typeList.back()._type = id;
       _typeList.back()._size = _BlockSize -6; /* header + crc */
+      _currMsg = _typeList.back();
 
       /* SSR I+II data handled in another function, already pass the
Index: trunk/BNC/src/RTCM3/crs.h
===================================================================
--- trunk/BNC/src/RTCM3/crs.h	(revision 11190)
+++ trunk/BNC/src/RTCM3/crs.h	(revision 11191)
@@ -19,4 +19,6 @@
     _coordinateEpoch = 0;
     _CE              = 0;
+    _msgType         = 0;
+    _msgSize         = 0;
   }
   ~t_serviceCrs() {
@@ -41,4 +43,6 @@
     double   _coordinateEpoch;
     double   _CE;
+    int      _msgType;   // RTCM message of the information (RTCM scan)
+    int      _msgSize;
   };
 
@@ -49,4 +53,6 @@
       _anchor = 0;
       _plateNumber = 0;
+      _msgType = 0;
+      _msgSize = 0;
     }
 
@@ -75,4 +81,6 @@
     int              _plateNumber;      // 0.. unknown, 7.. Eurasia
     QStringList      _databaseLinks;
+    int              _msgType;          // RTCM message of the information (RTCM scan)
+    int              _msgSize;
   };
 
@@ -97,4 +105,6 @@
        _sc  = 0.0;
        _scr = 0.0;
+       _msgType = 0;
+       _msgSize = 0;
      }
 
@@ -190,4 +200,6 @@
      double         _sc;  // scale
      double         _scr; // scale rate
+     int            _msgType; // RTCM message of the information (RTCM scan)
+     int            _msgSize;
    };
 
Index: trunk/BNC/src/bncgetthread.cpp
===================================================================
--- trunk/BNC/src/bncgetthread.cpp	(revision 11190)
+++ trunk/BNC/src/bncgetthread.cpp	(revision 11191)
@@ -909,4 +909,7 @@
         }
         if (!allFound) {
+          GPSDecoder::t_typeInfo source;   // message with the new type(s)
+          source._type = obs._type;
+          source._size = obs._size;
           QString msg;
           QTextStream str(&msg);
@@ -915,5 +918,5 @@
             str << " " << rnxTypes[iType];
           }
-          emitContent(_staID + ": Observation Types: " + msg.toLatin1(),  true);
+          emitContent(_staID + ": Observation Types: " + msg.toLatin1(),  true, source);
         }
       }
@@ -923,8 +926,8 @@
       for (int ii = 0; ii < decoder()->_antType.size(); ii++) {
         QString ant1 = QString(": Antenna Descriptor: %1 ").arg(decoder()->_antType[ii]._descriptor);
-        emitContent(_staID + ant1.toLatin1(), true);
+        emitContent(_staID + ant1.toLatin1(), true, decoder()->_antType[ii]._source);
         if (strlen(decoder()->_antType[ii]._serialnumber)) {
           QString ant2 = QString(": Antenna Serial Number: %1 ").arg(decoder()->_antType[ii]._serialnumber);
-          emitContent(_staID + ant2.toLatin1(), true);
+          emitContent(_staID + ant2.toLatin1(), true, decoder()->_antType[ii]._source);
         }
       }
@@ -943,7 +946,7 @@
         ant2 = QString("%1 ").arg(decoder()->_antList[ii]._yy, 0, 'f', 4).toLatin1();
         ant3 = QString("%1 ").arg(decoder()->_antList[ii]._zz, 0, 'f', 4).toLatin1();
-        emitContent(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true);
-        emitContent(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true);
-        emitContent(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true);
+        emitContent(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true, decoder()->_antList[ii]._source);
+        emitContent(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true, decoder()->_antList[ii]._source);
+        emitContent(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true, decoder()->_antList[ii]._source);
         double hh = 0.0;
         if (decoder()->_antList[ii]._height_f) {
@@ -951,5 +954,6 @@
           QByteArray ant4 = QString("%1 ").arg(hh, 0, 'f', 4).toLatin1();
           emitContent(
-              _staID + ": Antenna height above marker " + ant4 + "m", true);
+              _staID + ": Antenna height above marker " + ant4 + "m", true,
+              decoder()->_antList[ii]._source);
         }
         emit(newAntCrd(_staID, decoder()->_antList[ii]._xx,
@@ -963,7 +967,7 @@
         QString rec2 = QString(": Receiver Firmware Version: %1 ").arg(decoder()->_recType[ii]._firmware);
         QString rec3 = QString(": Receiver Serial Number: %1 ").arg(decoder()->_recType[ii]._serialnumber);
-        emitContent(_staID + rec1.toLatin1(), true);
-        emitContent(_staID + rec2.toLatin1(), true);
-        emitContent(_staID + rec3.toLatin1(), true);
+        emitContent(_staID + rec1.toLatin1(), true, decoder()->_recType[ii]._source);
+        emitContent(_staID + rec2.toLatin1(), true, decoder()->_recType[ii]._source);
+        emitContent(_staID + rec3.toLatin1(), true, decoder()->_recType[ii]._source);
       }
 
@@ -982,5 +986,5 @@
           emitContent(
               _staID + ": GLONASS Slot:Freq " + _gloSlots.join(" ").toLatin1(),
-              true);
+              true, decoder()->_gloFrqSource);
         }
       }
@@ -990,5 +994,5 @@
       if (decoder()->_gloBiasInfo.changed()) {
         QString gloCodePhaseBiases = decoder()->_gloBiasInfo.toString();
-        emitContent(_staID + gloCodePhaseBiases.toLatin1(), true);
+        emitContent(_staID + gloCodePhaseBiases.toLatin1(), true, decoder()->_gloBiasSource);
         decoder()->_gloBiasInfo.setChanged(false);
       }
@@ -999,22 +1003,28 @@
         // Service CRS
         for (int ii = 0; ii < decoder()->_serviceCrs.size(); ii++) {
+          GPSDecoder::t_typeInfo source;
+          source._type = decoder()->_serviceCrs[ii]._msgType;
+          source._size = decoder()->_serviceCrs[ii]._msgSize;
           QString servicecrsname  = QString(": Service CRS Name: %1 ").arg(decoder()->_serviceCrs[ii]._name);
           QString coordinateEpoch = QString(": Service CRS Coordinate Epoch: %1 ").arg(decoder()->_serviceCrs[ii]._coordinateEpoch);
           //QString ce = QString(": CE: %1 ").arg(decoder()->_serviceCrs[ii]._CE);
-          emitContent(_staID + servicecrsname.toLatin1(), true);
-          emitContent(_staID + coordinateEpoch.toLatin1(), true);
+          emitContent(_staID + servicecrsname.toLatin1(), true, source);
+          emitContent(_staID + coordinateEpoch.toLatin1(), true, source);
           //emitContent(_staID + ce.toLatin1(), true);
         }
         // RTCM CRS
         for (int ii = 0; ii < decoder()->_rtcmCrs.size(); ii++) {
+          GPSDecoder::t_typeInfo source;
+          source._type = decoder()->_rtcmCrs[ii]._msgType;
+          source._size = decoder()->_rtcmCrs[ii]._msgSize;
           QString rtcmcrsname = QString(": RTCM CRS Name: %1 ").arg(decoder()->_rtcmCrs[ii]._name);
           QString anchor      = QString(": RTCM CRS Anchor: %1 ").arg(decoder()->_rtcmCrs[ii]._anchor);
           QString platenumber = QString(": RTCM CRS Plate Number: %1 ").arg(decoder()->_rtcmCrs[ii]._plateNumber);
-          emitContent(_staID + rtcmcrsname.toLatin1(), true);
-          emitContent(_staID + anchor.toLatin1(), true);
-          emitContent(_staID + platenumber.toLatin1(), true);
+          emitContent(_staID + rtcmcrsname.toLatin1(), true, source);
+          emitContent(_staID + anchor.toLatin1(), true, source);
+          emitContent(_staID + platenumber.toLatin1(), true, source);
           for (int i = 0; i<decoder()->_rtcmCrs[ii]._databaseLinks.size(); i++) {
             QString dblink = QString(": Database Link: %1 ").arg(decoder()->_rtcmCrs[ii]._databaseLinks[i]);
-            emitContent(_staID + dblink.toLatin1(), true);
+            emitContent(_staID + dblink.toLatin1(), true, source);
           }
         }
@@ -1024,4 +1034,7 @@
         for (int ii = 0; ii < decoder()->_helmertPar.size(); ii++) {
           t_helmertPar& helmertPar = decoder()->_helmertPar[ii];
+          GPSDecoder::t_typeInfo source;
+          source._type = helmertPar._msgType;
+          source._size = helmertPar._msgSize;
           bncTime t; t.setmjd(0, helmertPar._mjd); QString dateStr = QString::fromStdString(t.datestr());
           QString sourcename  = QString(": MT1301 Source Name: %1 ").arg(helmertPar._sourceName);
@@ -1037,12 +1050,12 @@
               .arg(helmertPar._oxr).arg(helmertPar._oyr).arg(helmertPar._ozr);
           QString parscale = QString(": MT1301 Helmert Par Scale: sc = %1, scr = %2").arg(helmertPar._sc).arg(helmertPar._scr);
-          emitContent(_staID + sourcename.toLatin1(), true);
-          emitContent(_staID + targetname.toLatin1(), true);
-          emitContent(_staID + sysidentnum.toLatin1(), true);
-          emitContent(_staID + trafomessageind.toLatin1(), true);
-          emitContent(_staID + epoch.toLatin1(), true);
-          emitContent(_staID + partrans.toLatin1(), true);
-          emitContent(_staID + parrot.toLatin1(), true);
-          emitContent(_staID + parscale.toLatin1(), true);
+          emitContent(_staID + sourcename.toLatin1(), true, source);
+          emitContent(_staID + targetname.toLatin1(), true, source);
+          emitContent(_staID + sysidentnum.toLatin1(), true, source);
+          emitContent(_staID + trafomessageind.toLatin1(), true, source);
+          emitContent(_staID + epoch.toLatin1(), true, source);
+          emitContent(_staID + partrans.toLatin1(), true, source);
+          emitContent(_staID + parrot.toLatin1(), true, source);
+          emitContent(_staID + parscale.toLatin1(), true, source);
         }
       }
@@ -1163,8 +1176,16 @@
 }
 
-// Content of the stream found by the RTCM scan (miscScanRTCM)
+// Content of the stream found by the RTCM scan (miscScanRTCM), with type
+// and size of the RTCM message carrying the information
 ////////////////////////////////////////////////////////////////////////////
-void bncGetThread::emitContent(const QByteArray& msg, bool showOnScreen) {
-  emit newLogRecord(t_logRecord(t_logRecord::info, "stream", "stream_content", _staID, msg),
-                    showOnScreen);
-}
+void bncGetThread::emitContent(const QByteArray& msg, bool showOnScreen,
+                               const GPSDecoder::t_typeInfo& source) {
+  t_logRecord rec(t_logRecord::info, "stream", "stream_content", _staID, msg);
+  if (source._type) {
+    rec.add("message_type", source._type);
+  }
+  if (source._size) {
+    rec.add("size", int(source._size));
+  }
+  emit newLogRecord(rec, showOnScreen);
+}
Index: trunk/BNC/src/bncgetthread.h
===================================================================
--- trunk/BNC/src/bncgetthread.h	(revision 11190)
+++ trunk/BNC/src/bncgetthread.h	(revision 11191)
@@ -40,5 +40,5 @@
 #include "rinex/rnxobsfile.h"
 
-class GPSDecoder;
+#include "GPSDecoder.h"
 class QextSerialPort;
 class latencyChecker;
@@ -103,5 +103,6 @@
    t_irc        initDecoder();
    void         emitFormat(const char* text, const char* decoder);
-   void         emitContent(const QByteArray& msg, bool showOnScreen);
+   void         emitContent(const QByteArray& msg, bool showOnScreen,
+                            const GPSDecoder::t_typeInfo& source);
    GPSDecoder* decoder();
 
Index: trunk/BNC/src/satObs.h
===================================================================
--- trunk/BNC/src/satObs.h	(revision 11190)
+++ trunk/BNC/src/satObs.h	(revision 11191)
@@ -54,4 +54,5 @@
   t_satObs() {
     _type = 0;
+    _size = 0;
   }
   t_satObs(const t_satObs& other) { // copy constructor (deep copy)
@@ -84,4 +85,5 @@
     _staID.clear();
     _type = 0;
+    _size = 0;
   }
 
@@ -90,4 +92,5 @@
   bncTime                _time;
   int                    _type; // MT
+  int                    _size; // size of the message [bytes], 0 if unknown
   std::vector<t_frqObs*> _obs;
 
@@ -98,4 +101,5 @@
     _time  = other._time;
     _type  = other._type;
+    _size  = other._size;
     for (unsigned ii = 0; ii < other._obs.size(); ii++) {
       _obs.push_back(new t_frqObs(*other._obs[ii]));
