Changeset 2251 in ntrip for trunk


Ignore:
Timestamp:
Jan 16, 2010, 10:39:37 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnctime.cpp

    r2123 r2251  
    88
    99using namespace std;
     10
     11double djul(long jj, long mm, double tt) {
     12  long    ii, kk;
     13  double  djul ;
     14  if( mm <= 2 ) {
     15    jj = jj - 1;
     16    mm = mm + 12;
     17  } 
     18  ii   = jj/100;
     19  kk   = 2 - ii + ii/4;
     20  djul = (365.25*jj - fmod( 365.25*jj, 1.0 )) - 679006.0;
     21  djul = djul + floor( 30.6001*(mm + 1) ) + tt + kk;
     22  return djul;
     23}
    1024
    1125// Constructor
     
    174188}
    175189
     190
     191//
     192//////////////////////////////////////////////////////////////////////////////
     193bncTime& bncTime::set(int year, int month, int day,
     194                      int hour, int min, double sec) {
     195  return set(year, month, day, hour*3600 + min*60 + sec);
     196}
     197
     198//
     199//////////////////////////////////////////////////////////////////////////////
     200bncTime& bncTime::set(int year, int month, int day, double daysec) {
     201  _sec = daysec;
     202 
     203  _mjd = (unsigned int)djul(year, month, day);
     204 
     205  while ( _sec >= 86400 ) {
     206    _sec-=86400;
     207    _mjd++;
     208  }
     209  while ( _sec <  0 ) {
     210    _sec+=86400;
     211    _mjd--;
     212  }
     213
     214  return *this;
     215}
  • trunk/BNC/bnctime.h

    r2177 r2251  
    1111
    1212  bncTime& set(int gpsw, double gpssec);
     13  bncTime& set(int year, int month, int day, int hour, int min, double sec);
     14  bncTime& set(int year, int month, int day, double daysec);
    1315
    1416  unsigned int mjd()    const;
Note: See TracChangeset for help on using the changeset viewer.