5This library is free software;
6you can redistribute it and / or
7modify it under the terms of the GNU Lesser General Public
8License as published by the Free Software Foundation;
10version 2.1 of the License, or (at your option) any later version.
12This library is distributed in the hope that it will be useful,
13 but WITHOUT
ANY WARRANTY;
14without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16Lesser General Public License
for more details.
18You should have received a copy of the GNU Lesser General Public
19License along with
this library;
20if not, write to the Free Software
21Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
23Version with experimental pulse guide support. GC 04.12.2015
31#include <libnova/transform.h>
48#define FINE_SLEW_RATE 0.1
51#define FINE_SLEW_LIMIT 0.5
53#define MOUNTINFO_TAB "Mount Info"
55static std::unique_ptr<CelestronGPS> telescope(
new CelestronGPS());
81 focusTrueMin = 0xffffffff;
88bool CelestronGPS::checkMinVersion(
double minVersion,
const char *feature,
bool debug)
96 LOGF_DEBUG(
"Firmware v%3.2f does not support %s. Minimum required version is %3.2f",
99 LOGF_WARN(
"Firmware v%3.2f does not support %s. Minimum required version is %3.2f",
109 return "Celestron GPS";
198 IUFillSwitchVector(&DSTSettingSP, DSTSettingS, 1,
getDeviceName(),
"DST_STATE",
"DST",
SITE_TAB,
IP_RW,
ISR_NOFMANY, 60,
245 static bool configLoaded =
false;
254 if (configLoaded ==
false)
274 canAuxGuide = (atof(fwInfo.
RAFirmware.c_str()) >= 6.12 && atof(fwInfo.
DEFirmware.c_str()) >= 6.12);
284 usePreciseCoords = (checkMinVersion(2.2,
"usePreciseCoords"));
291 LOG_WARN(
"Failed to retrieve firmware information.");
297 if (checkMinVersion(2.3,
"park"))
300 if (checkMinVersion(4.1,
"sync"))
303 if (checkMinVersion(2.3,
"updating time and location settings"))
311 if (checkMinVersion(2.3,
"track on/off"))
314 LOG_WARN(
"Mount firmware does not support track on off.");
316 if (fwInfo.
isGem && checkMinVersion(4.15,
"Pier Side",
true))
319 LOG_WARN(
"Mount firmware does not support getting pier side.");
323 if (checkMinVersion(2.3,
"track mode"))
373 if (fwInfo.
Version !=
"Invalid")
414 GuideRateN[
AXIS_RA].value = std::min(std::max(
static_cast<double>(rate) / 255.0, 0.0), 1.0);
418 GuideRateN[
AXIS_DE].value = std::min(std::max(
static_cast<double>(rate) / 255.0, 0.0), 1.0);
424 LOG_DEBUG(
"Unable to get guide rates from mount.");
428 LOG_INFO(
"Mount supports guiding.");
431 LOG_INFO(
"Mount does not support guiding. Tracking mode must be set in handset to either EQ-North or EQ-South.");
439 if (checkMinVersion(2.3,
"date and time setting"))
442 int yy, dd, mm, hh, minute, ss;
446 if (driver.
get_utc_date_time(&utc_offset, &yy, &mm, &dd, &hh, &minute, &ss, &dst, precise))
448 char isoDateTime[32];
451 snprintf(isoDateTime, 32,
"%04d-%02d-%02dT%02d:%02d:%02d", yy, mm, dd, hh, minute, ss);
452 snprintf(utcOffset, 8,
"%4.2f", utc_offset);
460 LOGF_INFO(
"Mount UTC offset: %s. UTC time: %s. DST: %s", utcOffset, isoDateTime, dst ?
"On" :
"Off");
467 double longitude, latitude;
474 LOGF_DEBUG(
"Mount latitude %8.4f longitude %8.4f", latitude, longitude);
478 LOG_WARN(
"Mount does not support retrieval of date, time and location.");
507 if (focusReadLimits())
518 LOG_INFO(
"Auxiliary focuser is connected.");
520 if (!focuserIsCalibrated)
522 LOG_WARN(
"Focuser not calibrated, moves will not be allowed");
548 if (fwInfo.
Version !=
"Invalid")
567 if (driver.
slew_radec(targetRA + SlewOffsetRa, targetDEC, usePreciseCoords) ==
false)
569 LOG_ERROR(
"Failed to slew telescope in RA/DEC.");
575 char RAStr[32], DecStr[32];
576 fs_sexa(RAStr, targetRA, 2, 3600);
577 fs_sexa(DecStr, targetDEC, 2, 3600);
578 LOGF_INFO(
"Slewing to JNOW RA %s - DEC %s SlewOffsetRa %4.1f arcsec", RAStr, DecStr, SlewOffsetRa * 3600 * 15);
585 if (!checkMinVersion(4.1,
"sync"))
588 if (driver.
sync(
ra,
dec, usePreciseCoords) ==
false)
597 char RAStr[32], DecStr[32];
598 fs_sexa(RAStr, targetRA, 2, 3600);
599 fs_sexa(DecStr, targetDEC, 2, 3600);
600 LOGF_INFO(
"Sync to %s, %s successful.", RAStr, DecStr);
670 LOG_ERROR(
"Error setting N/S motion direction.");
701 LOG_ERROR(
"Error setting W/E motion direction.");
729 if (driver.
get_radec(¤tRA, ¤tDEC, usePreciseCoords) ==
false)
731 LOG_ERROR(
"Failed to read RA/DEC values.");
768 if (currentDEC > 89.999 || currentDEC < -89.999)
775 LOGF_DEBUG(
"latitude %g, sop %c, PierSide %c",
800 LOG_WARN(
"This mount does not have index switches, the alignment assumes it is at the index position.");
836 LOG_INFO(
"Slew complete, tracking...");
839 double raoffset = targetRA - currentRA + SlewOffsetRa;
840 if (raoffset > 0.0 || raoffset < 10.0 / 3600.0)
843 SlewOffsetRa = SlewOffsetRa > 0 ? (SlewOffsetRa + raoffset) / 2 : raoffset;
845 LOGF_DEBUG(
"raoffset %4.1f, SlewOffsetRa %4.1f arcsec", raoffset * 3600 * 15, SlewOffsetRa * 3600 * 15);
865 LOG_INFO(
"Mount hibernated. Please disconnect now and turn off your mount.");
886 static size_t lastPecIndex = 1000;
887 static size_t numRecordPoints;
896 size_t pecIndex = driver.
pecIndex();
898 if (pecIndex != lastPecIndex)
903 lastPecIndex = pecIndex;
924 switch (lastPecState)
931 LOG_INFO(
"PEC index Seek completed.");
942 LOGF_DEBUG(
"PEC record stopped, %d records", numRecordPoints);
944 if (numRecordPoints >= numPecBins)
985 if (focusBacklashMove)
987 focusBacklashMove =
false;
988 if (driver.
foc_move(focusAbs2True(focusAbsPosition)))
989 LOGF_INFO(
"Focus final move %i", focusAbsPosition);
999 LOG_INFO(
"Focuser reached requested position.");
1044 return driver.
abort();
1062 LOG_ERROR(
"Failed to communicate with the mount, check the logs for details.");
1079 if (
UseHibernateS[0].s ==
ISS_ON && (checkMinVersion(4.22,
"hibernation",
true) ==
false))
1100 if (name && std::string(name) == LastAlignSP.
name)
1105 LOG_WARN(
"This mount does not have index switches, make sure that it is at the index position.");
1131 LOG_DEBUG(
" stop PEC record or playback");
1146 LOG_WARN(
"Incorrect state to stop PEC Playback or Record");
1169 LOG_WARN(
"Incorrect state to start PEC Playback");
1176 LOG_WARN(
"Mount must be Tracking to record PEC");
1194 LOG_WARN(
"Incorrect state to start PEC Recording");
1201 LOG_INFO(
"PEC index already found");
1210 LOG_INFO(
"Seek PEC index started");
1225 if (strstr(name,
"FOCUS"))
1246 if (strcmp(name,
"GUIDE_RATE") == 0)
1251 uint8_t grRa =
static_cast<uint8_t
>(std::min(
GuideRateN[
AXIS_RA].value * 256.0, 255.0));
1252 uint8_t grDec =
static_cast<uint8_t
>(std::min(
GuideRateN[
AXIS_DE].value * 256.0, 255.0));
1258 LOG_WARN(
"Changing guide rates may require recalibration of guiding.");
1272 LOGF_DEBUG(
"ISNewText name %s, text %s, names %s, n %d", name, texts[0], names[0], n);
1274 if (name && std::string(name) ==
"PEC_LOAD")
1291 if (!pecData.
Save(&driver))
1314 static struct timeval ltv;
1316 double dt, dx, da_ra = 0, da_dec = 0;
1320 gettimeofday(&tv,
nullptr);
1322 if (ltv.tv_sec == 0 && ltv.tv_usec == 0)
1325 dt = tv.tv_sec - ltv.tv_sec + (tv.tv_usec - ltv.tv_usec) / 1e6;
1422 if (fabs(dx) <= da_ra)
1438 if (fabs(dx) <= da_dec)
1477 LOG_DEBUG(
"updateLocation called before we are connected");
1481 if (!checkMinVersion(2.3,
"updating location"))
1487 LOG_INFO(
"Update location - check_aligned failed");
1493 LOG_INFO(
"Updating location is not necessary since mount is already aligned.");
1497 LOGF_DEBUG(
"Update location %8.3f, %8.3f, %4.0f", latitude, longitude, elevation);
1506 LOG_DEBUG(
"updateTime called before we are connected");
1510 if (!checkMinVersion(2.3,
"updating time"))
1517 LOG_INFO(
"UpdateTime - check_aligned failed");
1522 LOG_INFO(
"Updating time is not necessary since mount is already aligned.");
1529 bool dst = DSTSettingS[0].s ==
ISS_ON;
1531 LOGF_DEBUG(
"Update time: offset %f %s UTC %i-%02i-%02iT%02i:%02i:%02.0f", utc_offset, dst ?
"DST" :
"", utc->years,
1532 utc->months, utc->days,
1533 utc->hours, utc->minutes, utc->seconds);
1535 return (driver.
set_datetime(utc, utc_offset, dst, precise));
1543 char AzStr[16], AltStr[16];
1544 fs_sexa(AzStr, parkAZ, 2, 3600);
1545 fs_sexa(AltStr, parkAlt, 2, 3600);
1551 LOGF_DEBUG(
"Parking to Az (%s) Alt (%s)...", AzStr, AltStr);
1553 if (driver.
slew_azalt(parkAZ, parkAlt, usePreciseCoords))
1556 LOG_INFO(
"Parking is in progress...");
1576 LOG_ERROR(
"Waking up mount failed! Make sure mount is powered and connected. "
1577 "Hibernate requires firmware version >= 5.21");
1608 if (driver.
get_azalt(¤tAZ, ¤tALT, usePreciseCoords) ==
false)
1610 LOG_ERROR(
"Failed to read AZ/ALT values.");
1614 double parkAZ = currentAZ;
1615 double parkAlt = currentALT;
1617 char AzStr[16], AltStr[16];
1618 fs_sexa(AzStr, parkAZ, 2, 3600);
1619 fs_sexa(AltStr, parkAlt, 2, 3600);
1621 LOGF_DEBUG(
"Setting current parking position to coordinates Az (%s) Alt (%s)...", AzStr,
1750 LOGF_DEBUG(
"GUIDE CMD: %c %u ms, %s guide", dc, ms, canAuxGuide ?
"Aux" :
"Time");
1754 LOG_ERROR(
"Cannot guide while moving.");
1761 if (directionProperty.getState() ==
IPS_BUSY)
1780 if (driver.
send_pulse(dirn, rate,
static_cast<char>(std::min(255, *ticks))) == 0)
1787 ms = ms > 2550 ? 2550 : ms;
1791 directionProperty[index].setState(
ISS_ON);
1859 LOGF_DEBUG(
"guideTimer dir %c, ticks %i, rate %i",
"NSWE"[dirn], *ticks, rate);
1872 int dt = (*ticks > 255) ? 255 : *ticks;
1873 driver.
send_pulse(dirn, rate,
static_cast<uint8_t
>(dt));
1883 LOGF_ERROR(
"StopMotion failed dir %c",
"NSWE"[dirn]);
1909 LOGF_DEBUG(
"Guide %c finished",
"NSWE"[dirn]);
1973void CelestronGPS::checkAlignment()
1979 LOG_WARN(
"Mount is NOT aligned. You must align the mount first before you can use it. Disconnect, align the mount, and reconnect again.");
1982bool CelestronGPS::savePecData()
1987 char ts_date[32], ts_time[32];
1993 strftime(ts_date,
sizeof(ts_date),
"%Y-%m-%d", tp);
1994 strftime(ts_time,
sizeof(ts_time),
"%H:%M", tp);
1997 snprintf(dir,
MAXRBUF,
"%s/PEC_Data/%s", getenv(
"HOME"), ts_date);
2006 snprintf(pecFileBuf,
MAXRBUF,
"%s/pecData_%s.csv", dir, ts_time);
2015 if (!pecdata.
Load(&driver))
2017 LOG_DEBUG(
"Load PEC from mount failed");
2022 if (!pecdata.
Save(pecFileBuf))
2024 LOGF_DEBUG(
"Save PEC file %s failed", pecFileBuf);
2027 LOGF_INFO(
"PEC data saved to %s", pecFileBuf);
2034 uint32_t absPosition = targetTicks;
2036 if (!focuserIsCalibrated)
2038 LOG_ERROR(
"Move is not allowed because the focuser is not calibrated");
2043 int delta =
static_cast<int>(targetTicks -
FocusAbsPosNP[0].getValue());
2048 focusBacklashMove =
true;
2049 focusAbsPosition = absPosition;
2053 LOGF_INFO(
"Focus %s move %d", focusBacklashMove ?
"backlash" :
"direct", absPosition);
2055 if(!driver.
foc_move(focusAbs2True(absPosition)))
2063 uint32_t newPosition = 0;
2066 newPosition =
static_cast<uint32_t
>(
FocusAbsPosNP[0].getValue()) - ticks;
2068 newPosition =
static_cast<uint32_t
>(
FocusAbsPosNP[0].getValue()) + ticks;
2071 newPosition = std::min(
static_cast<uint32_t
>(
FocusAbsPosNP[0].getMax()), newPosition);
2081bool CelestronGPS::focusReadLimits()
2083 int low = 0, high = 0;
2086 focusTrueMax = high;
2101 focuserIsCalibrated = valid;
2103 LOGF_INFO(
"Focus Limits: Maximum (%i) Minimum (%i) steps.", high, low);
@ PEC_SEEKING
The PEC index is being searched for, goes to PEC_INDEXED when found.
@ PEC_AVAILABLE
PEC is available but inactive, can seek index Seek index is only available command.
@ PEC_PLAYBACK
PEC is being played back, stays in this state until stopped equivalent to TelescopePECState PEC_ON.
@ PEC_RECORDING
PEC is being recorded, goes to PEC_INDEXED when completed.
@ PEC_INDEXED
the PEC index has been found, can go to Playback or Recording this is equivalent to TelescopePECState...
bool slew_radec(double ra, double dec, bool precise)
bool get_azalt(double *az, double *alt, bool precise)
bool set_guide_rate(CELESTRON_AXIS axis, uint8_t rate)
void set_port_fd(int port_fd)
bool indexreached(bool *atIndex)
bool check_aligned(bool *isAligned)
bool set_datetime(struct ln_date *utc, double utc_offset, bool dst=false, bool precise=false)
bool set_location(double longitude, double latitude)
bool stop_motion(CELESTRON_DIRECTION dir)
const char * PecStateStr(PEC_STATE)
void set_sim_track_mode(CELESTRON_TRACK_MODE val)
bool get_firmware(FirmwareInfo *info)
bool sync(double ra, double dec, bool precise)
bool foc_limits(int *low, int *high)
bool PecPlayback(bool start)
size_t send_pulse(CELESTRON_DIRECTION direction, unsigned char rate, unsigned char duration_msec)
bool get_radec(double *ra, double *dec, bool precise)
bool get_track_mode(CELESTRON_TRACK_MODE *mode)
void set_device(const char *name)
void set_simulation(bool enable)
bool set_track_rate(CELESTRON_TRACK_RATE rate, CELESTRON_TRACK_MODE mode)
bool set_track_mode(CELESTRON_TRACK_MODE mode)
bool PecRecord(bool start)
bool isPecAtIndex(bool force=false)
bool get_location(double *longitude, double *latitude)
void set_sim_ra(double ra)
bool get_pulse_status(CELESTRON_DIRECTION direction)
void set_sim_slewing(bool isSlewing)
PEC_STATE updatePecState()
bool get_guide_rate(CELESTRON_AXIS axis, uint8_t *rate)
void set_sim_dec(double dec)
bool slew_azalt(double az, double alt, bool precise)
void set_sim_slew_rate(CELESTRON_SLEW_RATE val)
bool foc_move(uint32_t steps)
bool get_pier_side(char *sop)
bool is_slewing(bool *slewing)
bool get_utc_date_time(double *utc_hours, int *yy, int *mm, int *dd, int *hh, int *minute, int *ss, bool *dst, bool precise)
bool start_motion(CELESTRON_DIRECTION dir, CELESTRON_SLEW_RATE rate)
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
ITextVectorProperty PecFileNameTP
virtual IPState GuideWest(uint32_t ms) override
Guide west for ms milliseconds. West is defined as RA-.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
virtual bool Goto(double ra, double dec) override
Move the scope to the supplied RA and DEC coordinates.
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual IPState GuideSouth(uint32_t ms) override
Guide south for ms milliseconds. South is defined as DEC-.
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual IPState GuideEast(uint32_t ms) override
Guide east for ms milliseconds. East is defined as RA+.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
ISwitchVectorProperty PecControlSP
static void guideTimerHelperE(void *p)
static void guideTimerHelperS(void *p)
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
ITextVectorProperty FirmwareTP
void guideTimer(CELESTRON_DIRECTION dirn)
static void guideTimerHelperW(void *p)
IPState Guide(CELESTRON_DIRECTION dirn, uint32_t ms)
void AddGuideTimer(CELESTRON_DIRECTION dirn, int ms)
bool AbortFocuser() override
AbortFocuser all focus motion.
IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
INumberVectorProperty GuideRateNP
virtual const char * getDefaultName() override
ITextVectorProperty PecInfoTP
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
virtual bool Park() override
Park the telescope to its home position.
virtual IPState GuideNorth(uint32_t ms) override
Guide north for ms milliseconds. North is defined as DEC+.
virtual void simulationTriggered(bool enable) override
Inform driver that the simulation option was triggered. This function is called after setSimulation i...
ISwitchVectorProperty CelestronTrackModeSP
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
ISwitchVectorProperty UseHibernateSP
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
static void guideTimerHelperN(void *p)
ISwitch CelestronTrackModeS[4]
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
virtual bool ISNewText(const char *dev, const char *name, char **texts, char **names, int n) override
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
Class to provide general functionality of a GPS device.
virtual bool saveConfig(bool silent=false, const char *property=nullptr)
Save the current properties in a configuration file.
void setDriverInterface(uint32_t value)
setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE....
void setVersion(uint16_t vMajor, uint16_t vMinor)
Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor.
virtual bool loadConfig(bool silent=false, const char *property=nullptr)
Load the last saved configuration file.
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 syncDriverInfo()
syncDriverInfo sends the current driver information to the client.
void addAuxControls()
Add Debug, Simulation, and Configuration options to the driver.
uint32_t getDriverInterface() const
Provides interface to implement focuser functionality.
INDI::PropertyNumber FocusRelPosNP
bool updateProperties()
updateProperties Define or Delete Rotator properties based on the connection status of the base devic...
void SetCapability(uint32_t cap)
FI::SetCapability sets the focuser capabilities. All capabilities must be initialized.
void initProperties(const char *groupName)
Initialize focuser properties. It is recommended to call this function within initProperties() of you...
INDI::PropertyNumber FocusMaxPosNP
bool saveConfigItems(FILE *fp)
saveConfigItems save focuser properties defined in the interface in config file
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Process focus number properties.
bool processSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
Process focus switch properties.
INDI::PropertyNumber FocusBacklashNP
INDI::PropertyNumber FocusAbsPosNP
INDI::PropertyNumber GuideNSNP
bool updateProperties()
updateProperties Define or Delete Rotator properties based on the connection status of the base devic...
INDI::PropertyNumber GuideWENP
void initProperties(const char *groupName)
Initialize guider properties. It is recommended to call this function within initProperties() of your...
bool processNumber(const char *dev, const char *name, double values[], char *names[], int n)
Call this function whenever client updates GuideNSNP or GuideWSP properties in the primary device....
void setState(IPState state)
void apply(const char *format,...) const ATTRIBUTE_FORMAT_PRINTF(2
const char * getName() const
const char * getLabel() const
void setPermission(IPerm permission)
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.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
double GetAxis1Park() const
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
double GetAxis2Park() const
bool isParked()
isParked is mount currently parked?
virtual int AddTrackMode(const char *name, const char *label, bool isDefault=false)
AddTrackMode.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual void SetParked(bool isparked)
SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData....
const char * LoadParkData()
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
@ TELESCOPE_HAS_PIER_SIDE
@ TELESCOPE_CAN_CONTROL_TRACK
void NewRaDec(double ra, double dec)
The child class calls this function when it has updates.
void setPierSide(TelescopePierSide side)
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....
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
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.
bool Load(CelestronDriver *driver)
bool Save(const char *filename)
const char * GUIDE_TAB
GUIDE_TAB Where all the properties for guiding are located.
const char * MAIN_CONTROL_TAB
MAIN_CONTROL_TAB Where all the primary controls for the device are located.
const char * MOTION_TAB
MOTION_TAB Where all the motion control properties of the device are located.
const char * SITE_TAB
SITE_TAB Where all site information setting are located.
const char * FOCUS_TAB
FOCUS_TAB Where all the properties for focuser are located.
const char * OPTIONS_TAB
OPTIONS_TAB Where all the driver's options are located. Those may include auxiliary controls,...
void IERmTimer(int timerid)
Remove the timer with the given timerid, as returned from IEAddTimer() or IEAddPeriodicTimer().
int IEAddTimer(int millisecs, IE_TCF *fp, void *p)
Register a new single-shot timer function, fp, to be called with ud as argument after ms.
TelescopePierSide currentPierSide
INDI::PropertySwitch MovementNSSP
INDI::PropertyNumber EqNP
INDI::PropertySwitch TrackStateSP
INDI::PropertySwitch SlewRateSP
INDI::PropertyText TimeTP
INDI::PropertySwitch MountTypeSP
INDI::PropertySwitch MovementWESP
INDI::PropertyNumber LocationNP
double range24(double r)
range24 Limits a number to be between 0-24 range.
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 IUResetSwitch(ISwitchVectorProperty *svp)
Reset all switches in a switch vector property to OFF.
void IUFillTextVector(ITextVectorProperty *tvp, IText *tp, int ntp, const char *dev, const char *name, const char *label, const char *group, IPerm p, double timeout, IPState s)
Assign attributes for a text vector property. The vector's auxiliary elements will be set to NULL.
void IUSaveText(IText *tp, const char *newtext)
Function to reliably save new text in a IText.
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 IUFillText(IText *tp, const char *name, const char *label, const char *initialText)
Assign attributes for a text property. The text'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.
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 IUUpdateText(ITextVectorProperty *tvp, char *texts[], char *names[], int n)
Update all text members in a text vector property.
int IUUpdateNumber(INumberVectorProperty *nvp, double values[], char *names[], int n)
Update all numbers in a number vector property.
void IDSetText(const ITextVectorProperty *tvp, const char *fmt,...)
int IUGetConfigSwitch(const char *dev, const char *property, const char *member, ISState *value)
IUGetConfigSwitch Opens configuration file and reads single switch property.
#define LOGF_INFO(fmt,...)
#define LOGF_WARN(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 TRACKRATE_SIDEREAL
int mkpath(std::string s, mode_t mode)
CELESTRON_TRACK_MODE celestronTrackMode
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.