Instrument Neutral Distributed Interface INDI 2.2.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
27{
28 public:
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};
int SetSlewRate(void)
static constexpr char const * ADVANCED_TAB
INumber TrackingCurrentN[1]
virtual bool isSlewComplete() override
INumberVectorProperty TrackingCurrentNP
virtual bool initProperties() override
Called to initialize basic properties required all the time.
ISwitchVectorProperty MountTypeSP
INumber GoToCurrentN[1]
virtual IPState GuideEast(uint32_t ms) override
Guide east for ms milliseconds. East is defined as RA+.
ISwitch TrackingRateIndS[numPulsarTrackingRates]
ISwitchVectorProperty PoleCrossingSP
INumber GoToSpeedIndN[1]
virtual void getBasicData() override
INumber MaingearN[2]
INumberVectorProperty SlewSpeedIndNP
INumberVectorProperty SwapTubeDelayNP
INumberVectorProperty GoToSpeedIndNP
INumber RampN[2]
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
INumber ReductionN[2]
INumber UserRate1N[2]
INumberVectorProperty HomePositionNP
virtual bool Handshake() override
perform handshake with device to check communication
ISwitch RotationDecS[2]
INumberVectorProperty GoToCurrentNP
INumberVectorProperty BacklashNP
ISwitch PoleCrossingS[2]
INumber SlewSpeedIndN[1]
ISwitchVectorProperty RefractionCorrectionSP
INumber FindSpeedIndN[1]
ISwitchVectorProperty RotationDecSP
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
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
ISwitchVectorProperty PierSideToggleSP
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
INumberVectorProperty GuideSpeedIndNP
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
INumber StopCurrentN[1]
virtual const char * getDefaultName() override
static constexpr char Null
INumber BacklashN[2]
INumberVectorProperty ReductionNP
INumberVectorProperty RampNP
virtual ~LX200Pulsar2()
virtual IPState GuideWest(uint32_t ms) override
Guide west for ms milliseconds. West is defined as RA-.
ISwitch RefractionCorrectionS[2]
ISwitch MountTypeS[3]
ISwitchVectorProperty TrackingRateIndSP
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]
INumber GuideSpeedIndN[1]
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
INumber HomePositionN[2]
INumber CenterSpeedIndN[1]
virtual bool checkConnection() override
INumberVectorProperty StopCurrentNP
virtual bool Park() override
Park the telescope to its home position.
static constexpr bool verboseLogging
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
INumberVectorProperty FindSpeedIndNP
ISwitch PierSideToggleS[1]
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
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
ISwitch RotationRAS[2]
ISwitchVectorProperty PeriodicErrorCorrectionSP
INumber SwapTubeDelayN[1]
ISwitch PierSideS[2]
INumberVectorProperty MaingearNP
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
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:148
IPState
Property state.
Definition indiapi.h:158
INDI_DIR_WE
INDI_DIR_NS
One number descriptor.
One switch descriptor.
Number vector property descriptor.
Definition indiapi.h:317
Switch vector property descriptor.
Definition indiapi.h:365