Changeset 11179 in ntrip for trunk/BNC/src/bncgetthread.cpp


Ignore:
Timestamp:
Nov 6, 2026, 4:05:20 PM (6 hours ago)
Author:
stuerze
Message:

structuered logging is added and bug is fixed in SP3 file writing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncgetthread.cpp

    r11153 r11179  
    131131  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    132132  BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
     133  connect(this, SIGNAL(newLogRecord(t_logRecord,bool)),
     134  BNC_CORE, SLOT(slotLogRecord(t_logRecord,bool)));
     135  t_logRecord::registerStation(_staID);
    133136
    134137  _isToBeDeleted = false;
    … …  
    330333      _format.indexOf("RTCM2")  != -1 ||
    331334      _format.indexOf("RTCM 2") != -1) {
    332     emit(newMessage(_staID + ": Get data in RTCM 2.x format", true));
     335    emitFormat(": Get data in RTCM 2.x format", "RTCM2");
    333336    _decoder = new RTCM2Decoder(_staID.data());
    334337  } else if (_format.indexOf("RTCM_3") != -1 ||
    335338      _format.indexOf("RTCM3")  != -1 ||
    336339      _format.indexOf("RTCM 3") != -1) {
    337     emit(newMessage(_staID + ": Get data in RTCM 3.x format", true));
     340    emitFormat(": Get data in RTCM 3.x format", "RTCM3");
    338341    RTCM3Decoder* newDecoder = new RTCM3Decoder(_staID, _rawFile);
    339342    _decoder = newDecoder;
    … …  
    341344        this, SIGNAL(newMessage(QByteArray,bool)));
    342345  } else if (_format == "ZERO") {
    343     emit(newMessage(_staID + ": Forward data in original format", true));
     346    emitFormat(": Forward data in original format", "ZERO");
    344347    _decoder = new bncZeroDecoder(_staID, false);
    345348  }
    346349  else if (_format == "ZERO2FILE") {
    347     emit(newMessage(_staID + ": Get data in original format and store it", true));
     350    emitFormat(": Get data in original format and store it", "ZERO2FILE");
    348351    _decoder = new bncZeroDecoder(_staID, true);
    349352  }
    350353  else if (_format.indexOf("RTNET") != -1) {
    351     emit(newMessage(_staID + ": Get data in RTNet format", true));
     354    emitFormat(": Get data in RTNet format", "RTNET");
    352355    _decoder = new bncRtnetDecoder();
    353356  } else {
    … …  
    481484        _format = _rawFile->format();
    482485        _staID = _rawFile->staID();
     486        t_logRecord::registerStation(_staID);
    483487
    484488        QCoreApplication::processEvents();
    … …  
    508512          _latencyChecker->checkReconnect();
    509513        }
    510         emit(newMessage(_staID + ": Data timeout, reconnecting", true));
     514        emit newLogRecord(t_logRecord(t_logRecord::warning, "stream", "stream_timeout", _staID,
     515                                      _staID + ": Data timeout, reconnecting"), true);
    511516        msleep(10000); //sleep 10 sec, G. Weber
    512517        continue;
    … …  
    11431148  }
    11441149}
     1150
     1151// Message on the data format of the stream
     1152////////////////////////////////////////////////////////////////////////////
     1153void bncGetThread::emitFormat(const char* text, const char* decoder) {
     1154  t_logRecord rec(t_logRecord::info, "stream", "stream_format", _staID, _staID + text);
     1155  rec.add("decoder", QByteArray(decoder))
     1156     .add("format", _format);
     1157  emit newLogRecord(rec, true);
     1158}
Note: See TracChangeset for help on using the changeset viewer.