Changeset 974 in ntrip


Ignore:
Timestamp:
Jul 26, 2008, 10:10:54 AM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/RTCM3coDecoder.cpp

    r971 r974  
    6868  _out = 0;
    6969
    70   connect(this, SIGNAL(newCorrLine(QString, QString)),
    71           (bncApp*) qApp, SLOT(slotNewCorrLine(QString, QString)));
     70  connect(this, SIGNAL(newCorrLine(QString, QString, long)),
     71          (bncApp*) qApp, SLOT(slotNewCorrLine(QString, QString, long)));
    7272}
    7373
     
    175175               _co.Sat[ii].Orbit.DeltaAlongTrack,
    176176               _co.Sat[ii].Orbit.DeltaCrossTrack);
    177         printLine(line);
     177        long coTime = GPSweek * 7*24*3600 + long(floor(GPSweeks+0.5));
     178        printLine(line, coTime);
    178179      }
    179180      for(int ii = CLOCKORBIT_NUMGPS;
     
    186187               _co.Sat[ii].Orbit.DeltaAlongTrack,
    187188               _co.Sat[ii].Orbit.DeltaCrossTrack);
    188         printLine(line);
     189        long coTime = GPSweek * 7*24*3600 + long(floor(GPSweeks+0.5));
     190        printLine(line, coTime);
    189191      }
    190192      _buffer = _buffer.substr(bytesused);
     
    202204//
    203205////////////////////////////////////////////////////////////////////////////
    204 void RTCM3coDecoder::printLine(const QString& line) {
     206void RTCM3coDecoder::printLine(const QString& line, long coTime) {
    205207  if (_out) {
    206208    *_out << line.toAscii().data() << endl;
     
    208210  }
    209211
    210   emit newCorrLine(line, _staID);
    211 }
     212  emit newCorrLine(line, _staID, coTime);
     213}
  • trunk/BNC/RTCM3/RTCM3coDecoder.h

    r971 r974  
    4545
    4646 signals:
    47   void newCorrLine(QString line, QString staID);
     47  void newCorrLine(QString line, QString staID, long coTime);
    4848
    4949 private:
    5050  void reopen();
    51   void printLine(const QString& line);
     51  void printLine(const QString& line, long coTime);
    5252
    5353  int                 _port;
  • trunk/BNC/bncapp.cpp

    r973 r974  
    597597//
    598598////////////////////////////////////////////////////////////////////////////
    599 void bncApp::slotNewCorrLine(QString line, QString staID) {
    600   if (_socketsCorr) {
    601     QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
    602     while (is.hasNext()) {
    603       QTcpSocket* sock = is.next();
    604       if (sock->state() == QAbstractSocket::ConnectedState) {
    605         if (sock->write(QString(line + " " + staID + "\n").toAscii()) == -1) {
    606           delete sock;
    607           is.remove();
    608         }
    609       }
    610       else if (sock->state() != QAbstractSocket::ConnectingState) {
     599void bncApp::slotNewCorrLine(QString line, QString staID, long coTime) {
     600
     601  QMutexLocker locker(&_mutex);
     602
     603  if (!_socketsCorr) {
     604    return;
     605  }
     606
     607  // First time, set the _lastDumpSec immediately
     608  // --------------------------------------------
     609  if (_lastDumpCoSec == 0) {
     610    _lastDumpCoSec = coTime - 1;
     611  }
     612
     613  QMutableListIterator<QTcpSocket*> is(*_socketsCorr);
     614  while (is.hasNext()) {
     615    QTcpSocket* sock = is.next();
     616    if (sock->state() == QAbstractSocket::ConnectedState) {
     617      if (sock->write(QString(line + " " + staID + "\n").toAscii()) == -1) {
    611618        delete sock;
    612619        is.remove();
    613620      }
    614621    }
    615   }
    616 }
     622    else if (sock->state() != QAbstractSocket::ConnectingState) {
     623      delete sock;
     624      is.remove();
     625    }
     626  }
     627}
  • trunk/BNC/bncapp.h

    r973 r974  
    4646    void slotNewGPSEph(gpsephemeris* gpseph);
    4747    void slotNewGlonassEph(glonassephemeris* glonasseph);
    48     void slotNewCorrLine(QString line, QString staID);
     48    void slotNewCorrLine(QString line, QString staID, long coTime);
    4949    void slotQuit();
    5050   
Note: See TracChangeset for help on using the changeset viewer.