Changeset 7681 in ntrip for trunk/BNC/src/bnccaster.cpp


Ignore:
Timestamp:
Jan 12, 2016, 12:46:13 PM (8 years ago)
Author:
stuerze
Message:

minor changes

File:
1 edited

Legend:

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

    r7386 r7681  
    3535 * Created:    24-Dec-2005
    3636 *
    37  * Changes:   
     37 * Changes:
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    6060  bncSettings settings;
    6161
    62   connect(this, SIGNAL(newMessage(QByteArray,bool)), 
     62  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    6363          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
    6464
     
    159159    // ------------------
    160160    obs._staID = staID.data();
    161    
     161
    162162    // Output into the socket
    163163    // ----------------------
    164164    if (_uSockets) {
    165    
     165
    166166      ostringstream oStr;
    167167      oStr.setf(ios::showpoint | ios::fixed);
    168       oStr << obs._staID                                        << " " 
     168      oStr << obs._staID                                        << " "
    169169           << setw(4)  << obs._time.gpsw()                      << " "
    170170           << setw(14) << setprecision(7) << obs._time.gpssec() << " "
    171171           << bncRinex::asciiSatLine(obs) << endl;
    172    
     172
    173173      string hlpStr = oStr.str();
    174    
     174
    175175      QMutableListIterator<QTcpSocket*> is(*_uSockets);
    176176      while (is.hasNext()) {
     
    189189      }
    190190    }
    191    
     191
    192192    // First time: set the _lastDumpTime
    193193    // ---------------------------------
     
    195195      _lastDumpTime = obs._time - 1.0;
    196196    }
    197    
     197
    198198    // An old observation - throw it away
    199199    // ----------------------------------
     
    201201      if (index == 1) {
    202202        bncSettings settings;
    203         if ( !settings.value("outFile").toString().isEmpty() || 
    204              !settings.value("outPort").toString().isEmpty() ) { 
     203        if ( !settings.value("outFile").toString().isEmpty() ||
     204             !settings.value("outPort").toString().isEmpty() ) {
    205205          emit( newMessage(QString("%1: Old epoch %2 thrown away")
    206206                           .arg(staID.data()).arg(string(obs._time).c_str())
     
    210210      continue;
    211211    }
    212    
     212
    213213    // Save the observation
    214214    // --------------------
    215     _epochs[obs._time].push_back(obs);
     215    _epochs[obs._time].append(obs);
    216216
    217217    // Dump Epochs
     
    254254          this,      SLOT(slotNewRawData(QByteArray, QByteArray)));
    255255
    256   connect(getThread, SIGNAL(getThreadFinished(QByteArray)), 
     256  connect(getThread, SIGNAL(getThreadFinished(QByteArray)),
    257257          this, SLOT(slotGetThreadFinished(QByteArray)));
    258258
     
    302302      int sec = int(nint(epoTime.gpssec()));
    303303      if ( (_out || _sockets) && (_samplingRate == 0 || sec % _samplingRate == 0) ) {
    304      
     304
    305305        QListIterator<t_satObs> it(allObs);
    306306        bool firstObs = true;
    307307        while (it.hasNext()) {
    308308          const t_satObs& obs = it.next();
    309        
     309
    310310          ostringstream oStr;
    311311          oStr.setf(ios::showpoint | ios::fixed);
    312           if (firstObs) { 
     312          if (firstObs) {
    313313            firstObs = false;
    314             oStr << "> " << obs._time.gpsw() << ' ' 
     314            oStr << "> " << obs._time.gpsw() << ' '
    315315                 << setprecision(7) << obs._time.gpssec() << endl;
    316316          }
    317317          oStr << obs._staID << ' ' << bncRinex::asciiSatLine(obs) << endl;
    318           if (!it.hasNext()) { 
     318          if (!it.hasNext()) {
    319319            oStr << endl;
    320320          }
    321321          string hlpStr = oStr.str();
    322        
     322
    323323          // Output into the File
    324324          // --------------------
     
    327327            _out->flush();
    328328          }
    329        
     329
    330330          // Output into the socket
    331331          // ----------------------
     
    335335              QTcpSocket* sock = is.next();
    336336              if (sock->state() == QAbstractSocket::ConnectedState) {
    337                 int numBytes = hlpStr.length(); 
     337                int numBytes = hlpStr.length();
    338338                if (myWrite(sock, hlpStr.c_str(), numBytes) != numBytes) {
    339339                  delete sock;
     
    408408      QByteArray nmea      = hlp[5].toAscii();
    409409      QByteArray ntripVersion = hlp[6].toAscii();
    410      
    411       bncGetThread* getThread = new bncGetThread(url, format, latitude, 
     410
     411      bncGetThread* getThread = new bncGetThread(url, format, latitude,
    412412                                        longitude, nmea, ntripVersion);
    413413      addGetThread(getThread);
     
    486486}
    487487
    488 // 
     488//
    489489////////////////////////////////////////////////////////////////////////////
    490490int bncCaster::myWrite(QTcpSocket* sock, const char* buf, int bufLen) {
     
    498498}
    499499
    500 // 
     500//
    501501////////////////////////////////////////////////////////////////////////////
    502502void bncCaster::reopenOutFile() {
     
    510510      delete _out;
    511511      delete _outFile;
    512       _outFile = new QFile(outFileName); 
     512      _outFile = new QFile(outFileName);
    513513      if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
    514514        _outFile->open(QIODevice::WriteOnly | QIODevice::Append);
     
    536536      if (sock->state() == QAbstractSocket::ConnectedState) {
    537537        sock->write(data);
    538       }       
     538      }
    539539      else if (sock->state() != QAbstractSocket::ConnectingState) {
    540540        delete sock;
    541541        is.remove();
    542       }       
    543     }       
    544   } 
     542      }
     543    }
     544  }
    545545}
    546546
Note: See TracChangeset for help on using the changeset viewer.