29 static std::unique_ptr<SimpleScope> simpleScope(
new SimpleScope());
73 return "Simple Scope";
83 char RAStr[64] = {0}, DecStr[64] = {0};
86 fs_sexa(RAStr, targetRA, 2, 3600);
87 fs_sexa(DecStr, targetDEC, 2, 3600);
93 LOGF_INFO(
"Slewing to RA: %s - DEC: %s", RAStr, DecStr);
112 static struct timeval ltv
120 double dt = 0, da_ra = 0, da_dec = 0, dx = 0, dy = 0;
124 gettimeofday(&tv,
nullptr);
126 if (ltv.tv_sec == 0 && ltv.tv_usec == 0)
129 dt = tv.tv_sec - ltv.tv_sec + (tv.tv_usec - ltv.tv_usec) / 1e6;
133 da_ra = SLEW_RATE * dt;
134 da_dec = SLEW_RATE * dt;
144 dx = targetRA - currentRA;
147 if (fabs(dx) * 15. <= da_ra)
160 dy = targetDEC - currentDEC;
163 if (fabs(dy) <= da_dec)
181 LOG_INFO(
"Telescope slew is complete. Tracking...");
189 char RAStr[64] = {0}, DecStr[64] = {0};
192 fs_sexa(RAStr, currentRA, 2, 3600);
193 fs_sexa(DecStr, currentDEC, 2, 3600);
195 DEBUGF(DBG_SCOPE,
"Current RA: %s Current DEC: %s", RAStr, DecStr);
void setSimulation(bool enable)
Toggle driver simulation status A driver can run in simulation mode if Simulation option is enabled b...
void addDebugControl()
Add Debug control to the driver.
TelescopeStatus TrackState
void SetTelescopeCapability(uint32_t cap, uint8_t slewRateCount)
SetTelescopeCapability sets the Telescope capabilities. All capabilities must be initialized.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
void NewRaDec(double ra, double dec)
The child class calls this function when it has updates.
bool Handshake() override
perform handshake with device to check communication
bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
const char * getDefaultName() override
bool Abort() override
Abort any telescope motion including tracking if possible.
bool initProperties() override
Called to initialize basic properties required all the time.
bool ReadScopeStatus() override
Read telescope status.
int fs_sexa(char *out, double a, int w, int fracbase)
Converts a sexagesimal number to a string. sprint the variable a in sexagesimal format into out[].
Implementations for common driver routines.
#define LOGF_INFO(fmt,...)
#define DEBUGF(priority, msg,...)
Construct a basic INDI telescope device that simulates GOTO commands.
static Logger & getInstance()
Method to get a reference to the object (i.e., Singleton) It is a static method.
int addDebugLevel(const char *debugLevelName, const char *LoggingLevelName)
Adds a new debugging level to the driver.