Instrument Neutral Distributed Interface INDI  1.9.5
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 };
LX200Pulsar2::GuideNorth
virtual IPState GuideNorth(uint32_t ms) override
Guide north for ms milliseconds. North is defined as DEC+.
Definition: lx200pulsar2.cpp:2498
LX200Generic
Definition: lx200generic.h:25
LX200Pulsar2::PoleCrossingSP
ISwitchVectorProperty PoleCrossingSP
Definition: lx200pulsar2.h:136
LX200Pulsar2::TrackingCurrentN
INumber TrackingCurrentN[1]
Definition: lx200pulsar2.h:157
LX200Pulsar2::updateProperties
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
Definition: lx200pulsar2.cpp:1532
LX200Pulsar2::Goto
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
Definition: lx200pulsar2.cpp:2713
LX200Pulsar2::getBasicData
virtual void getBasicData() override
Definition: lx200pulsar2.cpp:2946
IPState
IPState
Property state.
Definition: indiapi.h:158
LX200Pulsar2::CenterSpeedIndNP
INumberVectorProperty CenterSpeedIndNP
Definition: lx200pulsar2.h:91
ISwitch
One switch descriptor.
INDI_DIR_NS
INDI_DIR_NS
Definition: indibasetypes.h:44
INumber
One number descriptor.
LX200Pulsar2::Park
virtual bool Park() override
Park the telescope to its home position.
Definition: lx200pulsar2.cpp:2772
LX200Pulsar2::~LX200Pulsar2
virtual ~LX200Pulsar2()
Definition: lx200pulsar2.h:30
INDI_DIR_WE
INDI_DIR_WE
Definition: indibasetypes.h:50
LX200Pulsar2::MoveWE
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
Definition: lx200pulsar2.cpp:2428
LX200Pulsar2::RampNP
INumberVectorProperty RampNP
Definition: lx200pulsar2.h:104
LX200Pulsar2::isSlewComplete
virtual bool isSlewComplete() override
Definition: lx200pulsar2.cpp:2918
LX200Pulsar2::RefractionCorrectionS
ISwitch RefractionCorrectionS[2]
Definition: lx200pulsar2.h:141
LX200Pulsar2::Disconnect
virtual bool Disconnect() override
Disconnect from device.
Definition: lx200pulsar2.cpp:1288
LX200Pulsar2::StopCurrentNP
INumberVectorProperty StopCurrentNP
Definition: lx200pulsar2.h:159
LX200Pulsar2::MountTypeS
ISwitch MountTypeS[3]
Definition: lx200pulsar2.h:129
lx200generic.h
LX200Pulsar2::UnPark
virtual bool UnPark() override
Unpark the telescope if already parked.
Definition: lx200pulsar2.cpp:2885
LX200Pulsar2
Definition: lx200pulsar2.h:26
LX200Pulsar2::GuideEast
virtual IPState GuideEast(uint32_t ms) override
Guide east for ms milliseconds. East is defined as RA+.
Definition: lx200pulsar2.cpp:2582
LX200Pulsar2::PoleCrossingS
ISwitch PoleCrossingS[2]
Definition: lx200pulsar2.h:137
LX200Pulsar2::ReadScopeStatus
virtual bool ReadScopeStatus() override
Read telescope status.
Definition: lx200pulsar2.cpp:1304
LX200Pulsar2::SwapTubeDelayNP
INumberVectorProperty SwapTubeDelayNP
Definition: lx200pulsar2.h:124
_INumberVectorProperty
Number vector property descriptor.
Definition: indiapi.h:317
LX200Pulsar2::Null
static constexpr char Null
Definition: lx200pulsar2.h:34
LX200Pulsar2::UserRate1NP
INumberVectorProperty UserRate1NP
Definition: lx200pulsar2.h:151
LX200Pulsar2::RotationDecSP
ISwitchVectorProperty RotationDecSP
Definition: lx200pulsar2.h:147
ra
double ra
Definition: ieqprolegacydriver.cpp:43
LX200Pulsar2::MoveNS
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
Definition: lx200pulsar2.cpp:2389
LX200Pulsar2::RampN
INumber RampN[2]
Definition: lx200pulsar2.h:105
LX200Pulsar2::CenterSpeedIndN
INumber CenterSpeedIndN[1]
Definition: lx200pulsar2.h:92
LX200Pulsar2::MaingearNP
INumberVectorProperty MaingearNP
Definition: lx200pulsar2.h:112
LX200Pulsar2::PierSideSP
ISwitchVectorProperty PierSideSP
Definition: lx200pulsar2.h:79
LX200Pulsar2::TrackingRateIndSP
ISwitchVectorProperty TrackingRateIndSP
Definition: lx200pulsar2.h:84
LX200Pulsar2::RotationRASP
ISwitchVectorProperty RotationRASP
Definition: lx200pulsar2.h:144
LX200Pulsar2::ISNewNumber
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition: lx200pulsar2.cpp:1599
LX200Pulsar2::TrackingRateIndS
ISwitch TrackingRateIndS[numPulsarTrackingRates]
Definition: lx200pulsar2.h:85
INDI::Telescope::TelescopeMotionCommand
TelescopeMotionCommand
Definition: inditelescope.h:81
LX200Pulsar2::ReductionNP
INumberVectorProperty ReductionNP
Definition: lx200pulsar2.h:108
LX200Pulsar2::SlewSpeedIndNP
INumberVectorProperty SlewSpeedIndNP
Definition: lx200pulsar2.h:97
LX200Pulsar2::ReductionN
INumber ReductionN[2]
Definition: lx200pulsar2.h:109
LX200Pulsar2::checkConnection
virtual bool checkConnection() override
Definition: lx200pulsar2.cpp:2935
LX200Pulsar2::SwapTubeDelayN
INumber SwapTubeDelayN[1]
Definition: lx200pulsar2.h:125
LX200Pulsar2::ISGetProperties
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...
Definition: lx200pulsar2.cpp:1383
LX200Pulsar2::PeriodicErrorCorrectionS
ISwitch PeriodicErrorCorrectionS[2]
Definition: lx200pulsar2.h:133
LX200Pulsar2::PeriodicErrorCorrectionSP
ISwitchVectorProperty PeriodicErrorCorrectionSP
Definition: lx200pulsar2.h:132
LX200Pulsar2::BacklashN
INumber BacklashN[2]
Definition: lx200pulsar2.h:117
LX200Pulsar2::PierSideS
ISwitch PierSideS[2]
Definition: lx200pulsar2.h:78
dec
double dec
Definition: ieqprolegacydriver.cpp:44
LX200Pulsar2::GuideSouth
virtual IPState GuideSouth(uint32_t ms) override
Guide south for ms milliseconds. South is defined as DEC-.
Definition: lx200pulsar2.cpp:2541
LX200Pulsar2::StopCurrentN
INumber StopCurrentN[1]
Definition: lx200pulsar2.h:160
LX200Pulsar2::Abort
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
Definition: lx200pulsar2.cpp:2467
LX200Pulsar2::Handshake
virtual bool Handshake() override
perform handshake with device to check communication
Definition: lx200pulsar2.cpp:1296
LX200Pulsar2::LX200Pulsar2
LX200Pulsar2()
Definition: lx200pulsar2.cpp:1242
LX200Pulsar2::getDefaultName
virtual const char * getDefaultName() override
Definition: lx200pulsar2.cpp:1260
LX200Pulsar2::BacklashNP
INumberVectorProperty BacklashNP
Definition: lx200pulsar2.h:116
LX200Pulsar2::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: lx200pulsar2.cpp:2082
LX200Pulsar2::ISNewText
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
Definition: lx200pulsar2.cpp:2361
LX200Pulsar2::updateTime
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
Definition: lx200pulsar2.cpp:2664
LX200Pulsar2::RefractionCorrectionSP
ISwitchVectorProperty RefractionCorrectionSP
Definition: lx200pulsar2.h:140
LX200Pulsar2::GoToCurrentNP
INumberVectorProperty GoToCurrentNP
Definition: lx200pulsar2.h:162
LX200Pulsar2::PierSideToggleS
ISwitch PierSideToggleS[1]
Definition: lx200pulsar2.h:80
LX200Pulsar2::GoToCurrentN
INumber GoToCurrentN[1]
Definition: lx200pulsar2.h:163
LX200Pulsar2::MaingearN
INumber MaingearN[2]
Definition: lx200pulsar2.h:113
name
const char * name
Definition: indiserver.c:116
LX200Pulsar2::GuideWest
virtual IPState GuideWest(uint32_t ms) override
Guide west for ms milliseconds. West is defined as RA-.
Definition: lx200pulsar2.cpp:2623
LX200Pulsar2::MountTypeSP
ISwitchVectorProperty MountTypeSP
Definition: lx200pulsar2.h:128
LX200Pulsar2::SetSlewRate
virtual bool SetSlewRate(int index) override
SetSlewRate Set desired slew rate index.
Definition: lx200pulsar2.cpp:2370
LX200Pulsar2::updateLocation
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
Definition: lx200pulsar2.cpp:2691
LX200Pulsar2::numPulsarTrackingRates
static const unsigned int numPulsarTrackingRates
Definition: lx200pulsar2.h:50
LX200Pulsar2::Connect
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
Definition: lx200pulsar2.cpp:1265
LX200Pulsar2::Sync
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
Definition: lx200pulsar2.cpp:2835
LX200Pulsar2::GuideSpeedIndNP
INumberVectorProperty GuideSpeedIndNP
Definition: lx200pulsar2.h:88
LX200Pulsar2::TrackingCurrentNP
INumberVectorProperty TrackingCurrentNP
Definition: lx200pulsar2.h:156
LX200Pulsar2::RotationDecS
ISwitch RotationDecS[2]
Definition: lx200pulsar2.h:148
LX200Pulsar2::FindSpeedIndN
INumber FindSpeedIndN[1]
Definition: lx200pulsar2.h:95
LX200Pulsar2::PierSideToggleSP
ISwitchVectorProperty PierSideToggleSP
Definition: lx200pulsar2.h:81
ISState
ISState
Switch state.
Definition: indiapi.h:148
LX200Pulsar2::HomePositionN
INumber HomePositionN[2]
Definition: lx200pulsar2.h:121
LX200Pulsar2::ADVANCED_TAB
static constexpr const char * ADVANCED_TAB
Definition: lx200pulsar2.h:32
LX200Pulsar2::GoToSpeedIndN
INumber GoToSpeedIndN[1]
Definition: lx200pulsar2.h:101
LX200Pulsar2::UserRate1N
INumber UserRate1N[2]
Definition: lx200pulsar2.h:152
LX200Pulsar2::SlewSpeedIndN
INumber SlewSpeedIndN[1]
Definition: lx200pulsar2.h:98
LX200Pulsar2::HomePositionNP
INumberVectorProperty HomePositionNP
Definition: lx200pulsar2.h:120
LX200Pulsar2::GoToSpeedIndNP
INumberVectorProperty GoToSpeedIndNP
Definition: lx200pulsar2.h:100
LX200Pulsar2::verboseLogging
static constexpr bool verboseLogging
Definition: lx200pulsar2.h:33
LX200Pulsar2::RotationRAS
ISwitch RotationRAS[2]
Definition: lx200pulsar2.h:145
LX200Pulsar2::GuideSpeedIndN
INumber GuideSpeedIndN[1]
Definition: lx200pulsar2.h:89
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365
LX200Pulsar2::initProperties
virtual bool initProperties() override
Called to initialize basic properties required all the time.
Definition: lx200pulsar2.cpp:1393
LX200Pulsar2::FindSpeedIndNP
INumberVectorProperty FindSpeedIndNP
Definition: lx200pulsar2.h:94