summaryrefslogtreecommitdiffstats
path: root/indi-celestronaux/celestronaux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indi-celestronaux/celestronaux.cpp')
-rw-r--r--indi-celestronaux/celestronaux.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/indi-celestronaux/celestronaux.cpp b/indi-celestronaux/celestronaux.cpp
index 02534a6..a806fcd 100644
--- a/indi-celestronaux/celestronaux.cpp
+++ b/indi-celestronaux/celestronaux.cpp
@@ -32,6 +32,9 @@
#include <sys/ioctl.h>
#include <thread>
#include <chrono>
+extern "C" {
+#include <syslog.h>
+}
#include <alignment/DriverCommon.h>
#include "celestronaux.h"
@@ -77,6 +80,8 @@ CelestronAUX::CelestronAUX()
//Both communication available, Serial and network (tcp/ip).
setTelescopeConnection(CONNECTION_TCP | CONNECTION_SERIAL);
+
+ openlog("indi_celestron_aux",0,LOG_DAEMON);
}
/////////////////////////////////////////////////////////////////////////////////////
@@ -1452,6 +1457,8 @@ void CelestronAUX::TimerHit()
{
INDI::Telescope::TimerHit();
+syslog(LOG_ERR,"Timer hit state=%d",(int)TrackState);
+
switch (TrackState)
{
case SCOPE_SLEWING:
@@ -1572,6 +1579,10 @@ void CelestronAUX::TimerHit()
double ra2=ra1+delta;
double dec= m_SkyTrackingTarget.declination;
+
+
+/*
+
INDI::IEquatorialCoordinates m1;
if (!SkyToTelescopeEquatorial(ra1,dec,m1.rightascension,m1.declination)) {
m1.rightascension=ra1;
@@ -1588,19 +1599,47 @@ void CelestronAUX::TimerHit()
}
uint32_t e2[2];
CelestronAUX::RADEToEncoders(m2,e2[0],e2[1]);
+*/
+
+
+
+ TelescopeDirectionVector TDV;
+ INDI::IEquatorialCoordinates m1 { ra1, dec };
+
+ if (TransformCelestialToTelescope(ra1, dec, 0.0, TDV))
+ {
+ EquatorialCoordinatesFromTelescopeDirectionVector(TDV, m1);
+ }
+ uint32_t e1[2];
+ CelestronAUX::RADEToEncoders(m1,e1[0],e1[1]);
+
+ INDI::IEquatorialCoordinates m2 { ra2, dec };
+
+ if (TransformCelestialToTelescope(ra2, dec, 0.0, TDV))
+ {
+ EquatorialCoordinatesFromTelescopeDirectionVector(TDV, m2);
+ }
+ uint32_t e2[2];
+ CelestronAUX::RADEToEncoders(m2,e2[0],e2[1]);
double r_ra=(m2.rightascension-m1.rightascension)/delta;
double r_dec=(m2.declination-m1.declination)/delta;
+ syslog(LOG_ERR,"tracking vectors %.4e %.4e",r_ra,r_dec);
+
int d_a1=e2[0]-e1[0];
int d_a2=e2[1]-e1[1];
+ syslog(LOG_ERR,"tracking e vectors %d %d",d_a1,d_a2);
+
r_ra*=TRACKRATE_SIDEREAL;
- r_dec*=TRACKRATE_SIDEREAL;
+ r_dec*=TRACKRATE_SIDEREAL*(24./360.);
+ r_dec=0;
r_ra=std::abs(r_ra);
r_dec=std::abs(r_dec);
+ syslog(LOG_ERR,"tracking %.4e %.4e",r_ra,r_dec);
if (d_a1>0) r_ra=-r_ra;
if (d_a2>0) r_dec=-r_dec;
@@ -2183,6 +2222,9 @@ bool CelestronAUX::SetTrackRate(double raRate, double deRate)
/////////////////////////////////////////////////////////////////////////////
bool CelestronAUX::SetTrackMode(uint8_t mode)
{
+
+ return true;
+
if (mode == TRACK_SIDEREAL)
m_TrackRates[AXIS_AZ] = TRACKRATE_SIDEREAL;
else if (mode == TRACK_SOLAR)