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


Ignore:
Timestamp:
Sep 13, 2014, 12:19:37 PM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r5996 r6137  
    5151#include "bncutils.h"
    5252#include "bncsettings.h"
    53 #include "GPSDecoder.h"
    5453
    5554using namespace std;
     
    113112  }
    114113
    115   _epochs = new QMultiMap<long, t_obs>;
     114  _epochs = new QMultiMap<long, t_satObs>;
    116115
    117116  _samplingRate = settings.value("binSampl").toInt();
     
    164163// New Observations
    165164////////////////////////////////////////////////////////////////////////////
    166 void bncCaster::slotNewObs(const QByteArray staID, QList<t_obs> obsList) {
     165void bncCaster::slotNewObs(const QByteArray staID, QList<t_satObs> obsList) {
    167166
    168167  QMutexLocker locker(&_mutex);
     
    171170
    172171  unsigned index = 0;
    173   QMutableListIterator<t_obs> it(obsList);
     172  QMutableListIterator<t_satObs> it(obsList);
    174173  while (it.hasNext()) {
    175174    ++index;
    176     t_obs& obs = it.next();
    177 
    178     long iSec    = long(floor(obs.GPSWeeks+0.5));
    179     long newTime = obs.GPSWeek * 7*24*3600 + iSec;
     175    t_satObs& obs = it.next();
     176
     177    long iSec    = long(floor(obs._time.gpssec()+0.5));
     178    long newTime = obs._time.gpsw() * 7*24*3600 + iSec;
    180179   
    181180    // Rename the Station
    182181    // ------------------
    183     strncpy(obs.StatID, staID.constData(),sizeof(obs.StatID));
    184     obs.StatID[sizeof(obs.StatID)-1] = '\0';
     182    obs._staID = staID.data();
    185183   
    186184    // Output into the socket
     
    190188      ostringstream oStr;
    191189      oStr.setf(ios::showpoint | ios::fixed);
    192       oStr << obs.StatID                                  << " "
    193            << setw(4)  << obs.GPSWeek                     << " "
    194            << setw(14) << setprecision(7) << obs.GPSWeeks << " "
     190      oStr << obs._staID                                        << " "
     191           << setw(4)  << obs._time.gpsw()                      << " "
     192           << setw(14) << setprecision(7) << obs._time.gpssec() << " "
    195193           << bncRinex::asciiSatLine(obs) << endl;
    196194   
     
    276274void bncCaster::addGetThread(bncGetThread* getThread, bool noNewThread) {
    277275
    278   qRegisterMetaType<t_obs>("t_obs");
    279   qRegisterMetaType< QList<t_obs> >("QList<t_obs>");
     276  qRegisterMetaType<t_satObs>("t_satObs");
     277  qRegisterMetaType< QList<t_satObs> >("QList<t_satObs>");
    280278  qRegisterMetaType<gpsephemeris>("gpsephemeris");
    281279  qRegisterMetaType<glonassephemeris>("glonassephemeris");
    282280  qRegisterMetaType<galileoephemeris>("galileoephemeris");
    283281
    284   connect(getThread, SIGNAL(newObs(QByteArray, QList<t_obs>)),
    285           this,      SLOT(slotNewObs(QByteArray, QList<t_obs>)));
    286 
    287   connect(getThread, SIGNAL(newObs(QByteArray, QList<t_obs>)),
    288           this,      SIGNAL(newObs(QByteArray, QList<t_obs>)));
     282  connect(getThread, SIGNAL(newObs(QByteArray, QList<t_satObs>)),
     283          this,      SLOT(slotNewObs(QByteArray, QList<t_satObs>)));
     284
     285  connect(getThread, SIGNAL(newObs(QByteArray, QList<t_satObs>)),
     286          this,      SIGNAL(newObs(QByteArray, QList<t_satObs>)));
    289287
    290288  connect(getThread, SIGNAL(newRawData(QByteArray, QByteArray)),
     
    336334         (_samplingRate == 0 || sec % _samplingRate == 0) ) {
    337335
    338       QList<t_obs> allObs = _epochs->values(sec);
     336      QList<t_satObs> allObs = _epochs->values(sec);
    339337     
    340       QListIterator<t_obs> it(allObs);
     338      QListIterator<t_satObs> it(allObs);
    341339      bool firstObs = true;
    342340      while (it.hasNext()) {
    343         const t_obs& obs = it.next();
     341        const t_satObs& obs = it.next();
    344342
    345343        ostringstream oStr;
     
    347345        if (firstObs) {
    348346          firstObs = false;
    349           oStr << "> " << obs.GPSWeek << ' '
    350                << setprecision(7) << obs.GPSWeeks << endl;;
     347          oStr << "> " << obs._time.gpsw() << ' '
     348               << setprecision(7) << obs._time.gpssec() << endl;;
    351349        }
    352         oStr << obs.StatID << ' ' << bncRinex::asciiSatLine(obs) << endl;
     350        oStr << obs._staID << ' ' << bncRinex::asciiSatLine(obs) << endl;
    353351        if (!it.hasNext()) {
    354352          oStr << endl;
Note: See TracChangeset for help on using the changeset viewer.