Changeset 8372 in ntrip for trunk/BNC/src/bnctime.cpp


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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.