Changeset 8717 in ntrip for branches


Ignore:
Timestamp:
May 2, 2019, 2:46:04 PM (5 years ago)
Author:
stuerze
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/bnctime.cpp

    r8418 r8717  
    1818  this->set(gpsw, gpssec);
    1919}
    20  
     20
    2121// Constructor (from ISO String yyyy-mm-ddThh:mm:ss)
    2222//////////////////////////////////////////////////////////////////////////////
     
    2525    QDateTime dt = QDateTime::fromString(isoString.c_str(), Qt::ISODate);
    2626    this->set(dt.date().year(), dt.date().month(), dt.date().day(),
    27               dt.time().hour(), dt.time().minute(), 
     27              dt.time().hour(), dt.time().minute(),
    2828              dt.time().second() + dt.time().msec()/1000.0);
    2929  }
     
    3333}
    3434
    35 // 
     35//
    3636//////////////////////////////////////////////////////////////////////////////
    3737bncTime& bncTime::set(int gpsw, double gpssec) {
     
    7474}
    7575
    76 // 
     76//
    7777//////////////////////////////////////////////////////////////////////////////
    7878bncTime &bncTime::set(int msec) {
     
    8686}
    8787
    88 // 
     88//
    8989//////////////////////////////////////////////////////////////////////////////
    9090bncTime &bncTime::setTOD(int msec) {
     
    109109}
    110110
    111 // 
     111//
    112112//////////////////////////////////////////////////////////////////////////////
    113113bncTime &bncTime::setTk(int msec) {
     
    123123}
    124124
    125 // 
     125//
    126126//////////////////////////////////////////////////////////////////////////////
    127127bncTime &bncTime::setBDS(int msec) {
     
    138138  return set(week, double(msec/1000.0));
    139139}
    140 // 
     140//
    141141//////////////////////////////////////////////////////////////////////////////
    142142bncTime& bncTime::setmjd(double daysec, int mjd) {
     
    154154}
    155155
    156 // 
     156//
    157157//////////////////////////////////////////////////////////////////////////////
    158158bncTime& bncTime::setmjd(double mjddec) {
     
    162162}
    163163
    164 // 
     164//
    165165//////////////////////////////////////////////////////////////////////////////
    166166unsigned int bncTime::mjd() const {
    167167  return _mjd;
    168168}
    169  
     169
    170170//
    171171//////////////////////////////////////////////////////////////////////////////
     
    183183}
    184184
    185 // 
     185//
    186186//////////////////////////////////////////////////////////////////////////////
    187187double bncTime::gpssec() const {
     
    203203}
    204204
    205 // 
     205//
    206206//////////////////////////////////////////////////////////////////////////////
    207207double bncTime::bdssec() const {
     
    216216}
    217217
    218 // 
     218//
    219219//////////////////////////////////////////////////////////////////////////////
    220220bool bncTime::operator!=(const bncTime &time1) const {
     
    227227}
    228228
    229 // 
     229//
    230230//////////////////////////////////////////////////////////////////////////////
    231231bool bncTime::operator==(const bncTime &time1) const {
     
    238238}
    239239
    240 // 
     240//
    241241//////////////////////////////////////////////////////////////////////////////
    242242bool bncTime::operator>(const bncTime &time1) const {
     
    249249}
    250250
    251 // 
     251//
    252252//////////////////////////////////////////////////////////////////////////////
    253253bool bncTime::operator>=(const bncTime &time1) const {
     
    260260}
    261261
    262 // 
     262//
    263263//////////////////////////////////////////////////////////////////////////////
    264264bool bncTime::operator<(const bncTime &time1) const {
     
    271271}
    272272
    273 // 
     273//
    274274//////////////////////////////////////////////////////////////////////////////
    275275bool bncTime::operator<=(const bncTime &time1) const {
     
    282282}
    283283
    284 // 
     284//
    285285//////////////////////////////////////////////////////////////////////////////
    286286bncTime bncTime::operator+(double sec) const {
     
    291291}
    292292
    293 // 
     293//
    294294//////////////////////////////////////////////////////////////////////////////
    295295bncTime bncTime::operator-(double sec) const {
     
    297297}
    298298
    299 // 
     299//
    300300//////////////////////////////////////////////////////////////////////////////
    301301double bncTime::operator-(const bncTime &time1) const {
     
    312312  _sec+=sec;
    313313
    314   while ( _sec >= 86400 ) {
    315     _sec-=86400;
     314  while ( _sec >= 86400.0 ) {
     315    _sec-=86400.0;
    316316    _mjd++;
    317317  }
    318   while ( _sec < 0 ) {
    319     _sec+=86400;
     318  while ( _sec < 0.0 ) {
     319    _sec+=86400.0;
    320320    _mjd--;
    321321  }
     
    324324}
    325325
    326 // 
     326//
    327327//////////////////////////////////////////////////////////////////////////////
    328328void bncTime::civil_date (unsigned int& year, unsigned int& month,
     
    336336}
    337337
    338 // 
    339 //////////////////////////////////////////////////////////////////////////////
    340 void bncTime::civil_time(unsigned int &hour, unsigned int &min, 
     338//
     339//////////////////////////////////////////////////////////////////////////////
     340void bncTime::civil_time(unsigned int &hour, unsigned int &min,
    341341                          double &sec) const {
    342342  hour = static_cast<unsigned int>(_sec/3600.0);
     
    353353}
    354354
    355 // 
     355//
    356356//////////////////////////////////////////////////////////////////////////////
    357357string bncTime::timestr(unsigned numdec, char sep) const {
     
    387387}
    388388
    389 // 
     389//
    390390//////////////////////////////////////////////////////////////////////////////
    391391string bncTime::datestr(char sep) const {
     
    403403}
    404404
    405 // 
     405//
    406406//////////////////////////////////////////////////////////////////////////////
    407407bncTime::operator std::string() const {
     
    409409}
    410410
    411 // 
    412 //////////////////////////////////////////////////////////////////////////////
    413 bncTime& bncTime::set(int year, int month, int day, 
     411//
     412//////////////////////////////////////////////////////////////////////////////
     413bncTime& bncTime::set(int year, int month, int day,
    414414                      int hour, int min, double sec) {
    415415  return set(year, month, day, hour*3600 + min*60 + sec);
    416416}
    417417
    418 // 
    419 //////////////////////////////////////////////////////////////////////////////
    420 bncTime& bncTime::setBDS(int year, int month, int day, 
     418//
     419//////////////////////////////////////////////////////////////////////////////
     420bncTime& bncTime::setBDS(int year, int month, int day,
    421421                      int hour, int min, double sec) {
    422422  return set(year, month, day, hour*3600 + min*60 + sec+14.0);
    423423}
    424424
    425 // 
     425//
    426426//////////////////////////////////////////////////////////////////////////////
    427427bncTime& bncTime::set(int year, int month, int day, double daysec) {
    428428  _sec = daysec;
    429  
     429
    430430  _mjd = (unsigned int)djul(year, month, day);
    431  
     431
    432432  while ( _sec >= 86400 ) {
    433433    _sec-=86400;
Note: See TracChangeset for help on using the changeset viewer.