summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-14 13:10:11 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-14 13:10:11 (GMT)
commit27f34e7dd50dfd1df8ac7626dc7b6cf678616061 (patch)
tree88b5d48c9e595edadb3e97acba3bf88ee9d05545
parentfd5be743f643e3ae087eb626c644a303bdc2244e (diff)
Use setDestination to center scope crosshairs
-rw-r--r--kstars/indi/inditelescope.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/kstars/indi/inditelescope.cpp b/kstars/indi/inditelescope.cpp
index 1efd3e7..96ed3c5 100644
--- a/kstars/indi/inditelescope.cpp
+++ b/kstars/indi/inditelescope.cpp
@@ -110,6 +110,7 @@ void Telescope::processNumber(INumberVectorProperty *nvp)
currentCoord.setRA(RA->value);
currentCoord.setDec(DEC->value);
+ currentCoord.EquatorialToHorizontal(KStars::Instance()->data()->lst(), KStars::Instance()->data()->geo()->lat());
KStars::Instance()->map()->update();
@@ -311,7 +312,7 @@ bool Telescope::runCommand(int command, void *ptr)
switch (command)
{
- case INDI_SEND_COORDS:
+ case INDI_SEND_COORDS:
if (ptr == NULL)
sendCoords(KStars::Instance()->map()->clickedPoint());
else
@@ -319,15 +320,19 @@ bool Telescope::runCommand(int command, void *ptr)
break;
+ case INDI_ENGAGE_TRACKING:
+ {
+ SkyPoint J2000Coord(currentCoord.ra(), currentCoord.dec());
+ J2000Coord.apparentCoord(KStars::Instance()->data()->ut().djd(), (long double) J2000);
+ currentCoord.setRA0(J2000Coord.ra());
+ currentCoord.setDec0(J2000Coord.dec());
+ KStars::Instance()->map()->setDestination(currentCoord);
+ }
+ break;
- case INDI_ENGAGE_TRACKING:
- KStars::Instance()->map()->setClickedPoint(&currentCoord);
- KStars::Instance()->map()->slotCenter();
- break;
-
- default:
- return DeviceDecorator::runCommand(command, ptr);
- break;
+ default:
+ return DeviceDecorator::runCommand(command, ptr);
+ break;
}