25#include <libnova/transform.h>
153 return "Astro-Electronic FS-2";
183 char AzStr[16], AltStr[16];
184 fs_sexa(AzStr, parkAz, 2, 3600);
185 fs_sexa(AltStr, parkAlt, 2, 3600);
186 LOGF_DEBUG(
"Parking to Az (%s) Alt (%s)...", AzStr, AltStr);
192 char RAStr[16], DEStr[16];
193 fs_sexa(RAStr, equatorialCoords.rightascension, 2, 3600);
194 fs_sexa(DEStr, equatorialCoords.declination, 2, 3600);
195 LOGF_DEBUG(
"Parking to RA (%s) DEC (%s)...", RAStr, DEStr);
197 if (
Goto(equatorialCoords.rightascension, equatorialCoords.declination))
200 LOG_INFO(
"Parking is in progress...");
271 LOG_INFO(
"Mount at park position. Tracking stopping.");
279 LOG_INFO(
"Mount is parked, motors stopped.");
294 LOG_INFO(
"Mount is unparked, restoring slew rate.");
317 char AzStr[16], AltStr[16];
318 fs_sexa(AzStr, parkAz, 2, 3600);
319 fs_sexa(AltStr, parkAlt, 2, 3600);
320 LOGF_DEBUG(
"Unparking from Az (%s) Alt (%s)...", AzStr, AltStr);
326 char RAStr[16], DEStr[16];
327 fs_sexa(RAStr, equatorialCoords.rightascension, 2, 3600);
328 fs_sexa(DEStr, equatorialCoords.declination, 2, 3600);
329 LOGF_DEBUG(
"Syncing to parked coordinates RA (%s) DEC (%s)...", RAStr, DEStr);
331 if (
Sync(equatorialCoords.rightascension, equatorialCoords.declination))
349 double parkAZ = horizontalCoords.azimuth;
350 double parkAlt = horizontalCoords.altitude;
351 char AzStr[16], AltStr[16];
352 fs_sexa(AzStr, parkAZ, 2, 3600);
353 fs_sexa(AltStr, parkAlt, 2, 3600);
354 LOGF_DEBUG(
"Setting current parking position to coordinates Az (%s) Alt (%s)...", AzStr, AltStr);
383 char RAStr[64], DecStr[64];
402 LOGF_ERROR(
"Error Slewing to JNow RA %s - DEC %s\n", RAStr, DecStr);
412 LOGF_INFO(
"Slewing to RA: %s - DEC: %s", RAStr, DecStr);
423 LOG_ERROR(
"Error setting RA/DEC. Unable to Sync.");
428 char syncString[256];
441 LOG_INFO(
"Synchronization successful.");
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
virtual bool deleteProperty(const char *propertyName)
Delete a property and unregister it. It will also be deleted from all clients.
void defineProperty(INumberVectorProperty *property)
bool isSimulation() const
void setState(IPState state)
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
int findOnSwitchIndex() const
TelescopeStatus TrackState
void SetAxis1Park(double value)
SetRAPark Set current RA/AZ parking position. The data park file (stored in ~/.indi/ParkData....
void SetAxis1ParkDefault(double steps)
SetRAPark Set default RA/AZ parking position.
void SetTelescopeCapability(uint32_t cap, uint8_t slewRateCount)
SetTelescopeCapability sets the Telescope capabilities. All capabilities must be initialized.
double GetAxis1Park() const
double GetAxis2Park() const
bool isParked()
isParked is mount currently parked?
virtual void SetParked(bool isparked)
SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData....
IGeographicCoordinates m_Location
void NewRaDec(double ra, double dec)
The child class calls this function when it has updates.
bool InitPark()
InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking...
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
void SetAxis2Park(double steps)
SetDEPark Set current DEC/ALT parking position. The data park file (stored in ~/.indi/ParkData....
void SetParkDataType(TelescopeParkData type)
setParkDataType Sets the type of parking data stored in the park data file and presented to the user.
void SetAxis2ParkDefault(double steps)
SetDEParkDefault Set default DEC/ALT parking position.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
void TrackingStart_RestoreSlewRate()
enum LX200FS2::TelescopeParkedStatus ParkedStatus
INumberVectorProperty SlewAccuracyNP
void TrackingStop_Abort()
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool Park() override
Park the telescope to its home position.
virtual bool checkConnection() override
virtual bool ReadScopeStatus() override
Read telescope status.
ISwitchVectorProperty StopAfterParkSP
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual const char * getDefaultName() override
virtual bool isSlewComplete() override
virtual bool Goto(double r, double d) override
Move the scope to the supplied RA and DEC coordinates.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool Sync(double r, double d) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
void TrackingStop_AllStop()
ISwitch StopAfterParkS[2]
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual void slewError(int slewCode)
bool updateSlewRate(int index)
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
const char * OPTIONS_TAB
OPTIONS_TAB Where all the driver's options are located. Those may include auxiliary controls,...
INDI::PropertyNumber EqNP
INDI::PropertySwitch SlewRateSP
INDI::PropertyNumber LocationNP
#define NARRAY(a)
Handy macro to find the number of elements in array a[]. Must be used with actual array,...
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.
void IUSaveConfigSwitch(FILE *fp, const ISwitchVectorProperty *svp)
Add a switch vector property value to the configuration file.
void IUFillNumberVector(INumberVectorProperty *nvp, INumber *np, int nnp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a number vector property. The vector's auxiliary elements will be set to NULL.
int IUFindOnSwitchIndex(const ISwitchVectorProperty *svp)
Returns the index of first ON switch it finds in the vector switch property.
void IUSaveConfigNumber(FILE *fp, const INumberVectorProperty *nvp)
Add a number vector property value to the configuration file.
void IUFillSwitch(ISwitch *sp, const char *name, const char *label, ISState s)
Assign attributes for a switch property. The switch's auxiliary elements will be set to NULL.
void IUFillNumber(INumber *np, const char *name, const char *label, const char *format, double min, double max, double step, double value)
Assign attributes for a number property. The number's auxiliary elements will be set to NULL.
void IUFillSwitchVector(ISwitchVectorProperty *svp, ISwitch *sp, int nsp, const char *dev, const char *name, const char *label, const char *group, IPerm p, ISRule r, double timeout, IPState s)
Assign attributes for a switch vector property. The vector's auxiliary elements will be set to NULL.
const char * IUFindOnSwitchName(ISState *states, char *names[], int n)
Returns the name of the first ON switch it finds in the supplied arguments.
int IUUpdateSwitch(ISwitchVectorProperty *svp, ISState *states, char *names[], int n)
Update all switches in a switch vector property.
void IDSetNumber(const INumberVectorProperty *nvp, const char *fmt,...)
void IDSetSwitch(const ISwitchVectorProperty *svp, const char *fmt,...)
int IUUpdateNumber(INumberVectorProperty *nvp, double values[], char *names[], int n)
Update all numbers in a number vector property.
#define LOGF_INFO(fmt,...)
#define LOGF_DEBUG(fmt,...)
#define LOG_ERROR(txt)
Shorter logging macros. In order to use these macros, the function (or method) "getDeviceName()" must...
#define LOGF_ERROR(fmt,...)
#define DEBUGF(priority, msg,...)
int setObjectRA(int fd, double ra, bool addSpace)
int setObjectDEC(int fd, double dec, bool addSpace)
void EquatorialToHorizontal(IEquatorialCoordinates *object, IGeographicCoordinates *observer, double JD, IHorizontalCoordinates *position)
EquatorialToHorizontal Calculate horizontal coordinates from equatorial coordinates.
void HorizontalToEquatorial(IHorizontalCoordinates *object, IGeographicCoordinates *observer, double JD, IEquatorialCoordinates *position)
HorizontalToEquatorial Calculate Equatorial EOD Coordinates from horizontal coordinates.