本文整理汇总了C++中KStarsDateTime::addSecs方法的典型用法代码示例。如果您正苦于以下问题:C++ KStarsDateTime::addSecs方法的具体用法?C++ KStarsDateTime::addSecs怎么用?C++ KStarsDateTime::addSecs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KStarsDateTime
的用法示例。
在下文中一共展示了KStarsDateTime::addSecs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transitTimeUT
QTime SkyObject::transitTimeUT( const KStarsDateTime &dt, const GeoLocation *geo ) {
dms LST = geo->GSTtoLST( dt.gst() );
//dSec is the number of seconds until the object transits.
dms HourAngle = dms( LST.Degrees() - ra()->Degrees() );
int dSec = int( -3600.*HourAngle.Hours() );
//dt0 is the first guess at the transit time.
KStarsDateTime dt0 = dt.addSecs( dSec );
//recompute object's position at UT0 and then find
//transit time of this refined position
SkyPoint sp = recomputeCoords( dt0, geo );
const dms *ram = sp.ra0();
HourAngle = dms ( LST.Degrees() - ram->Degrees() );
dSec = int( -3600.*HourAngle.Hours() );
return dt.addSecs( dSec ).time();
}
示例2: riseSetTime
QTime SkyObject::riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst ) {
//this object does not rise or set; return an invalid time
if ( checkCircumpolar(geo->lat()) )
return QTime( 25, 0, 0 );
//First of all, if the object is below the horizon at date/time dt, adjust the time
//to bring it above the horizon
KStarsDateTime dt2 = dt;
SkyPoint p = recomputeCoords( dt, geo );
p.EquatorialToHorizontal( &(geo->GSTtoLST( dt.gst() )), geo->lat() );
if ( p.alt()->Degrees() < 0.0 ) {
if ( p.az()->Degrees() < 180.0 ) { //object has not risen yet
dt2 = dt.addSecs( 12.*3600. );
} else { //object has already set
dt2 = dt.addSecs( -12.*3600. );
}
}
return geo->UTtoLT( KStarsDateTime( dt2.date(), riseSetTimeUT( dt2, geo, rst ) ) ).time();
}
示例3: timeTransformed
SkyPoint SkyPoint::timeTransformed( const SkyPoint *p, const KStarsDateTime &dt, const GeoLocation *geo, const double hour ) {
Q_ASSERT( p );
if( !p )
return SkyPoint( NaN::d, NaN::d );
// Jasem 2015-08-24 Using correct procedure to find altitude
SkyPoint sp = *p; // make a copy
KStarsDateTime targetDateTime = dt.addSecs( hour * 3600.0 );
dms LST = geo->GSTtoLST( targetDateTime.gst() );
sp.EquatorialToHorizontal( &LST, geo->lat() );
return sp;
}