Instrument Neutral Distributed Interface INDI 2.2.5
lx200_10micron.h
Go to the documentation of this file.
1/*
2 10micron INDI driver
3
4 Copyright (C) 2017 Hans Lambermont
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
26{
27 public:
28
35
44
63
65 {
66 ALP_MRA, // Mount Right Ascension
67 ALP_MDEC, // Mount Declination
68 ALP_MSIDE, // Mount Pier Side
69 ALP_SIDTIME, // Sidereal Time
70 ALP_PRA, // Plate solved Right Ascension
71 ALP_PDEC, // Plate solved Declination
73 };
74
76 {
77 MALPRO_MRA, // Mount Right Ascension
78 MALPRO_MDEC, // Mount Declination
79 MALPRO_MSIDE, // Mount Pier Side
80 MALPRO_SIDTIME, // Sidereal Time
82 };
83
85 {
86 MALP_PRA, // Plate solved Right Ascension
87 MALP_PDEC, // Plate solved Declination
89 };
90
99
102
103 bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
104 bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
105 bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
106
107 const char *getDefaultName() override;
108 bool Handshake() override;
109 bool initProperties() override;
110 void ISGetProperties(const char *dev) override;
111 bool updateProperties() override;
112 bool saveConfigItems(FILE *fp) override;
113 bool ReadScopeStatus() override;
114 bool Park() override;
115 bool UnPark() override;
116 bool SetTrackEnabled(bool enabled) override;
117 bool Flip(double ra, double dec) override;
119 bool setUnattendedFlipSetting(bool setting);
120 bool SyncConfigBehaviour(bool cmcfg);
121 bool setLocalDate(uint8_t days, uint8_t months, uint16_t years) override;
122 bool SetTLEtoFollow(const char *tle);
123 bool SetTLEfromDatabase(int tleN);
124 bool TrackSat();
125 bool CalculateSatTrajectory(std::string start_pass_isodatetime, std::string end_pass_isodatetime);
126
127 int AddSyncPoint(double MRa, double MDec, double MSide, double PRa, double PDec, double SidTime);
128 int AddSyncPointHere(double PRa, double PDec);
129
130 // TODO move these things elsewhere
131 int monthToNumber(const char *monthName);
132 int setStandardProcedureWithoutRead(int fd, const char *data);
133 int setStandardProcedureAndExpectChar(int fd, const char *data, const char *expect);
134 int setStandardProcedureAndReturnResponse(int fd, const char *data, char *response, int max_response_length);
135
136 protected:
137 void getBasicData() override;
138
142
145
146 virtual int SetRefractionModelTemperature(double temperature);
149
150 virtual int SetRefractionModelPressure(double pressure);
153
156
159
162
167
170
173
176
179
180 // Wake on LAN
185
186 // Shutdown
188
189 private:
190 int fd = -1; // short notation for PortFD/sockfd
191 bool getMountInfo();
192 bool flip();
193 bool sendWakeOnLanPacket();
194 bool m_ShutdownPending { false };
195 void TimerHit() override;
196
197 int OldGstat = GSTAT_UNSET;
198 struct _Ginfo
199 {
200 float RA_JNOW = 0.0;
201 float DEC_JNOW = 0.0;
202 char SideOfPier = 'x';
203 float AZ = 0.0;
204 float ALT = 0.0;
205 float Jdate = 0.0;
206 int Gstat = -1;
207 int SlewStatus = -1;
208 // added :
209 double SiderealTime = -1;
210 } Ginfo;
211 int AlignmentState = ALIGN_IDLE;
212
213};
double temperature
INumber RefractionModelTemperatureN[1]
void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
void getBasicData() override
bool Handshake() override
perform handshake with device to check communication
bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
INumberVectorProperty ModelCountNP
INumberVectorProperty NewAlignmentPointsNP
ISwitchVectorProperty AlignmentStateSP
ITextVectorProperty NewModelNameTP
bool CalculateSatTrajectory(std::string start_pass_isodatetime, std::string end_pass_isodatetime)
INumberVectorProperty NewAlpNP
INumber NewAlignmentPointsN[1]
int setStandardProcedureAndExpectChar(int fd, const char *data, const char *expect)
ITextVectorProperty WoLMacTP
LX200_10MICRON_UNATTENDED_FLIP_SETTINGS
bool UnPark() override
Unpark the telescope if already parked.
LX200_10MICRON_MINI_ALIGNMENT_POINT_RO
int monthToNumber(const char *monthName)
INumberVectorProperty RefractionModelPressureNP
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
int setStandardProcedureWithoutRead(int fd, const char *data)
INumberVectorProperty RefractionModelTemperatureNP
bool SetTLEtoFollow(const char *tle)
ISwitchVectorProperty WoLSendSP
bool getUnattendedFlipSetting()
IText NewModelNameT[1]
ITextVectorProperty ProductTP
bool setLocalDate(uint8_t days, uint8_t months, uint16_t years) override
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
const char * getDefaultName() override
virtual int SetRefractionModelPressure(double pressure)
INumber MiniNewAlpN[MALP_COUNT]
bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
INumberVectorProperty TLEfromDatabaseNP
INumber NewAlpN[ALP_COUNT]
int setStandardProcedureAndReturnResponse(int fd, const char *data, char *response, int max_response_length)
@ GSTAT_NOT_TRACKING_AND_NOT_MOVING
bool ReadScopeStatus() override
Read telescope status.
ISwitch UnattendedFlipS[UNATTENDED_FLIP_COUNT]
bool initProperties() override
Called to initialize basic properties required all the time.
INDI::PropertySwitch MountShutdownSP
INumber MiniNewAlpRON[MALPRO_COUNT]
INumber ModelCountN[1]
bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual int SetRefractionModelTemperature(double temperature)
ISwitch WoLSendS[1]
bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
bool Park() override
Park the telescope to its home position.
bool SyncConfigBehaviour(bool cmcfg)
INumberVectorProperty MiniNewAlpRONP
ISwitchVectorProperty UnattendedFlipSP
bool Flip(double ra, double dec) override
Move and flip the scope to the supplied RA and DEC coordinates.
INumber TLEfromDatabaseN[1]
INumber AlignmentPointsN[1]
int AddSyncPoint(double MRa, double MDec, double MSide, double PRa, double PDec, double SidTime)
INumberVectorProperty MiniNewAlpNP
ISwitch AlignmentStateS[ALIGN_COUNT]
INumberVectorProperty AlignmentPointsNP
bool SetTLEfromDatabase(int tleN)
int AddSyncPointHere(double PRa, double PDec)
bool setUnattendedFlipSetting(bool setting)
INumber RefractionModelPressureN[1]
double ra
double dec
ISState
Switch state.
Definition indiapi.h:148
@ ALT
altitude|declination axis motor
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