Commit 2983511a authored by Jason Harris's avatar Jason Harris

Backported fix from HEAD:

Improved determination of the time that an object sets or
transits.  If the transit or set time is before the object's rise time,
then it is recomputed for the following day.  These times appear in the
popup menu, and in the details dialog.

CCMAIL: bab@debian.org

svn path=/branches/debian_branch/kdeedu/kstars/; revision=259000
parent 3af186a2
......@@ -173,14 +173,22 @@ DetailDialog::RiseSetBox::RiseSetBox( SkyObject *o, QDateTime lt, GeoLocation *g
QTime LST = KSUtils::UTtoLST( ut, geo->lng() );
dms LSTd; LSTd.setH( LST.hour(), LST.minute(), LST.second() );
QTime rt = o->riseTime( jd, geo );
//QTime tt = o->transitTime( lt, LSTd );
dms raz = o->riseSetTimeAz(jd, geo, true ); //true = use rise time
//If transit time is before rise time, use transit time for tomorrow
QTime tt = o->transitTime( jd, geo );
dms talt = o->transitAltitude( jd, geo );
if ( tt < rt ) {
tt = o->transitTime( jd+1.0, geo );
talt = o->transitAltitude( jd+1.0, geo );
}
//If set time is before rise time, use transit time for tomorrow
QTime st = o->setTime( jd, geo );
dms raz = o->riseSetTimeAz(jd, geo, true ); //true = use rise time
dms saz = o->riseSetTimeAz(jd, geo, false ); //false = use set time
//dms talt = o->transitAltitude( geo );
dms talt = o->transitAltitude( jd, geo );
if ( st < rt ) {
st = o->setTime( jd+1.0, geo );
saz = o->riseSetTimeAz(jd+1.0, geo, false ); //false = use set time
}
RTimeLabel = new QLabel( i18n( "Rise time:" ), this );
TTimeLabel = new QLabel( i18n( "Transit time:" ), this );
......
......@@ -1029,7 +1029,11 @@ void SkyMap::setRiseSetLabels( void ) {
rt = i18n( "No rise time: Never rises" );
}
//If stime is before rtime, use set time from tomorrow
QTime stime = clickedObject()->setTime( ksw->data()->CurrentDate, ksw->geo() );
if ( stime < rtime )
stime = clickedObject()->setTime( ksw->data()->CurrentDate+1.0, ksw->geo() );
QString st, st2, st3;
dms sAz = clickedObject()->riseSetTimeAz(ksw->data()->CurrentDate, ksw->geo(), false );
if ( stime.isValid() ) {
......@@ -1053,7 +1057,12 @@ void SkyMap::setRiseSetLabels( void ) {
}
//QTime ttime = clickedObject()->transitTime( ksw->data()->LTime, ksw->data()->LSTh );
//If transit time is before rise time, use transit time for tomorrow
QTime ttime = clickedObject()->transitTime( ksw->data()->CurrentDate, ksw->geo() );
if ( ttime < rtime )
ttime = clickedObject()->transitTime( ksw->data()->CurrentDate+1.0, ksw->geo() );
QString tt, tt2, tt3;
dms trAlt = clickedObject()->transitAltitude( ksw->data()->CurrentDate, ksw->geo() );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment