Changeset 8372 in ntrip for trunk


Ignore:
Timestamp:
Jun 13, 2018, 2:37:07 PM (6 years ago)
Author:
stuerze
Message:

minor changes to allow 10 Hz observation data processing (latency checker) and resampling (RINEX files, feed engine)

Location:
trunk/BNC/src
Files:
5 edited

Legend:

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

    r6448 r8372  
    3535 * Created:    16-Dec-2011
    3636 *
    37  * Changes:   
     37 * Changes:
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    4545#include "bncsettings.h"
    4646#include "bncrinex.h"
     47#include "bncutils.h"
    4748
    4849using namespace std;
     
    6364//////////////////////////////////////////////////////////////////////////////
    6465void GPSDecoder::initRinex(const QByteArray& staID, const QUrl& mountPoint,
    65                            const QByteArray& latitude, 
     66                           const QByteArray& latitude,
    6667                           const QByteArray& longitude, const QByteArray& nmea,
    6768                           const QByteArray& ntripVersion) {
     
    7071  }
    7172  bncSettings settings;
    72   if ( !settings.value("rnxPath").toString().isEmpty() ) { 
    73     _rnx = new bncRinex(staID, mountPoint, latitude, longitude, 
     73  if ( !settings.value("rnxPath").toString().isEmpty() ) {
     74    _rnx = new bncRinex(staID, mountPoint, latitude, longitude,
    7475                        nmea, ntripVersion);
    7576  }
    76 } 
     77}
    7778
    7879// Write RINEX Epoch
     
    8081void GPSDecoder::dumpRinexEpoch(const t_satObs& obs, const QByteArray& format) {
    8182  if (_rnx) {
    82     long iSec    = long(floor(obs._time.gpssec()+0.5));
    83     if (_rnx->samplingRate() == 0 || iSec % _rnx->samplingRate() == 0) {
     83    int sec = int(nint(obs._time.gpssec()*10));
     84    if (_rnx->samplingRate() == 0 || sec % (_rnx->samplingRate()*10) == 0) {
    8485      _rnx->deepCopy(obs);
    8586    }
    8687    _rnx->dumpEpoch(format, obs._time);
    8788  }
    88 } 
     89}
    8990
    9091// Set RINEX Reconnect Flag
  • trunk/BNC/src/bnccaster.cpp

    r8127 r8372  
    303303    if (epoTime <= maxTime) {
    304304      const QList<t_satObs>& allObs = itEpo.value();
    305       int sec = int(nint(epoTime.gpssec()));
    306       if ( (_out || _sockets) && (_samplingRate == 0 || sec % _samplingRate == 0) ) {
    307 
     305      int sec = int(nint(epoTime.gpssec()*10));
     306      if ( (_out || _sockets) && (_samplingRate == 0 || sec % (_samplingRate*10) == 0) ) {
    308307        QListIterator<t_satObs> it(allObs);
    309308        bool firstObs = true;
  • trunk/BNC/src/bnctime.cpp

    r7138 r8372  
    1717  this->set(gpsw, gpssec);
    1818}
    19  
     19
    2020// Constructor (from ISO String yyyy-mm-ddThh:mm:ss)
    2121//////////////////////////////////////////////////////////////////////////////
     
    2424    QDateTime dt = QDateTime::fromString(isoString.c_str(), Qt::ISODate);
    2525    this->set(dt.date().year(), dt.date().month(), dt.date().day(),
    26               dt.time().hour(), dt.time().minute(), 
     26              dt.time().hour(), dt.time().minute(),
    2727              dt.time().second() + dt.time().msec()/1000.0);
    2828  }
     
    3232}
    3333
    34 // 
     34//
    3535//////////////////////////////////////////////////////////////////////////////
    3636bncTime& bncTime::set(int gpsw, double gpssec) {
    3737  int  deltad;
    3838  int  dow = 0;
    39   while ( gpssec >= 86400 ) {
    40     gpssec-=86400;
     39  while ( gpssec >= 86400.0 ) {
     40    gpssec-=86400.0;
    4141    dow++;
    4242  }
    43   while ( gpssec <  0 ) {
    44     gpssec+=86400;
     43  while ( gpssec <  0.0 ) {
     44    gpssec+=86400.0;
    4545    dow--;
    4646  }
     
    5959  gpssec += 14.0;
    6060  gpsw   += 1356.0;
    61   while ( gpssec >= 86400 ) {
    62     gpssec-=86400;
     61  while ( gpssec >= 86400.0 ) {
     62    gpssec-=86400.0;
    6363    dow++;
    6464  }
    65   while ( gpssec <  0 ) {
    66     gpssec+=86400;
     65  while ( gpssec <  0.0 ) {
     66    gpssec+=86400.0;
    6767    dow--;
    6868  }
     
    7373}
    7474
    75 // 
     75//
    7676//////////////////////////////////////////////////////////////////////////////
    7777bncTime &bncTime::set(int msec) {
     
    8585}
    8686
    87 // 
     87//
    8888//////////////////////////////////////////////////////////////////////////////
    8989bncTime &bncTime::setTOD(int msec) {
     
    108108}
    109109
    110 // 
     110//
    111111//////////////////////////////////////////////////////////////////////////////
    112112bncTime &bncTime::setTk(int msec) {
     
    122122}
    123123
    124 // 
     124//
    125125//////////////////////////////////////////////////////////////////////////////
    126126bncTime &bncTime::setBDS(int msec) {
     
    137137}
    138138
    139 // 
     139//
    140140//////////////////////////////////////////////////////////////////////////////
    141141bncTime& bncTime::setmjd(double daysec, int mjd) {
    142142  _sec = daysec;
    143143  _mjd = mjd;
    144   while ( _sec >= 86400 ) {
    145     _sec-=86400;
     144  while ( _sec >= 86400.0 ) {
     145    _sec-=86400.0;
    146146    _mjd++;
    147147  }
    148   while ( _sec <  0 ) {
    149     _sec+=86400;
     148  while ( _sec <  0.0 ) {
     149    _sec+=86400.0;
    150150    _mjd--;
    151151  }
     
    153153}
    154154
    155 // 
     155//
    156156//////////////////////////////////////////////////////////////////////////////
    157157bncTime& bncTime::setmjd(double mjddec) {
     
    161161}
    162162
    163 // 
     163//
    164164//////////////////////////////////////////////////////////////////////////////
    165165unsigned int bncTime::mjd() const {
    166166  return _mjd;
    167167}
    168  
     168
    169169//
    170170//////////////////////////////////////////////////////////////////////////////
     
    182182}
    183183
    184 // 
     184//
    185185//////////////////////////////////////////////////////////////////////////////
    186186double bncTime::gpssec() const {
     
    202202}
    203203
    204 // 
     204//
    205205//////////////////////////////////////////////////////////////////////////////
    206206double bncTime::bdssec() const {
     
    215215}
    216216
    217 // 
     217//
    218218//////////////////////////////////////////////////////////////////////////////
    219219bool bncTime::operator!=(const bncTime &time1) const {
     
    226226}
    227227
    228 // 
     228//
    229229//////////////////////////////////////////////////////////////////////////////
    230230bool bncTime::operator==(const bncTime &time1) const {
     
    237237}
    238238
    239 // 
     239//
    240240//////////////////////////////////////////////////////////////////////////////
    241241bool bncTime::operator>(const bncTime &time1) const {
     
    248248}
    249249
    250 // 
     250//
    251251//////////////////////////////////////////////////////////////////////////////
    252252bool bncTime::operator>=(const bncTime &time1) const {
     
    259259}
    260260
    261 // 
     261//
    262262//////////////////////////////////////////////////////////////////////////////
    263263bool bncTime::operator<(const bncTime &time1) const {
     
    270270}
    271271
    272 // 
     272//
    273273//////////////////////////////////////////////////////////////////////////////
    274274bool bncTime::operator<=(const bncTime &time1) const {
     
    281281}
    282282
    283 // 
     283//
    284284//////////////////////////////////////////////////////////////////////////////
    285285bncTime bncTime::operator+(double sec) const {
     
    290290}
    291291
    292 // 
     292//
    293293//////////////////////////////////////////////////////////////////////////////
    294294bncTime bncTime::operator-(double sec) const {
     
    296296}
    297297
    298 // 
     298//
    299299//////////////////////////////////////////////////////////////////////////////
    300300double bncTime::operator-(const bncTime &time1) const {
     
    323323}
    324324
    325 // 
     325//
    326326//////////////////////////////////////////////////////////////////////////////
    327327void bncTime::civil_date (unsigned int& year, unsigned int& month,
     
    335335}
    336336
    337 // 
    338 //////////////////////////////////////////////////////////////////////////////
    339 void bncTime::civil_time(unsigned int &hour, unsigned int &min, 
     337//
     338//////////////////////////////////////////////////////////////////////////////
     339void bncTime::civil_time(unsigned int &hour, unsigned int &min,
    340340                          double &sec) const {
    341341  hour = static_cast<unsigned int>(_sec/3600.0);
     
    352352}
    353353
    354 // 
     354//
    355355//////////////////////////////////////////////////////////////////////////////
    356356string bncTime::timestr(unsigned numdec, char sep) const {
     
    386386}
    387387
    388 // 
     388//
    389389//////////////////////////////////////////////////////////////////////////////
    390390string bncTime::datestr(char sep) const {
     
    402402}
    403403
    404 // 
     404//
    405405//////////////////////////////////////////////////////////////////////////////
    406406bncTime::operator std::string() const {
     
    408408}
    409409
    410 // 
    411 //////////////////////////////////////////////////////////////////////////////
    412 bncTime& bncTime::set(int year, int month, int day, 
     410//
     411//////////////////////////////////////////////////////////////////////////////
     412bncTime& bncTime::set(int year, int month, int day,
    413413                      int hour, int min, double sec) {
    414414  return set(year, month, day, hour*3600 + min*60 + sec);
    415415}
    416416
    417 // 
    418 //////////////////////////////////////////////////////////////////////////////
    419 bncTime& bncTime::setBDS(int year, int month, int day, 
     417//
     418//////////////////////////////////////////////////////////////////////////////
     419bncTime& bncTime::setBDS(int year, int month, int day,
    420420                      int hour, int min, double sec) {
    421421  return set(year, month, day, hour*3600 + min*60 + sec+14.0);
    422422}
    423423
    424 // 
     424//
    425425//////////////////////////////////////////////////////////////////////////////
    426426bncTime& bncTime::set(int year, int month, int day, double daysec) {
    427427  _sec = daysec;
    428  
     428
    429429  _mjd = (unsigned int)djul(year, month, day);
    430  
     430
    431431  while ( _sec >= 86400 ) {
    432432    _sec-=86400;
  • trunk/BNC/src/latencychecker.cpp

    r8271 r8372  
    327327      const t_satObs& obs = it.next();
    328328      bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time);
    329       l._newSec = static_cast<int>(obs._time.gpssec());
     329      l._newSec = static_cast<int>(nint(obs._time.gpssec()*10));
    330330      if (l._newSec > l._oldSec && !wrongObservationEpoch) {
    331         if (l._newSec % _miscIntr < l._oldSec % _miscIntr) {
     331        if (l._newSec % _miscIntr < l._oldSec % (_miscIntr * 10)) {
    332332          if (l._numLat > 0) {
    333333            if (l._meanDiff > 0.0) {
  • trunk/BNC/src/rinex/reqcedit.cpp

    r8368 r8372  
    337337        }
    338338
    339         if (_samplingRate == 0 ||
    340             fmod(round(epo->tt.gpssec()), _samplingRate) == 0) {
     339        int sec = int(nint(epo->tt.gpssec()*10));
     340        if (_samplingRate == 0 || sec % (_samplingRate*10) == 0) {
    341341          applyLLI(obsFile, epo);
    342342          outObsFile.writeEpoch(epo);
Note: See TracChangeset for help on using the changeset viewer.