Changeset 1299 in ntrip


Ignore:
Timestamp:
Dec 12, 2008, 5:58:00 PM (15 years ago)
Author:
zdenek
Message:

* empty log message *

Location:
trunk/BNC
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM/RTCM2Decoder.cpp

    r1269 r1299  
    309309    t_listMap::const_iterator ieph = _ephList.find(PRN);
    310310
    311     if ( ieph == _ephList.end() ) {
    312       errmsg.push_back("missing eph for " + PRN);
    313       continue;
    314     }
    315 
    316311    double L1 = 0;
    317312    double L2 = 0;
     
    361356      }
    362357
    363       eph = ieph->second->getEph(IODcorr);
     358      // Select corresponding ephemerides
     359      if ( ieph != _ephList.end() ) {
     360        eph = ieph->second->getEph(IODcorr);
     361      }
    364362
    365363      if ( eph ) {
     
    443441      _obsList.push_back( new_obs );
    444442
    445       ///ostringstream hasIODstr;
    446       ///copy(hasIOD.begin(), hasIOD.end(), ostream_iterator<string>(hasIODstr, "    "));
    447       ///errmsg.push_back("decoded PRN " + PRN + " : " + hasIODstr.str());
    448     }
    449   }
    450 }
     443      ////ostringstream hasIODstr;
     444      ////copy(hasIOD.begin(), hasIOD.end(), ostream_iterator<string>(hasIODstr, "    "));
     445      ////errmsg.push_back("decoded PRN " + PRN + " : " + hasIODstr.str());
     446    }
     447  }
     448}
  • trunk/BNC/RTCM3/RTCM3Decoder.cpp

    r1268 r1299  
    163163                    .arg(_numLat)
    164164                    .arg(_numGaps);
    165                     emit(newMessage(QString(_staID + late ).toAscii() ) );
     165                    emit(newMessage(QString(_staID + late ).toAscii(), true) );
    166166                  } else {
    167167                  late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs")
     
    171171                    .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.)
    172172                    .arg(_numLat);
    173                   emit(newMessage(QString(_staID + late ).toAscii() ) );
     173                  emit(newMessage(QString(_staID + late ).toAscii(), true) );
    174174                  }
    175175                }
     
    269269           
    270270            if (rr == 2) {
    271               emit(newMessage( (_staID + ": No valid RINEX! All values are modulo 299792.458!").toAscii() ));
     271              emit(newMessage( (_staID + ": No valid RINEX! All values are modulo 299792.458!").toAscii(), true));
    272272            }
    273273           
     
    368368              .arg(ep->TOC,       6)
    369369              .arg(ep->TOE,       6);
    370             emit(newMessage(msg.toAscii()));
     370            emit newMessage(msg.toAscii(), false);
    371371#endif
    372372
  • trunk/BNC/RTCM3/RTCM3Decoder.h

    r1218 r1299  
    4242  virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg);
    4343 signals:
    44   void newMessage(QByteArray msg);
     44  void newMessage(QByteArray msg,bool showOnScreen);
    4545  void newGPSEph(gpsephemeris* gpseph);
    4646  void newGlonassEph(glonassephemeris* glonasseph);
  • trunk/BNC/bnc.pro

    r1295 r1299  
    55###CONFIG += debug
    66
    7 ##DEFINES += NO_RTCM3_MAIN DEBUG_RTCM2_2021
    87DEFINES += NO_RTCM3_MAIN
     8###DEFINES += DEBUG_RTCM2_2021
    99
    1010RESOURCES += bnc.qrc
  • trunk/BNC/bncapp.cpp

    r1292 r1299  
    147147// Write a Program Message
    148148////////////////////////////////////////////////////////////////////////////
    149 void bncApp::slotMessage(const QByteArray msg) {
     149void bncApp::slotMessage(const QByteArray msg, bool showOnScreen) {
    150150
    151151  QMutexLocker locker(&_mutexMessage);
    152152
    153153  messagePrivate(msg);
    154   emit newMessage(msg);
     154  emit newMessage(msg, showOnScreen);
    155155}
    156156
     
    573573    _server = new QTcpServer;
    574574    if ( !_server->listen(QHostAddress::Any, _port) ) {
    575       slotMessage("bncApp: cannot listen on ephemeris port");
     575      slotMessage("bncApp: cannot listen on ephemeris port", true);
    576576    }
    577577    connect(_server, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
     
    589589    _serverCorr = new QTcpServer;
    590590    if ( !_serverCorr->listen(QHostAddress::Any, _portCorr) ) {
    591       slotMessage("bncApp: cannot listen on correction port");
     591      slotMessage("bncApp: cannot listen on correction port", true);
    592592    }
    593593    connect(_serverCorr, SIGNAL(newConnection()), this, SLOT(slotNewConnectionCorr()));
     
    646646                    _lastDumpCoSec - coTime + _waitCoTime);
    647647    messagePrivate(line.toAscii());
    648     emit( newMessage(line.toAscii()) );
     648    emit( newMessage(line.toAscii(), true) );
    649649    return;
    650650  }
  • trunk/BNC/bncapp.h

    r1291 r1299  
    4545    void setWaitCoTime(int waitCoTime) {_waitCoTime = waitCoTime;}
    4646  public slots:
    47     void slotMessage(const QByteArray msg);
     47    void slotMessage(const QByteArray msg, bool showOnScreen);
    4848    void slotNewGPSEph(gpsephemeris* gpseph);
    4949    void slotNewGlonassEph(glonassephemeris* glonasseph);
     
    5252
    5353  signals:
    54     void newMessage(QByteArray msg);
     54    void newMessage(QByteArray msg, bool showOnScreen);
    5555    void newEphGPS(gpsephemeris gpseph);
    5656    void newEphGlonass(glonassephemeris glonasseph);
  • trunk/BNC/bnccaster.cpp

    r1246 r1299  
    5454  QSettings settings;
    5555
    56   connect(this, SIGNAL(newMessage(QByteArray)),
    57           (bncApp*) qApp, SLOT(slotMessage(const QByteArray)));
     56  connect(this, SIGNAL(newMessage(QByteArray,bool)),
     57          (bncApp*) qApp, SLOT(slotMessage(const QByteArray,bool)));
    5858
    5959  if ( !outFileName.isEmpty() ) {
     
    8080    _server = new QTcpServer;
    8181    if ( !_server->listen(QHostAddress::Any, _port) ) {
    82       emit newMessage("bncCaster: cannot listen on sync port");
     82      emit newMessage("bncCaster: cannot listen on sync port", true);
    8383    }
    8484    connect(_server, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
     
    9494    _uServer = new QTcpServer;
    9595    if ( !_uServer->listen(QHostAddress::Any, uPort) ) {
    96       emit newMessage("bncCaster: cannot listen on usync port");
     96      emit newMessage("bncCaster: cannot listen on usync port", true);
    9797    }
    9898    connect(_uServer, SIGNAL(newConnection()), this, SLOT(slotNewUConnection()));
     
    196196           !settings.value("outPort").toString().isEmpty() ) {
    197197        emit( newMessage(QString("Station %1: old epoch %2 thrown away")
    198                                    .arg(staID.data()).arg(iSec).toAscii()) );
     198                                   .arg(staID.data()).arg(iSec).toAscii(), true) );
    199199      }
    200200    }
     
    220220  _sockets->push_back( _server->nextPendingConnection() );
    221221  emit( newMessage(QString("New Connection # %1")
    222                    .arg(_sockets->size()).toAscii()) );
     222                   .arg(_sockets->size()).toAscii(), true) );
    223223}
    224224
     
    226226  _uSockets->push_back( _uServer->nextPendingConnection() );
    227227  emit( newMessage(QString("New Connection (usync) # %1")
    228                    .arg(_uSockets->size()).toAscii()) );
     228                   .arg(_uSockets->size()).toAscii(), true) );
    229229}
    230230
     
    253253  _staIDs.removeAll(staID);
    254254  emit( newMessage(
    255            QString("Mountpoint size %1").arg(_staIDs.size()).toAscii()) );
     255           QString("Mountpoint size %1").arg(_staIDs.size()).toAscii(), true) );
    256256  if (_staIDs.size() == 0) {
    257     emit(newMessage("bncCaster:: last get thread terminated"));
     257    emit(newMessage("bncCaster:: last get thread terminated", true));
    258258    emit getThreadErrors();
    259259  }
     
    442442  emit mountPointsRead(_threads);
    443443  emit( newMessage(QString("Configuration read: %1 stream(s)")
    444                             .arg(_threads.count()).toAscii()) );
     444                            .arg(_threads.count()).toAscii(), true) );
    445445
    446446  // (Re-) Start the configuration timer
  • trunk/BNC/bnccaster.h

    r1222 r1299  
    5050   void mountPointsRead(QList<bncGetThread*>);
    5151   void getThreadErrors();   
    52    void newMessage(QByteArray msg);
     52   void newMessage(QByteArray msg, bool showOnScreen);
    5353
    5454 private slots:
  • trunk/BNC/bncgetthread.cpp

    r1298 r1299  
    111111     
    112112  bncApp* app = (bncApp*) qApp;
    113   app->connect(this, SIGNAL(newMessage(QByteArray)),
    114                app, SLOT(slotMessage(const QByteArray)));
     113  app->connect(this, SIGNAL(newMessage(QByteArray,bool)),
     114               app, SLOT(slotMessage(const QByteArray,bool)));
    115115
    116116  _decoder    = 0;
     
    406406        emit(newMessage((_staID + ": Caster Response: " + line +
    407407                         "          Adjust User-ID and Password Register, see"
    408                          "\n          " + reg).toAscii()));
     408                         "\n          " + reg).toAscii(), true));
    409409        return fatal;
    410410      }
    411411      if (line.indexOf("ICY 200 OK") != 0) {
    412         emit(newMessage((_staID + ": Wrong Caster Response:\n" + line).toAscii()));
     412        emit(newMessage((_staID + ": Wrong Caster Response:\n" + line).toAscii(), true));
    413413        return failure;
    414414      }
    415415    }
    416416    else {
    417       emit(newMessage(_staID + ": Response Timeout"));
     417      emit(newMessage(_staID + ": Response Timeout", true));
    418418      return failure;
    419419    }
     
    424424  if (!_decoder) {
    425425    if      (_format.indexOf("RTCM_2") != -1) {
    426       emit(newMessage("Get Data: " + _staID + " in RTCM 2.x format"));
     426      emit(newMessage("Get Data: " + _staID + " in RTCM 2.x format", true));
    427427      _decoder = new RTCM2Decoder(_staID.data());
    428428    }
    429429    else if (_format.indexOf("RTCM_3") != -1) {
    430       emit(newMessage("Get Data: " + _staID + " in RTCM 3.x format"));
     430      emit(newMessage("Get Data: " + _staID + " in RTCM 3.x format", true));
    431431      _decoder = new RTCM3Decoder(_staID);
    432       connect((RTCM3Decoder*) _decoder, SIGNAL(newMessage(QByteArray)),
    433               this, SIGNAL(newMessage(QByteArray)));
     432      connect((RTCM3Decoder*) _decoder, SIGNAL(newMessage(QByteArray,bool)),
     433              this, SIGNAL(newMessage(QByteArray,bool)));
    434434    }
    435435    else if (_format.indexOf("RTIGS") != -1) {
    436       emit(newMessage("Get Data: " + _staID + " in RTIGS format"));
     436      emit(newMessage("Get Data: " + _staID + " in RTIGS format", true));
    437437      _decoder = new RTIGSDecoder();
    438438    }
    439439    else if (_format.indexOf("ZERO") != -1) {
    440       emit(newMessage("Get Data: " + _staID + " in original format"));
     440      emit(newMessage("Get Data: " + _staID + " in original format", true));
    441441      _decoder = new bncZeroDecoder(_staID);
    442442    }
    443443    else {
    444       emit(newMessage(_staID + ": Unknown data format " + _format));
     444      emit(newMessage(_staID + ": Unknown data format " + _format, true));
    445445      if (_rawInpFile) {
    446446        cerr << "Uknown data format" << endl;
     
    491491  }
    492492  else if (irc != success) {
    493     emit(newMessage(_staID + ": initRun failed, reconnecting"));
     493    emit(newMessage(_staID + ": initRun failed, reconnecting", true));
    494494    tryReconnect();
    495495  }
     
    506506    try {
    507507      if (_socket && _socket->state() != QAbstractSocket::ConnectedState) {
    508         emit(newMessage(_staID + ": Socket not connected, reconnecting"));
     508        emit(newMessage(_staID + ": Socket not connected, reconnecting", true));
    509509        tryReconnect();
    510510      }
     
    553553#ifdef DEBUG_RTCM2_2021
    554554          for (unsigned ii = 0; ii < errmsg.size(); ii++) {
    555             emit newMessage(_staID + ": " + errmsg[ii].c_str());
     555            emit newMessage(_staID + ": " + errmsg[ii].c_str(), false);
    556556          }
    557557#endif
     
    574574#ifdef DEBUG_RTCM2_2021
    575575              for (unsigned ii = 0; ii < errmsg.size(); ii++) {
    576                 emit newMessage(_staID + ": " + errmsg[ii].c_str());
     576                emit newMessage(_staID + ": " + errmsg[ii].c_str(), false);
    577577              }
    578578#endif
     
    619619                _endDateCor = QDateTime::currentDateTime().addSecs(- _adviseReco * 60).toUTC().date().toString("yy-MM-dd");
    620620                _endTimeCor = QDateTime::currentDateTime().addSecs(- _adviseReco * 60).toUTC().time().toString("hh:mm:ss");
    621                 emit(newMessage((_staID + ": Recovery threshold exceeded, corruption ended " + _endDateCor + " " + _endTimeCor).toAscii()));
     621                emit(newMessage((_staID + ": Recovery threshold exceeded, corruption ended "
     622                                + _endDateCor + " " + _endTimeCor).toAscii(), true));
    622623                callScript(("End_Corrupted " + _endDateCor + " " + _endTimeCor + " Begin was " + _begDateCor + " " + _begTimeCor).toAscii());
    623624                endCorrupt = true;
     
    632633                  _begDateCor = _decodeSucc.toUTC().date().toString("yy-MM-dd");
    633634                  _begTimeCor = _decodeSucc.toUTC().time().toString("hh:mm:ss");
    634                   emit(newMessage((_staID + ": Failure threshold exceeded, corrupted since " + _begDateCor + " " + _begTimeCor).toAscii()));
     635                  emit(newMessage((_staID + ": Failure threshold exceeded, corrupted since "
     636                                  + _begDateCor + " " + _begTimeCor).toAscii(), true));
    635637                  callScript(("Begin_Corrupted " + _begDateCor + " " + _begTimeCor).toAscii());
    636638                  begCorrupt = true;
     
    653655            _endDateOut = QDateTime::currentDateTime().addSecs(- _adviseReco * 60).toUTC().date().toString("yy-MM-dd");
    654656            _endTimeOut = QDateTime::currentDateTime().addSecs(- _adviseReco * 60).toUTC().time().toString("hh:mm:ss");
    655             emit(newMessage((_staID + ": Recovery threshold exceeded, outage ended " + _endDateOut + " " + _endTimeOut).toAscii()));
     657            emit(newMessage((_staID + ": Recovery threshold exceeded, outage ended "
     658                            + _endDateOut + " " + _endTimeOut).toAscii(), true));
    656659            callScript(("End_Outage " + _endDateOut + " " + _endTimeOut + " Begin was " + _begDateOut + " " + _begTimeOut).toAscii());
    657660          }
     
    671674            for (int ii=0;ii<_decoder->_typeList.size();ii++) {
    672675              type =  QString("%1 ").arg(_decoder->_typeList[ii]);
    673               emit(newMessage(_staID + ": Received message type " + type.toAscii() ));
     676              emit(newMessage(_staID + ": Received message type " + type.toAscii(), true));
    674677            }
    675678          }
     
    681684            for (int ii=0;ii<_decoder->_antType.size();ii++) {
    682685              ant1 =  QString("%1 ").arg(_decoder->_antType[ii]);
    683               emit(newMessage(_staID + ": Antenna descriptor " + ant1.toAscii() ));
     686              emit(newMessage(_staID + ": Antenna descriptor " + ant1.toAscii(), true));
    684687            }
    685688          }
     
    697700              case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
    698701              }
    699               emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m"));
    700               emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m"));
    701               emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m"));
     702              emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));
     703              emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));
     704              emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));
    702705              if (_decoder->_antList[ii].height_f) {
    703706                QByteArray ant4 = QString("%1 ").arg(_decoder->_antList[ii].height,0,'f',4).toAscii();
    704                 emit(newMessage(_staID + ": Antenna height above marker "  + ant4 + "m"));
     707                emit(newMessage(_staID + ": Antenna height above marker "  + ant4 + "m", true));
    705708              }
    706709              emit(newAntCrd(_staID,
     
    752755            if (week != obs->_o.GPSWeek || dt > maxDt) {
    753756              if  (!wrongEpoch) {
    754                 emit( newMessage(_staID + ": Wrong observation epoch(s)") );
     757                emit( newMessage(_staID + ": Wrong observation epoch(s)", true) );
    755758                wrongEpoch = true;
    756759              }
     
    777780                          .arg(numLat)
    778781                          .arg(numGaps)
    779                           .toAscii()) );
     782                          .toAscii(), true) );
    780783                      } else {
    781784                        emit( newMessage(QString("%1: Mean latency %2 sec, min %3, max %4, rms %5, %6 epochs")
     
    786789                          .arg(int((sqrt((sumLatQ - sumLat * sumLat / numLat)/numLat))*100)/100.)
    787790                          .arg(numLat)
    788                           .toAscii()) );
     791                          .toAscii(), true) );
    789792                      }
    790793                    }
     
    882885      // ------------------
    883886      else {
    884         emit(newMessage(_staID + ": Data Timeout, reconnecting"));
     887        emit(newMessage(_staID + ": Data Timeout, reconnecting", true));
    885888        tryReconnect();
    886889      }
    887890    }
    888891    catch (const char* msg) {
    889       emit(newMessage(_staID + msg));
     892      emit(newMessage(_staID + msg, true));
    890893      tryReconnect();
    891894    }
     
    931934          _begDateOut = _decodeTime.toUTC().date().toString("yy-MM-dd");
    932935          _begTimeOut = _decodeTime.toUTC().time().toString("hh:mm:ss");
    933           emit(newMessage((_staID + ": Failure threshold exceeded, outage since " + _begDateOut + " " + _begTimeOut).toAscii()));
     936          emit(newMessage((_staID + ": Failure threshold exceeded, outage since "
     937                          + _begDateOut + " " + _begTimeOut).toAscii(), true));
    934938          callScript(("Begin_Outage " + _begDateOut + " " + _begTimeOut).toAscii());
    935939        }
     
    978982      }
    979983     
    980       emit(newMessage(msg.toAscii()));
     984      emit(newMessage(msg.toAscii(), false));
    981985#endif
    982986    }
  • trunk/BNC/bncgetthread.h

    r1271 r1299  
    6363   void newAntCrd(QByteArray staID, double xx, double yy, double zz, QByteArray antType);
    6464   void error(QByteArray staID);
    65    void newMessage(QByteArray msg);
     65   void newMessage(QByteArray msg, bool showOnScreen);
    6666
    6767 public slots:
  • trunk/BNC/bncmain.cpp

    r1282 r1299  
    180180    app.connect(caster, SIGNAL(getThreadErrors()), &app, SLOT(quit()));
    181181 
    182     ((bncApp*)qApp)->slotMessage("============ Start BNC ============");
     182    ((bncApp*)qApp)->slotMessage("============ Start BNC ============", true);
    183183
    184184    // Normal case - data from Internet
  • trunk/BNC/bncwindow.cpp

    r1292 r1299  
    6666  setWindowTitle(tr("BKG Ntrip Client (BNC) Version 1.7"));
    6767
    68   connect((bncApp*)qApp, SIGNAL(newMessage(QByteArray)),
    69            this, SLOT(slotWindowMessage(QByteArray)));
     68  connect((bncApp*)qApp, SIGNAL(newMessage(QByteArray,bool)),
     69           this, SLOT(slotWindowMessage(QByteArray,bool)));
    7070
    7171  // Create Actions
     
    681681////////////////////////////////////////////////////////////////////////////
    682682void bncWindow::slotGetThreadErrors() {
    683   ((bncApp*)qApp)->slotMessage("All Get Threads Terminated");
     683  ((bncApp*)qApp)->slotMessage("All Get Threads Terminated", true);
    684684  if (!_actStop->isEnabled()) {
    685685    _actGetData->setEnabled(true);
     
    708708           this, SLOT(slotMountPointsRead(QList<bncGetThread*>)));
    709709
    710   ((bncApp*)qApp)->slotMessage("============ Start BNC ============");
     710  ((bncApp*)qApp)->slotMessage("============ Start BNC ============", true);
    711711
    712712  _caster->slotReadMountPoints();
     
    758758// Display Program Messages
    759759////////////////////////////////////////////////////////////////////////////
    760 void bncWindow::slotWindowMessage(const QByteArray msg) {
     760void bncWindow::slotWindowMessage(const QByteArray msg, bool showOnScreen) {
    761761
    762762#ifdef DEBUG_RTCM2_2021 
     
    765765  const int maxBufferSize = 10000;
    766766#endif
     767
     768  if (! showOnScreen ) {
     769    return;
     770  }
    767771 
    768772  QString txt = _log->toPlainText() + "\n" +
  • trunk/BNC/bncwindow.h

    r1222 r1299  
    6161
    6262  private slots:
    63     void slotWindowMessage(const QByteArray msg);
     63    void slotWindowMessage(const QByteArray msg, bool showOnScreen);
    6464    void slotHelp();
    6565    void slotAbout();
Note: See TracChangeset for help on using the changeset viewer.