Instrument Neutral Distributed Interface INDI 2.2.5
lx200ap_legacy.h
Go to the documentation of this file.
1/*
2 Astro-Physics INDI driver
3
4 Copyright (C) 2014 Jasem Mutlaq
5
6 Based on INDI Astrophysics Driver by Markus Wildi
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; 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; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21*/
22
23#pragma once
24
25#include "lx200generic.h"
26
27#define SYNCCM 0
28#define SYNCCMR 1
29
30#define NOTESTABLISHED 0
31#define ESTABLISHED 1
32#define MOUNTNOTINITIALIZED 0
33#define MOUNTINITIALIZED 1
34
36{
37 public:
40
43
44 virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
45 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
46 virtual void ISGetProperties(const char *dev) override;
47
48 protected:
49 virtual const char *getDefaultName() override;
50 virtual bool initProperties() override;
51 virtual bool updateProperties() override;
52
53 virtual bool ReadScopeStatus() override;
54 virtual bool Handshake() override;
55 virtual bool Disconnect() override;
56
57 // Parking
58 virtual bool SetCurrentPark() override;
59 virtual bool SetDefaultPark() override;
60 virtual bool Park() override;
61 virtual bool UnPark() override;
62
63 virtual bool Sync(double ra, double dec) override;
64 virtual bool Goto(double, double) override;
65 virtual bool updateTime(ln_date *utc, double utc_offset) override;
66 virtual bool updateLocation(double latitude, double longitude, double elevation) override;
67 virtual bool SetSlewRate(int index) override;
68
69 virtual int SendPulseCmd(int8_t direction, uint32_t duration_msec) override;
70
71 virtual bool getUTFOffset(double *offset) override;
72
73 // Tracking
74 virtual bool SetTrackMode(uint8_t mode) override;
75 virtual bool SetTrackEnabled(bool enabled) override;
76 virtual bool SetTrackRate(double raRate, double deRate) override;
77
78 virtual bool saveConfigItems(FILE *fp) override;
79
80 virtual void debugTriggered(bool enable) override;
81
84
87
90
93
94 ISwitch SwapS[2];
96
100
103
104 IText VersionT[1] {};
106
109
112
113 private:
114 bool isMountInit();
115 bool setBasicDataPart0();
116 bool setBasicDataPart1();
117
118 // Side of pier
119 void syncSideOfPier();
120
121 bool timeUpdated = false, locationUpdated = false;
122 ControllerVersion controllerType = MCV_UNKNOWN;
123 ServoVersion servoType = GTOCP_UNKNOWN;
124 uint8_t initStatus = MOUNTNOTINITIALIZED;
125};
virtual bool initProperties() override
Called to initialize basic properties required all the time.
ISwitchVectorProperty StartUpSP
Definition lx200ap.h:103
ISwitchVectorProperty APSlewSpeedSP
Definition lx200ap.h:114
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
ISwitchVectorProperty APGuideSpeedSP
Definition lx200ap.h:124
ISwitch APSlewSpeedS[3]
Definition lx200ap.h:113
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual int SendPulseCmd(int8_t direction, uint32_t duration_msec) override
virtual bool getUTFOffset(double *offset) override
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...
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
INumber HorizontalCoordsN[2]
Definition lx200ap.h:110
ISwitchVectorProperty SwapSP
Definition lx200ap.h:117
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
ISwitch APGuideSpeedS[3]
Definition lx200ap.h:123
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool ReadScopeStatus() override
Read telescope status.
ISwitch SwapS[2]
Definition lx200ap.h:116
ISwitch SyncCMRS[2]
Definition lx200ap.h:119
INumberVectorProperty SlewAccuracyNP
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
IText VersionT[1]
Definition lx200ap.h:135
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
virtual bool Park() override
Park the telescope to its home position.
ITextVectorProperty VersionTP
Definition lx200ap.h:136
ISwitch StartUpS[2]
Definition lx200ap.h:102
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual bool Handshake() override
perform handshake with device to check communication
INumberVectorProperty HorizontalCoordsNP
Definition lx200ap.h:111
virtual bool SetTrackRate(double raRate, double deRate) override
SetTrackRate Set custom tracking rates.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
INumber SlewAccuracyN[2]
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
INumber HourangleCoordsN[2]
Definition lx200ap.h:105
virtual bool SetSlewRate(int index) override
SetSlewRate Set desired slew rate index.
ISwitchVectorProperty SyncCMRSP
Definition lx200ap.h:120
virtual const char * getDefaultName() override
virtual bool Disconnect() override
Disconnect from device.
INumberVectorProperty HourangleCoordsNP
Definition lx200ap.h:106
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 Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
virtual void debugTriggered(bool enable) override
Inform driver that the debug option was triggered. This function is called after setDebug is triggere...
ITextVectorProperty DeclinationAxisTP
double ra
double dec
ISState
Switch state.
Definition indiapi.h:148
#define MOUNTNOTINITIALIZED
One number descriptor.
One switch descriptor.
One text descriptor.
Number vector property descriptor.
Definition indiapi.h:317
Switch vector property descriptor.
Definition indiapi.h:365
Text vector property descriptor.
Definition indiapi.h:244