Instrument Neutral Distributed Interface INDI  1.9.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 
35 class LX200AstroPhysics : public LX200Generic
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 
82  ISwitch StartUpS[2];
84 
87 
90 
93 
94  ISwitch SwapS[2];
96 
97  ISwitch SyncCMRS[2];
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 };
LX200Generic
Definition: lx200generic.h:25
LX200AstroPhysics::Goto
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
Definition: lx200ap.cpp:1138
LX200AstroPhysics::Park
virtual bool Park() override
Park the telescope to its home position.
Definition: lx200ap.cpp:1740
LX200AstroPhysics::GTOCP4
@ GTOCP4
Definition: lx200ap.h:38
LX200AstroPhysics::USE_REGULAR_SYNC
@ USE_REGULAR_SYNC
Definition: lx200ap.h:121
MOUNTNOTINITIALIZED
#define MOUNTNOTINITIALIZED
Definition: lx200ap_legacy.h:32
LX200AstroPhysics::MCV_UNKNOWN
@ MCV_UNKNOWN
Definition: lx200ap.h:36
LX200AstroPhysics::APSlewSpeedS
ISwitch APSlewSpeedS[3]
Definition: lx200ap.h:113
LX200AstroPhysics::MCV_J
@ MCV_J
Definition: lx200ap.h:34
LX200AstroPhysics::SetTrackRate
virtual bool SetTrackRate(double raRate, double deRate) override
SetTrackRate Set custom tracking rates.
Definition: lx200ap.cpp:2202
ISwitch
One switch descriptor.
LX200AstroPhysics::UnPark
virtual bool UnPark() override
Unpark the telescope if already parked.
Definition: lx200ap.cpp:1868
INumber
One number descriptor.
LX200AstroPhysics::saveConfigItems
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
Definition: lx200ap.cpp:2149
LX200AstroPhysics::VersionT
IText VersionT[1]
Definition: lx200ap.h:135
LX200AstroPhysics::Disconnect
virtual bool Disconnect() override
Disconnect from device.
Definition: lx200ap.cpp:1544
LX200AstroPhysics::VersionTP
ITextVectorProperty VersionTP
Definition: lx200ap.h:136
LX200AstroPhysics::LX200AstroPhysics
LX200AstroPhysics()
Definition: lx200ap.cpp:54
LX200AstroPhysics::GTOCP_UNKNOWN
@ GTOCP_UNKNOWN
Definition: lx200ap.h:38
LX200AstroPhysics::debugTriggered
virtual void debugTriggered(bool enable) override
Inform driver that the debug option was triggered. This function is called after setDebug is triggere...
Definition: lx200ap.cpp:1717
LX200AstroPhysics::SwapSP
ISwitchVectorProperty SwapSP
Definition: lx200ap.h:117
LX200AstroPhysics::MCV_G
@ MCV_G
Definition: lx200ap.h:34
LX200AstroPhysics::ControllerVersion
ControllerVersion
Definition: lx200ap.h:34
lx200generic.h
LX200AstroPhysics::SyncCMRS
ISwitch SyncCMRS[2]
Definition: lx200ap.h:119
LX200AstroPhysics::ReadScopeStatus
virtual bool ReadScopeStatus() override
Read telescope status.
Definition: lx200ap.cpp:850
LX200AstroPhysics::MCV_L
@ MCV_L
Definition: lx200ap.h:35
LX200AstroPhysics::StartUpS
ISwitch StartUpS[2]
Definition: lx200ap.h:102
_ITextVectorProperty
Text vector property descriptor.
Definition: indiapi.h:244
LX200AstroPhysics::SetTrackMode
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
Definition: lx200ap.cpp:2163
LX200AstroPhysics::GTOCP2
@ GTOCP2
Definition: lx200ap.h:38
LX200AstroPhysics::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: lx200ap.cpp:176
LX200AstroPhysics::APGuideSpeedSP
ISwitchVectorProperty APGuideSpeedSP
Definition: lx200ap.h:124
LX200AstroPhysics::GTOCP1
@ GTOCP1
Definition: lx200ap.h:38
_INumberVectorProperty
Number vector property descriptor.
Definition: indiapi.h:317
LX200AstroPhysics::APGuideSpeedS
ISwitch APGuideSpeedS[3]
Definition: lx200ap.h:123
LX200AstroPhysics::getUTFOffset
virtual bool getUTFOffset(double *offset) override
Definition: lx200ap.cpp:2229
LX200AstroPhysics::DeclinationAxisTP
ITextVectorProperty DeclinationAxisTP
Definition: lx200ap_legacy.h:108
LX200AstroPhysics::DeclinationAxisT
IText DeclinationAxisT[1]
Definition: lx200ap_legacy.h:107
LX200AstroPhysics::SetDefaultPark
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
Definition: lx200ap.cpp:2096
ra
double ra
Definition: ieqprolegacydriver.cpp:43
IText
One text descriptor.
LX200AstroPhysics::MCV_I
@ MCV_I
Definition: lx200ap.h:34
LX200AstroPhysics::Handshake
virtual bool Handshake() override
perform handshake with device to check communication
Definition: lx200ap.cpp:1469
LX200AstroPhysics::updateLocation
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
Definition: lx200ap.cpp:1673
LX200AstroPhysics::~LX200AstroPhysics
~LX200AstroPhysics()
Definition: lx200ap_legacy.h:39
LX200AstroPhysics::APSlewSpeedSP
ISwitchVectorProperty APSlewSpeedSP
Definition: lx200ap.h:114
LX200AstroPhysics::MCV_H
@ MCV_H
Definition: lx200ap.h:34
LX200AstroPhysics::SendPulseCmd
virtual int SendPulseCmd(int8_t direction, uint32_t duration_msec) override
Definition: lx200ap.cpp:1464
dec
double dec
Definition: ieqprolegacydriver.cpp:44
LX200AstroPhysics::initProperties
virtual bool initProperties() override
Called to initialize basic properties required all the time.
Definition: lx200ap.cpp:79
LX200AstroPhysics::SyncCMRSP
ISwitchVectorProperty SyncCMRSP
Definition: lx200ap.h:120
LX200AstroPhysics::SwapS
ISwitch SwapS[2]
Definition: lx200ap.h:116
LX200AstroPhysics::updateTime
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
Definition: lx200ap.cpp:1610
LX200AstroPhysics::StartUpSP
ISwitchVectorProperty StartUpSP
Definition: lx200ap.h:103
LX200AstroPhysics::HourangleCoordsNP
INumberVectorProperty HourangleCoordsNP
Definition: lx200ap.h:106
LX200AstroPhysics::HorizontalCoordsN
INumber HorizontalCoordsN[2]
Definition: lx200ap.h:110
LX200AstroPhysics::getDefaultName
virtual const char * getDefaultName() override
Definition: lx200ap.cpp:61
LX200AstroPhysics::SetCurrentPark
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
Definition: lx200ap.cpp:2075
LX200AstroPhysics
Definition: lx200ap.h:29
LX200AstroPhysics::USE_CMR_SYNC
@ USE_CMR_SYNC
Definition: lx200ap.h:121
LX200AstroPhysics::GTOCP3
@ GTOCP3
Definition: lx200ap.h:38
name
const char * name
Definition: indiserver.c:116
LX200AstroPhysics::ISNewSwitch
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
Definition: lx200ap.cpp:506
LX200AstroPhysics::SetTrackEnabled
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
Definition: lx200ap.cpp:2189
LX200AstroPhysics::SlewAccuracyN
INumber SlewAccuracyN[2]
Definition: lx200ap_legacy.h:110
LX200AstroPhysics::ISNewNumber
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition: lx200ap.cpp:446
ISState
ISState
Switch state.
Definition: indiapi.h:148
LX200AstroPhysics::HourangleCoordsN
INumber HourangleCoordsN[2]
Definition: lx200ap.h:105
LX200AstroPhysics::HorizontalCoordsNP
INumberVectorProperty HorizontalCoordsNP
Definition: lx200ap.h:111
LX200AstroPhysics::ServoVersion
ServoVersion
Definition: lx200ap.h:38
LX200AstroPhysics::SetSlewRate
virtual bool SetSlewRate(int index) override
SetSlewRate Set desired slew rate index.
Definition: lx200ap.cpp:1729
LX200AstroPhysics::updateProperties
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
Definition: lx200ap.cpp:203
LX200AstroPhysics::SlewAccuracyNP
INumberVectorProperty SlewAccuracyNP
Definition: lx200ap_legacy.h:111
LX200AstroPhysics::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: lx200ap.cpp:1558
_ISwitchVectorProperty
Switch vector property descriptor.
Definition: indiapi.h:365