Instrument Neutral Distributed Interface INDI  2.0.2
eq500x.h
Go to the documentation of this file.
1 #if 0
2 LX200 - based Omegon EQ500X Equatorial Mount
3 
4 Copyright (C) 2019 Eric Dejouhanet (eric.dejouhanet@gmail.com)
5 
6 This library is free software;
7 you can redistribute it and / or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation;
10 either
11 version 2.1 of the License, or (at your option) any later version.
12 
13 This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY;
15 without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18 
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library;
21 if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
23 #endif
24 
25 #ifndef EQ500X_H
26 #define EQ500X_H
27 
28 class EQ500X : public LX200Generic
29 {
30  public:
32  {
33  public:
34  MechanicalPoint(double, double);
36  public:
37  bool atParkingPosition() const;
38  public:
39  double RAm() const;
40  double DECm() const;
41  double RAm(double const);
42  double DECm(double const);
43  public:
44  double RAsky() const;
45  double DECsky() const;
46  double RAsky(double const);
47  double DECsky(double const);
48  public:
51  enum PointingState getPointingState() const;
52  public:
53  bool parseStringDEC(char const *, size_t);
54  bool parseStringRA(char const *, size_t);
55  char const * toStringDEC(char *, size_t) const;
56  char const * toStringRA(char *, size_t) const;
57  public:
58  char const * toStringDEC_Sim(char *, size_t) const;
59  public:
60  double RA_degrees_to(MechanicalPoint const &) const;
61  double DEC_degrees_to(MechanicalPoint const &) const;
62  public:
63  double operator -(MechanicalPoint const &) const;
64  bool operator !=(MechanicalPoint const &) const;
65  bool operator ==(MechanicalPoint const &) const;
66  protected:
67  enum PointingState _pointingState {POINTING_NORMAL};
68  long _RAm {0 * 3600}, _DECm {0 * 3600};
69  };
70  public:
71  EQ500X();
72  const char *getDefautName();
73  protected:
74  bool getCurrentMechanicalPosition(MechanicalPoint &);
75  bool setTargetMechanicalPosition(MechanicalPoint const &);
76  bool gotoTargetPosition(MechanicalPoint const &);
77  protected:
78  bool isParked();
79  virtual double getLST();
80  void resetSimulation();
81  protected:
82  int sendCmd(char const *);
83  int getReply(char *, size_t const);
84  protected:
85  virtual bool checkConnection() override;
86  virtual bool updateLocation(double, double, double) override;
87  virtual void getBasicData() override;
88  virtual bool ReadScopeStatus() override;
89  virtual bool initProperties() override;
90  virtual bool Goto(double, double) override;
91  virtual bool Sync(double, double) override;
92  virtual bool Abort() override;
93  virtual void setPierSide(TelescopePierSide);
94  virtual bool MoveNS(INDI_DIR_NS, TelescopeMotionCommand) override;
95  private:
96  MechanicalPoint currentMechPosition, targetMechPosition;
97  double previousRA = {0}, previousDEC = {0};
98  int countdown {0};
99  // Movement markers, adjustment is done when no movement is required and all flags are cleared
100  bool RAmIncrease {false}, RAmDecrease {false};
101  bool DECmIncrease {false}, DECmDecrease {false};
102  // Current adjustment rate
103  struct _adjustment const * adjustment
104  {
105  nullptr
106  };
107  bool _gotoEngaged {false};
108  enum TelescopeSlewRate savedSlewRateIndex {SLEW_MAX};
109  };
110 
111 #endif // EQ500X_H
double DECsky() const
Definition: eq500x.cpp:955
enum PointingState setPointingState(enum PointingState)
Definition: eq500x.cpp:1272
bool operator==(MechanicalPoint const &) const
Definition: eq500x.cpp:1267
char const * toStringDEC_Sim(char *, size_t) const
Definition: eq500x.cpp:1028
double DEC_degrees_to(MechanicalPoint const &) const
Definition: eq500x.cpp:1247
bool operator!=(MechanicalPoint const &) const
Definition: eq500x.cpp:1261
bool atParkingPosition() const
Definition: eq500x.cpp:907
double DECm() const
Definition: eq500x.cpp:918
enum PointingState getPointingState() const
Definition: eq500x.cpp:1278
bool parseStringRA(char const *, size_t)
Definition: eq500x.cpp:1008
double RA_degrees_to(MechanicalPoint const &) const
Definition: eq500x.cpp:1236
double RAm() const
Definition: eq500x.cpp:913
char const * toStringDEC(char *, size_t) const
Definition: eq500x.cpp:1107
double RAsky() const
Definition: eq500x.cpp:943
double operator-(MechanicalPoint const &) const
Definition: eq500x.cpp:1253
bool parseStringDEC(char const *, size_t)
Definition: eq500x.cpp:1123
char const * toStringRA(char *, size_t) const
Definition: eq500x.cpp:994
Definition: eq500x.h:29
virtual bool updateLocation(double, double, double) override
Update telescope location settings.
Definition: eq500x.cpp:227
bool setTargetMechanicalPosition(MechanicalPoint const &)
Definition: eq500x.cpp:867
virtual bool MoveNS(INDI_DIR_NS, TelescopeMotionCommand) override
Start or Stop the telescope motion in the direction dir.
Definition: eq500x.cpp:748
virtual bool checkConnection() override
Definition: eq500x.cpp:165
bool gotoTargetPosition(MechanicalPoint const &)
Definition: eq500x.cpp:809
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
Definition: eq500x.cpp:603
const char * getDefautName()
Definition: eq500x.cpp:127
int getReply(char *, size_t const)
Definition: eq500x.cpp:796
EQ500X()
Definition: eq500x.cpp:102
virtual bool ReadScopeStatus() override
Read telescope status.
Definition: eq500x.cpp:249
int sendCmd(char const *)
Definition: eq500x.cpp:785
virtual bool Sync(double, double) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
Definition: eq500x.cpp:691
bool isParked()
virtual bool initProperties() override
Called to initialize basic properties required all the time.
Definition: eq500x.cpp:147
bool getCurrentMechanicalPosition(MechanicalPoint &)
Definition: eq500x.cpp:833
void resetSimulation()
Definition: eq500x.cpp:137
virtual void getBasicData() override
Definition: eq500x.cpp:160
virtual void setPierSide(TelescopePierSide)
Definition: eq500x.cpp:741
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
Definition: eq500x.cpp:734
virtual double getLST()
Definition: eq500x.cpp:132
INDI_DIR_NS
Definition: indibasetypes.h:48