Instrument Neutral Distributed Interface INDI  2.0.2
lx200pulsar2.h
Go to the documentation of this file.
1 /*
2  Pulsar 2 INDI driver
3 
4  Copyright (C) 2016, 2017 Jasem Mutlaq and Camiel Severijns
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 "lx200generic.h"
24 
25 
26 class LX200Pulsar2 : public LX200Generic
27 {
28  public:
29  LX200Pulsar2();
30  virtual ~LX200Pulsar2() {}
31 
32  static constexpr char const *ADVANCED_TAB = "Advanced Setup";
33  static constexpr bool verboseLogging = false;
34  static constexpr char Null = '\0';
35 
36 
37  virtual const char *getDefaultName() override;
38 
39  virtual bool Connect() override;
40  virtual bool Disconnect() override;
41  virtual bool Handshake() override;
42  virtual bool ReadScopeStatus() override;
43  virtual void ISGetProperties(const char *dev) override;
44  virtual bool initProperties() override;
45  virtual bool updateProperties() override;
46  virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
47  virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
48  virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
49 
50  static const unsigned int numPulsarTrackingRates = 7;
51 
52  protected:
53  virtual bool SetSlewRate(int index) override;
54  virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override;
55  virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override;
56  virtual bool Abort() override;
57 
58  virtual IPState GuideNorth(uint32_t ms) override;
59  virtual IPState GuideSouth(uint32_t ms) override;
60  virtual IPState GuideEast(uint32_t ms) override;
61  virtual IPState GuideWest(uint32_t ms) override;
62 
63  virtual bool updateTime(ln_date *utc, double utc_offset) override;
64  virtual bool updateLocation(double latitude, double longitude, double elevation) override;
65 
66  virtual bool Goto(double, double) override;
67  virtual bool Park() override;
68  virtual bool Sync(double ra, double dec) override;
69  virtual bool UnPark() override;
70 
71  virtual bool isSlewComplete() override;
72  virtual bool checkConnection() override;
73 
74  virtual void getBasicData() override;
75 
76 
77  // Pier Side
82 
83  // Tracking Rates
86 
87  // Guide Speed Indicator
90  // Center Speed Indicator
93  // Find Speed Indicator
96  // Slew Speed Indicator
99  // GoTo Speed Indicator
102 
103  // Ramp
106 
107  // Reduction
110 
111  // Maingear
114 
115  // Backlash
118 
119  // Home Position
122 
123  // SwapTubeDelay
126 
127  // Mount Type
130 
131  // Periodic error correction on or off
134 
135  // Pole crossing on or off
138 
139  // Refraction correction on or off
142 
143  // Rotation RA
146  // Rotation DEC
149 
150  // User1 Rate
153 
154 
155  // Tracking Current
157  INumber TrackingCurrentN[1]; // only one entry for both RA and Dec
158  // Stop Current
160  INumber StopCurrentN[1]; // only one entry for both RA and Dec
161  // GoTo Current
163  INumber GoToCurrentN[1]; // only one entry for both RA and Dec
164 
165  private:
166 
167  bool storeScopeLocation();
168  virtual bool sendScopeTime() override;
169 
170  bool isSlewing();
171  bool just_started_slewing;
172 
173  bool local_properties_updated = false;
174  bool initialization_complete = false; // actually completion of getBasicData
175 
176 };
static constexpr char const * ADVANCED_TAB
Definition: lx200pulsar2.h:32
INumber TrackingCurrentN[1]
Definition: lx200pulsar2.h:157
virtual bool isSlewComplete() override
INumberVectorProperty TrackingCurrentNP
Definition: lx200pulsar2.h:156
virtual bool initProperties() override
Called to initialize basic properties required all the time.
ISwitchVectorProperty MountTypeSP
Definition: lx200pulsar2.h:128
INumber GoToCurrentN[1]
Definition: lx200pulsar2.h:163
virtual IPState GuideEast(uint32_t ms) override
Guide east for ms milliseconds. East is defined as RA+.
ISwitch TrackingRateIndS[numPulsarTrackingRates]
Definition: lx200pulsar2.h:85
ISwitchVectorProperty PoleCrossingSP
Definition: lx200pulsar2.h:136
INumber GoToSpeedIndN[1]
Definition: lx200pulsar2.h:101
virtual void getBasicData() override
INumber MaingearN[2]
Definition: lx200pulsar2.h:113
INumberVectorProperty SlewSpeedIndNP
Definition: lx200pulsar2.h:97
INumberVectorProperty SwapTubeDelayNP
Definition: lx200pulsar2.h:124
INumberVectorProperty GoToSpeedIndNP
Definition: lx200pulsar2.h:100
INumber RampN[2]
Definition: lx200pulsar2.h:105
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool UnPark() override
Unpark the telescope if already parked.
ISwitchVectorProperty PierSideSP
Definition: lx200pulsar2.h:79
INumber ReductionN[2]
Definition: lx200pulsar2.h:109
INumber UserRate1N[2]
Definition: lx200pulsar2.h:152
INumberVectorProperty HomePositionNP
Definition: lx200pulsar2.h:120
virtual bool Handshake() override
perform handshake with device to check communication
ISwitch RotationDecS[2]
Definition: lx200pulsar2.h:148
INumberVectorProperty GoToCurrentNP
Definition: lx200pulsar2.h:162
INumberVectorProperty BacklashNP
Definition: lx200pulsar2.h:116
ISwitch PoleCrossingS[2]
Definition: lx200pulsar2.h:137
INumber SlewSpeedIndN[1]
Definition: lx200pulsar2.h:98
ISwitchVectorProperty RefractionCorrectionSP
Definition: lx200pulsar2.h:140
INumber FindSpeedIndN[1]
Definition: lx200pulsar2.h:95
ISwitchVectorProperty RotationDecSP
Definition: lx200pulsar2.h:147
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool Disconnect() override
Disconnect from device.
ISwitchVectorProperty RotationRASP
Definition: lx200pulsar2.h:144
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
ISwitchVectorProperty PierSideToggleSP
Definition: lx200pulsar2.h:81
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
INumberVectorProperty GuideSpeedIndNP
Definition: lx200pulsar2.h:88
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
INumber StopCurrentN[1]
Definition: lx200pulsar2.h:160
virtual const char * getDefaultName() override
static constexpr char Null
Definition: lx200pulsar2.h:34
INumber BacklashN[2]
Definition: lx200pulsar2.h:117
INumberVectorProperty ReductionNP
Definition: lx200pulsar2.h:108
INumberVectorProperty RampNP
Definition: lx200pulsar2.h:104
virtual ~LX200Pulsar2()
Definition: lx200pulsar2.h:30
virtual IPState GuideWest(uint32_t ms) override
Guide west for ms milliseconds. West is defined as RA-.
ISwitch RefractionCorrectionS[2]
Definition: lx200pulsar2.h:141
ISwitch MountTypeS[3]
Definition: lx200pulsar2.h:129
ISwitchVectorProperty TrackingRateIndSP
Definition: lx200pulsar2.h:84
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
ISwitch PeriodicErrorCorrectionS[2]
Definition: lx200pulsar2.h:133
INumber GuideSpeedIndN[1]
Definition: lx200pulsar2.h:89
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...
INumberVectorProperty UserRate1NP
Definition: lx200pulsar2.h:151
INumber HomePositionN[2]
Definition: lx200pulsar2.h:121
INumber CenterSpeedIndN[1]
Definition: lx200pulsar2.h:92
virtual bool checkConnection() override
INumberVectorProperty StopCurrentNP
Definition: lx200pulsar2.h:159
virtual bool Park() override
Park the telescope to its home position.
static constexpr bool verboseLogging
Definition: lx200pulsar2.h:33
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
INumberVectorProperty FindSpeedIndNP
Definition: lx200pulsar2.h:94
ISwitch PierSideToggleS[1]
Definition: lx200pulsar2.h:80
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 ReadScopeStatus() override
Read telescope status.
static const unsigned int numPulsarTrackingRates
Definition: lx200pulsar2.h:50
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
virtual IPState GuideSouth(uint32_t ms) override
Guide south for ms milliseconds. South is defined as DEC-.
INumberVectorProperty CenterSpeedIndNP
Definition: lx200pulsar2.h:91
ISwitch RotationRAS[2]
Definition: lx200pulsar2.h:145
ISwitchVectorProperty PeriodicErrorCorrectionSP
Definition: lx200pulsar2.h:132
INumber SwapTubeDelayN[1]
Definition: lx200pulsar2.h:125
ISwitch PierSideS[2]
Definition: lx200pulsar2.h:78
INumberVectorProperty MaingearNP
Definition: lx200pulsar2.h:112
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool SetSlewRate(int index) override
SetSlewRate Set desired slew rate index.
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual IPState GuideNorth(uint32_t ms) override
Guide north for ms milliseconds. North is defined as DEC+.
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.
Number vector property descriptor.
Definition: indiapi.h:319
Switch vector property descriptor.
Definition: indiapi.h:367