summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-10-01 22:46:38 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-10-01 22:53:17 (GMT)
commit7cb8bdab107b30eb4bfae5d542220071806b9c72 (patch)
tree2b4909bae992013cbb27c4022b4fa1159df2527e
parent79fac9a3a3fad916a64a38ded9f351a615ef6576 (diff)
Show the correct epoch in Details Dialog, and also the correct coords.
Fixes a bug where the (RA, Dec) for simulation clock epoch was identical to the J2000 coordinates in the details dialog, if the object was not rendered on the screen. This is relevant, for example, when invoking the details dialog from places other than the sky map such as the Observation Planner. The corrections are as follows: 1. Call updateCoords() on the Sky Object with the current update KSNumbers. 2. Set the epoch from the coordinates that we are actually displaying, i.e. using lastPrecessJD. CCMAIL: mutlaqja@ikarustech.com BUG:
-rw-r--r--kstars/dialogs/detaildialog.cpp11
-rw-r--r--kstars/skyobjects/skypoint.cpp1
2 files changed, 7 insertions, 5 deletions
diff --git a/kstars/dialogs/detaildialog.cpp b/kstars/dialogs/detaildialog.cpp
index 3a0df9b..227ada4 100644
--- a/kstars/dialogs/detaildialog.cpp
+++ b/kstars/dialogs/detaildialog.cpp
@@ -210,7 +210,7 @@ void DetailDialog::createGeneralTab()
Data->Illumination->setText(QString("%1 %").arg(QLocale().toString(((KSMoon*)selectedObject)->illum()*100., 'f', 0)));
((KSMoon *)selectedObject)->updateMag();
}
-
+
// JM: Shouldn't we use the calculated magnitude? Disabling the following
/*
if(selectedObject->type() == SkyObject::COMET){
@@ -450,11 +450,12 @@ void DetailDialog::createPositionTab( const KStarsDateTime &ut, GeoLocation *geo
//Coordinates Section:
//Don't use KLocale::formatNumber() for the epoch string,
//because we don't want a thousands-place separator!
- QString sEpoch = QString::number( ut.epoch(), 'f', 1 );
+ selectedObject->updateCoords( data->updateNum(), true, data->geo()->lat(), data->lst(), false );
+ QString sEpoch = QString::number( KStarsDateTime::jdToEpoch( selectedObject->getLastPrecessJD() ), 'f', 1 );
//Replace the decimal point with localized decimal symbol
- sEpoch.replace( '.', QLocale().decimalPoint() );
-
- qDebug() << (selectedObject->deprecess(data->updateNum(),2451545.0l)).ra0().toHMSString() << (selectedObject->deprecess(data->updateNum(),2451545.0l)).dec0().toDMSString() << endl;
+ sEpoch.replace( '.', QLocale().decimalPoint() ); // Is this necessary? -- asimha Oct 2016
+
+ qDebug() << (selectedObject->deprecess(data->updateNum())).ra0().toHMSString() << (selectedObject->deprecess(data->updateNum())).dec0().toDMSString() << endl;
//qDebug() << selectedObject->ra().toHMSString() << selectedObject->dec().toDMSString() << endl;
Pos->RALabel->setText( i18n( "RA (%1):", sEpoch ) );
Pos->DecLabel->setText( i18n( "Dec (%1):", sEpoch ) );
diff --git a/kstars/skyobjects/skypoint.cpp b/kstars/skyobjects/skypoint.cpp
index 0b21b22..f20f984 100644
--- a/kstars/skyobjects/skypoint.cpp
+++ b/kstars/skyobjects/skypoint.cpp
@@ -885,4 +885,5 @@ double SkyPoint::minAlt(const dms& lat) const {
if ( retval < -90. )
retval = 180. + retval;
return retval;
+
}