/* LX200 Basic Driver Copyright (C) 2005 Jasem Mutlaq (mutlaqja@ikarustech.com) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include "inditelescope.h" #include #include #include #include #include class LXD650 : public INDI::Telescope, public INDI::GuiderInterface, public INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers { public: LXD650(); ~LXD650() override = default; virtual const char *getDefaultName() override; virtual bool Handshake() override; virtual bool ReadScopeStatus() override; virtual bool initProperties() override; virtual bool updateProperties() override; virtual bool ISNewBLOB(const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n) override; virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override; virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override; virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override; virtual bool ISSnoopDevice(XMLEle *root) override; static void GuideNorthProxy(void *context); static void GuideSouthProxy(void *context); static void GuideWestProxy(void *context); static void GuideEastProxy(void *context); protected: virtual bool Abort() override; virtual bool Goto(double, double) override; virtual bool Sync(double ra, double dec) override; virtual void debugTriggered(bool enable) override; virtual bool saveConfigItems(FILE *fp) override; void getBasicData(); virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override; virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override; virtual IPState GuideNorth(uint32_t ms) override; virtual IPState GuideSouth(uint32_t ms) override; virtual IPState GuideEast(uint32_t ms) override; virtual IPState GuideWest(uint32_t ms) override; virtual bool updateTime(ln_date *utc, double utc_offset) override; virtual bool updateLocation(double latitude, double longitude, double elevation) override; protected: bool isSlewComplete(); void slewError(int slewCode); void mountSim(); INumber SlewAccuracyN[2]; INumberVectorProperty SlewAccuracyNP; double targetRA = 0, targetDEC = 0; double currentRA = 0, currentDEC = 0; uint32_t DBG_SCOPE = 0; private: bool LXDSetTrackMode(uint8_t mode); bool LXDSetTrackRate(double rate); INumber LXDTrackRateN; INumberVectorProperty LXDTrackRateNP; INDI::PropertySwitch LXDTrackModeSP {4}; enum { LXD_TRACK_SIDEREAL, LXD_TRACK_SOLAR, LXD_TRACK_LUNAR, LXD_TRACK_CUSTOM }; INDI::PropertyNumber GuideRateNP {2}; bool guidePulse(INDI_EQ_AXIS axis, uint32_t ms, int8_t rate); void show_alignment(const char *wot, double ra1,double dec1, double ra2,double dec2); int GuideNorth_TID {0}; int GuideSouth_TID {0}; int GuideWest_TID {0}; int GuideEast_TID {0}; void GuideNorthCB(void); void GuideSouthCB(void); void GuideWestCB(void); void GuideEastCB(void); virtual bool setLocalDate(uint8_t days, uint8_t months, uint16_t years); virtual bool setLocalTime24(uint8_t hour, uint8_t minute, uint8_t second); virtual bool setUTCOffset(double offset); void set_slew_rate_from_property(void); void show_guide (const char *dir, int ms); };