Changeset 5648 in ntrip


Ignore:
Timestamp:
Feb 23, 2014, 6:08:38 PM (8 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
4 edited

Legend:

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

    r5647 r5648  
    301301          this,      SLOT(slotNewObs(QByteArray, QList<t_obs>)));
    302302
     303  connect(getThread, SIGNAL(newRawData(QByteArray, QByteArray)),
     304          this,      SLOT(slotNewRawData(QByteArray, QByteArray)));
     305
    303306#ifdef RTROVER_INTERFACE
    304307  if (_bncRtrover) {
     
    598601}
    599602
    600 //      // Output into the Miscellaneous socket // Georg
    601 //      // ------------------------------------
    602 //      if (_miscSockets && _miscMount != "ALL") {
    603 //        QMutableListIterator<QTcpSocket*> is(*_miscSockets);
    604 //        while (is.hasNext()) {
    605 //          QTcpSocket* sock = is.next();
    606 //          if (sock->state() == QAbstractSocket::ConnectedState) {
    607 //            if (myMiscWrite(sock, data, nBytes) != nBytes) {
    608 //              delete sock;
    609 //              is.remove();
    610 //            }       
    611 //          }       
    612 //          else if (sock->state() != QAbstractSocket::ConnectingState) {
    613 //            delete sock;
    614 //            is.remove();
    615 //          }       
     603// Output into the Miscellaneous socket // Georg
     604////////////////////////////////////////////////////////////////////////////
     605void bncCaster::slotNewRawData(QByteArray staID, QByteArray data) {
     606  if (_miscSockets && (_miscMount == "ALL" || _miscMount == staID)) {
     607    QMutableListIterator<QTcpSocket*> is(*_miscSockets);
     608    while (is.hasNext()) {
     609      QTcpSocket* sock = is.next();
     610      if (sock->state() == QAbstractSocket::ConnectedState) {
     611        sock->write(data);
     612//        if (myMiscWrite(sock, data, nBytes) != nBytes) {
     613//          delete sock;
     614//          is.remove();
    616615//        }       
    617 //      }
    618 
     616      }       
     617      else if (sock->state() != QAbstractSocket::ConnectingState) {
     618        delete sock;
     619        is.remove();
     620      }       
     621    }       
     622  }
     623}
    619624
    620625// New Connection // Georg
     
    625630                   .arg(_miscSockets->size()).toAscii(), true) );
    626631}
    627 
    628 // Write buffer // Georg
    629 ////////////////////////////////////////////////////////////////////////////
    630 int bncCaster::myMiscWrite(QTcpSocket* sock, const char* buf, int bufLen) {
    631   sock->write(buf, bufLen);
    632   for (int ii = 1; ii <= 10; ii++) {
    633     if (sock->waitForBytesWritten(10)) {  // wait 10 ms
    634       return bufLen;
    635     }
    636   }
    637   return -1;
    638 }
    639 
  • trunk/BNC/src/bnccaster.h

    r5647 r5648  
    4949 public slots:
    5050   void slotNewObs(QByteArray staID, QList<t_obs> obsList);
     51   void slotNewRawData(QByteArray staID, QByteArray data);
    5152   void slotNewNMEAstr(QByteArray str);
    5253   void slotNewMiscConnection();
     
    6768   void dumpEpochs(long minTime, long maxTime);
    6869   static int myWrite(QTcpSocket* sock, const char* buf, int bufLen);
    69    static int myMiscWrite(QTcpSocket* sock, const char* buf, int bufLen);
    7070   void reopenOutFile();
    7171
  • trunk/BNC/src/bncgetthread.cpp

    r5647 r5648  
    461461      else {
    462462        emit newBytes(_staID, nBytes);
     463        emit newRawData(_staID, data);
    463464      }
    464465
  • trunk/BNC/src/bncgetthread.h

    r5647 r5648  
    7777 signals:
    7878   void newBytes(QByteArray staID, double nbyte);
     79   void newRawData(QByteArray staID, QByteArray data);
    7980   void newLatency(QByteArray staID, double clate);
    8081   void newObs(QByteArray staID, QList<t_obs> obsList);
Note: See TracChangeset for help on using the changeset viewer.