Changeset 408 in ntrip


Ignore:
Timestamp:
Feb 26, 2007, 6:15:18 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnccaster.cpp

    r397 r408  
    9292  if (_waitTime < 1) {
    9393    _waitTime = 1;
    94   }
    95 
    96   if ( settings.value("rnxPath").toString().isEmpty() ) {
    97     _rinexWriters = 0;
    98   }
    99   else {
    100     _rinexWriters = new QMap<QString, bncRinex*>;
    10194  }
    10295
     
    123116  delete _sockets;
    124117  delete _epochs;
    125   delete _rinexWriters;
    126 }
    127 
    128 // Reconnecting
    129 ////////////////////////////////////////////////////////////////////////////
    130 void bncCaster::reconnecting(const QByteArray& staID) {
    131   QMutexLocker locker(&_mutex);
    132 
    133   if (_rinexWriters && _rinexWriters->find(staID) != _rinexWriters->end()) {
    134     bncRinex* rnx = _rinexWriters->find(staID).value();
    135     rnx->setReconnectFlag(true);
    136   }
    137118}
    138119
    139120// New Observations
    140121////////////////////////////////////////////////////////////////////////////
    141 void bncCaster::newObs(const QByteArray& staID, const QUrl& mountPoint,
    142                        bool firstObs, Observation* obs,
    143                        const QByteArray& format,
    144                        const QByteArray& latitude,
    145                        const QByteArray& longitude,
    146                        const QByteArray& nmea) {
     122void bncCaster::newObs(const QByteArray& staID, bool firstObs,
     123                       Observation* obs) {
    147124
    148125  QMutexLocker locker(&_mutex);
     
    157134  obs->StatID[sizeof(obs->StatID)-1] = '\0';
    158135       
    159   // Prepare RINEX Output
    160   // --------------------
    161   if (_rinexWriters) {
    162     if (_rinexWriters->find(obs->StatID) == _rinexWriters->end()) {
    163       _rinexWriters->insert(obs->StatID, new bncRinex(obs->StatID, mountPoint,
    164                                            format, latitude, longitude, nmea));
    165     }
    166     bncRinex* rnx = _rinexWriters->find(obs->StatID).value();
    167     if (_samplingRate == 0 || iSec % _samplingRate == 0) {
    168       rnx->deepCopy(obs);
    169     }
    170     rnx->dumpEpoch(_newTime);
    171   }
    172 
    173136  // First time, set the _lastDumpSec immediately
    174137  // --------------------------------------------
  • trunk/BNC/bnccaster.h

    r393 r408  
    3232
    3333#include "RTCM/GPSDecoder.h"
    34 #include "bncrinex.h"
    3534
    3635class bncGetThread;
     
    4443   void addGetThread(bncGetThread* getThread);
    4544   int  numStations() const {return _staIDs.size();}
    46    void newObs(const QByteArray& staID, const QUrl& mountPoint,
    47                bool firstObs, Observation* obs, const QByteArray& format,
    48                const QByteArray& latitude, const QByteArray& longitude,
    49                const QByteArray& nmea);
    50    void reconnecting(const QByteArray& staID);
     45   void newObs(const QByteArray& staID, bool firstObs, Observation* obs);
    5146
    5247 signals:
     
    7065   QList<QTcpSocket*>*            _sockets;
    7166   QList<QByteArray>              _staIDs;
    72    QMap<QString, bncRinex*>*      _rinexWriters;
    7367   QList<bncGetThread*>           _threads;
    7468   int                            _samplingRate;
  • trunk/BNC/bncgetthread.cpp

    r406 r408  
    5151#include "bncapp.h"
    5252#include "bncutils.h"
     53#include "bncrinex.h"
    5354
    5455#include "RTCM/RTCM2Decoder.h"
     
    100101    _staID = _staID.left(_staID.length()-1) + QString("%1").arg(num).toAscii();
    101102  }   
     103
     104  // RINEX writer
     105  // ------------
     106  _samplingRate = settings.value("rnxSampl").toInt();
     107  if ( settings.value("rnxPath").toString().isEmpty() ) {
     108    _rnx = 0;
     109  }
     110  else {
     111    _rnx = new bncRinex(_staID, mountPoint, format, latitude, longitude, nmea);
     112  }
     113
    102114  msleep(100); //sleep 0.1 sec
    103115}
     
    382394          emit newObs(_staID, *it);
    383395          bool firstObs = (it == _decoder->_obsList.begin());
    384           _global_caster->newObs(_staID, _mountPoint, firstObs, *it, _format, _latitude, _longitude, _nmea);
     396          _global_caster->newObs(_staID, firstObs, *it);
     397
     398          // RINEX Output
     399          // ------------
     400          if (_rnx) {
     401             long iSec    = long(floor((*it)->GPSWeeks+0.5));
     402             long newTime = (*it)->GPSWeek * 7*24*3600 + iSec;
     403            if (_samplingRate == 0 || iSec % _samplingRate == 0) {
     404              _rnx->deepCopy(*it);
     405            }
     406            _rnx->dumpEpoch(newTime);
     407          }
     408
    385409        }
    386410        _decoder->_obsList.clear();
     
    411435////////////////////////////////////////////////////////////////////////////
    412436void bncGetThread::tryReconnect() {
    413   _global_caster->reconnecting(_staID);
     437  if (_rnx) {
     438    _rnx->setReconnectFlag(true);
     439  }
    414440  while (1) {
    415441    delete _socket; _socket = 0;
  • trunk/BNC/bncgetthread.h

    r406 r408  
    3232#include "RTCM/GPSDecoder.h"
    3333#include "bncconst.h"
     34
     35class bncRinex;
    3436
    3537class bncGetThread : public QThread {
     
    7577   int         _iMount;
    7678   bool        _zeroDecoder;
     79   int         _samplingRate;
     80   bncRinex*   _rnx;
    7781};
    7882
  • trunk/BNC/bncrinex.cpp

    r391 r408  
    6161// Constructor
    6262////////////////////////////////////////////////////////////////////////////
    63 bncRinex::bncRinex(const char* StatID, const QUrl& mountPoint,
     63bncRinex::bncRinex(const QByteArray& statID, const QUrl& mountPoint,
    6464                   const QByteArray& format, const QByteArray& latitude,
    6565                   const QByteArray& longitude, const QByteArray& nmea) {
    66   _statID        = StatID;
     66  _statID        = statID;
    6767  _mountPoint    = mountPoint;
    6868  _format        = format.left(6);
  • trunk/BNC/bncrinex.h

    r369 r408  
    3838class bncRinex {
    3939 public:
    40    bncRinex(const char* StatID, const QUrl& mountPoint,
     40   bncRinex(const QByteArray& statID, const QUrl& mountPoint,
    4141            const QByteArray& format, const QByteArray& latitude,
    4242            const QByteArray& longitude, const QByteArray& nmea);
Note: See TracChangeset for help on using the changeset viewer.