Changeset 6137 in ntrip for trunk/BNC/src/bnccaster.cpp
- Timestamp:
- Sep 13, 2014, 12:19:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnccaster.cpp
r5996 r6137 51 51 #include "bncutils.h" 52 52 #include "bncsettings.h" 53 #include "GPSDecoder.h"54 53 55 54 using namespace std; … … 113 112 } 114 113 115 _epochs = new QMultiMap<long, t_ obs>;114 _epochs = new QMultiMap<long, t_satObs>; 116 115 117 116 _samplingRate = settings.value("binSampl").toInt(); … … 164 163 // New Observations 165 164 //////////////////////////////////////////////////////////////////////////// 166 void bncCaster::slotNewObs(const QByteArray staID, QList<t_ obs> obsList) {165 void bncCaster::slotNewObs(const QByteArray staID, QList<t_satObs> obsList) { 167 166 168 167 QMutexLocker locker(&_mutex); … … 171 170 172 171 unsigned index = 0; 173 QMutableListIterator<t_ obs> it(obsList);172 QMutableListIterator<t_satObs> it(obsList); 174 173 while (it.hasNext()) { 175 174 ++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; 180 179 181 180 // Rename the Station 182 181 // ------------------ 183 strncpy(obs.StatID, staID.constData(),sizeof(obs.StatID)); 184 obs.StatID[sizeof(obs.StatID)-1] = '\0'; 182 obs._staID = staID.data(); 185 183 186 184 // Output into the socket … … 190 188 ostringstream oStr; 191 189 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() << " " 195 193 << bncRinex::asciiSatLine(obs) << endl; 196 194 … … 276 274 void bncCaster::addGetThread(bncGetThread* getThread, bool noNewThread) { 277 275 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>"); 280 278 qRegisterMetaType<gpsephemeris>("gpsephemeris"); 281 279 qRegisterMetaType<glonassephemeris>("glonassephemeris"); 282 280 qRegisterMetaType<galileoephemeris>("galileoephemeris"); 283 281 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>))); 289 287 290 288 connect(getThread, SIGNAL(newRawData(QByteArray, QByteArray)), … … 336 334 (_samplingRate == 0 || sec % _samplingRate == 0) ) { 337 335 338 QList<t_ obs> allObs = _epochs->values(sec);336 QList<t_satObs> allObs = _epochs->values(sec); 339 337 340 QListIterator<t_ obs> it(allObs);338 QListIterator<t_satObs> it(allObs); 341 339 bool firstObs = true; 342 340 while (it.hasNext()) { 343 const t_ obs& obs = it.next();341 const t_satObs& obs = it.next(); 344 342 345 343 ostringstream oStr; … … 347 345 if (firstObs) { 348 346 firstObs = false; 349 oStr << "> " << obs. GPSWeek<< ' '350 << setprecision(7) << obs. GPSWeeks<< endl;;347 oStr << "> " << obs._time.gpsw() << ' ' 348 << setprecision(7) << obs._time.gpssec() << endl;; 351 349 } 352 oStr << obs. StatID << ' ' << bncRinex::asciiSatLine(obs) << endl;350 oStr << obs._staID << ' ' << bncRinex::asciiSatLine(obs) << endl; 353 351 if (!it.hasNext()) { 354 352 oStr << endl;
Note:
See TracChangeset
for help on using the changeset viewer.