本文整理汇总了C++中DayTime::MJD方法的典型用法代码示例。如果您正苦于以下问题:C++ DayTime::MJD方法的具体用法?C++ DayTime::MJD怎么用?C++ DayTime::MJD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DayTime
的用法示例。
在下文中一共展示了DayTime::MJD方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testRandomAccessors
bool testRandomAccessors(DayTime &dtb, DayTime &dte, long ndates)
{
bool cumulativeResult=true;
// Seed the random number generator
gpstk::DayTime dt;
unsigned int seed= (unsigned int) dt.GPSsow();
srand(seed);
unsigned long dayDiff = (unsigned long)
ceil(dte.MJD() - dtb.MJD());
for (int j=0;j<ndates;++j) // Loop through set of random days
{
double dayDelta = floor( rand()*1./ RAND_MAX * dayDiff);
double sodDelta = rand()*1./RAND_MAX;
gpstk::DayTime testDate;
testDate.setMJD(dtb.MJD()+dayDelta+sodDelta);
short year = testDate.year();
short month = testDate.month();
short dom = testDate.day();
short hour = testDate.hour();
short minute = testDate.minute();
double seconds = testDate.second();
short doy = testDate.DOY();
double sod = testDate.DOYsecond();
short week = testDate.GPSfullweek()%1024;
double sow = testDate.GPSsow();
long zcount = testDate.GPSzcount();
short hintYear = testDate.year();
double MJD = testDate.MJD();
cumulativeResult = cumulativeResult &&
testMutators( year, month, dom, hour, minute, seconds,
doy, sod,
week, sow, zcount, hintYear,
MJD );
} // End loop over random dates
return cumulativeResult;
}
示例2: edit
/** Edit the store by deleting all entries before(after)
* the given min(max) times. If tmin is later than tmax,
* the two times are switched.
* @param tmin DayTime desired earliest store time.
* @param tmax DayTime desired latest store time.
*/
void edit(const DayTime& tmin,
const DayTime& tmax)
throw()
{ edit(int(tmin.MJD()+0.5),int(tmax.MJD()+1.5)); }