Instrument Neutral Distributed Interface INDI  2.0.2
ieqprolegacy.h
Go to the documentation of this file.
1 /*
2  INDI IEQ Pro driver
3 
4  Copyright (C) 2015 Jasem Mutlaq
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #pragma once
22 
23 #include "ieqprolegacydriver.h"
24 #include "indiguiderinterface.h"
25 #include "inditelescope.h"
26 
28 {
29  public:
30 
31  IEQProLegacy();
32 
33  virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
34  virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
35 
36  protected:
37  virtual const char *getDefaultName() override;
38 
39  virtual bool Handshake() override;
40 
41  virtual bool initProperties() override;
42  virtual bool updateProperties() override;
43 
44  virtual bool ReadScopeStatus() override;
45 
46  virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override;
47  virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override;
48 
49  virtual bool saveConfigItems(FILE *fp) override;
50 
51  virtual bool Park() override;
52  virtual bool UnPark() override;
53 
54  virtual bool Sync(double ra, double dec) override;
55  virtual bool Goto(double, double) override;
56  virtual bool Abort() override;
57 
58  virtual bool updateTime(ln_date *utc, double utc_offset) override;
59  virtual bool updateLocation(double latitude, double longitude, double elevation) override;
60 
61  virtual void debugTriggered(bool enable) override;
62  virtual void simulationTriggered(bool enable) override;
63 
64  // Parking
65  virtual bool SetCurrentPark() override;
66  virtual bool SetDefaultPark() override;
67 
68  // Track Mode
69  virtual bool SetTrackMode(uint8_t mode) override;
70 
71  // Track Rate
72  virtual bool SetTrackRate(double raRate, double deRate) override;
73 
74  // Track On/Off
75  virtual bool SetTrackEnabled(bool enabled) override;
76 
77  // Slew Rate
78  virtual bool SetSlewRate(int index) override;
79 
80  // Sim
81  void mountSim();
82 
83  // Guide
84  virtual IPState GuideNorth(uint32_t ms) override;
85  virtual IPState GuideSouth(uint32_t ms) override;
86  virtual IPState GuideEast(uint32_t ms) override;
87  virtual IPState GuideWest(uint32_t ms) override;
88 
89  private:
93  void getStartupData();
94 
95  /* Firmware */
96  IText FirmwareT[5] {};
97  ITextVectorProperty FirmwareTP;
98 
99  /* Tracking Mode */
100  //ISwitchVectorProperty TrackModeSP;
101  //ISwitch TrackModeS[4];
102 
103  /* Custom Tracking Rate */
104  //INumber CustomTrackRateN[1];
105  //INumberVectorProperty CustomTrackRateNP;
106 
107  /* GPS Status */
108  ISwitch GPSStatusS[3];
109  ISwitchVectorProperty GPSStatusSP;
110 
111  /* Time Source */
112  ISwitch TimeSourceS[3];
113  ISwitchVectorProperty TimeSourceSP;
114 
115  /* Hemisphere */
116  ISwitch HemisphereS[2];
117  ISwitchVectorProperty HemisphereSP;
118 
119  /* Home Control */
120  ISwitch HomeS[3];
121  ISwitchVectorProperty HomeSP;
122 
123  /* Guide Rate */
124  INumber GuideRateN[2];
125  INumberVectorProperty GuideRateNP;
126 
127  unsigned int DBG_SCOPE;
128  double currentRA = 0, currentDEC = 0;
129  double targetRA = 0, targetDEC = 0;
130 
131  IEQInfo scopeInfo;
132  FirmwareInfo firmwareInfo;
133 };
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
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 SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking 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 SetSlewRate(int index) override
SetSlewRate Set desired slew rate index.
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual IPState GuideNorth(uint32_t ms) override
Guide north for ms milliseconds. North is defined as DEC+.
virtual bool SetTrackRate(double raRate, double deRate) override
SetTrackRate Set custom tracking rates.
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
virtual bool Park() override
Park the telescope to its home position.
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
virtual IPState GuideSouth(uint32_t ms) override
Guide south for ms milliseconds. South is defined as DEC-.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual const char * getDefaultName() override
virtual IPState GuideWest(uint32_t ms) override
Guide west for ms milliseconds. West is defined as RA-.
virtual void debugTriggered(bool enable) override
Inform driver that the debug option was triggered. This function is called after setDebug is triggere...
virtual void simulationTriggered(bool enable) override
Inform driver that the simulation option was triggered. This function is called after setSimulation i...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
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 ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
double ra
double dec
ISState
Switch state.
Definition: indiapi.h:150
IPState
Property state.
Definition: indiapi.h:160
INDI_DIR_WE
Definition: indibasetypes.h:55
INDI_DIR_NS
Definition: indibasetypes.h:48
One number descriptor.
One switch descriptor.
One text descriptor.
Number vector property descriptor.
Definition: indiapi.h:319
Switch vector property descriptor.
Definition: indiapi.h:367
Text vector property descriptor.
Definition: indiapi.h:246