Instrument Neutral Distributed Interface INDI  2.0.2
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 
30  {
34  };
35 
37  {
43  };
44 
46  {
47  GSTAT_UNSET = -999,
61  GSTAT_ERROR = 99
62  };
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
72  ALP_COUNT
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 
92  {
98  };
99 
100  LX200_10MICRON();
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  bool updateProperties() override;
111  bool saveConfigItems(FILE *fp) override;
112  bool ReadScopeStatus() override;
113  bool Park() override;
114  bool UnPark() override;
115  bool flip();
117  bool setUnattendedFlipSetting(bool setting);
118  bool SyncConfigBehaviour(bool cmcfg);
119  bool setLocalDate(uint8_t days, uint8_t months, uint16_t years) override;
120  bool SetTLEtoFollow(const char *tle);
121  bool SetTLEfromDatabase(int tleN);
122  bool TrackSat();
123  bool CalculateSatTrajectory(std::string start_pass_isodatetime, std::string end_pass_isodatetime);
124 
125  int AddSyncPoint(double MRa, double MDec, double MSide, double PRa, double PDec, double SidTime);
126  int AddSyncPointHere(double PRa, double PDec);
127 
128  // TODO move these things elsewhere
129  int monthToNumber(const char *monthName);
130  int setStandardProcedureWithoutRead(int fd, const char *data);
131  int setStandardProcedureAndExpectChar(int fd, const char *data, const char *expect);
132  int setStandardProcedureAndReturnResponse(int fd, const char *data, char *response, int max_response_length);
133 
134  protected:
135  void getBasicData() override;
136 
137  int UnattendedFlip = -1;
140 
143 
144  virtual int SetRefractionModelTemperature(double temperature);
147 
148  virtual int SetRefractionModelPressure(double pressure);
151 
154 
157 
160 
165 
168 
171 
174 
177 
178 
179  private:
180  int fd = -1; // short notation for PortFD/sockfd
181  bool getMountInfo();
182 
183  int OldGstat = GSTAT_UNSET;
184  struct _Ginfo
185  {
186  float RA_JNOW = 0.0;
187  float DEC_JNOW = 0.0;
188  char SideOfPier = 'x';
189  float AZ = 0.0;
190  float ALT = 0.0;
191  float Jdate = 0.0;
192  int Gstat = -1;
193  int SlewStatus = -1;
194  // added :
195  double SiderealTime = -1;
196  } Ginfo;
197  int AlignmentState = ALIGN_IDLE;
198 
199 };
LX200_10MICRON_MINI_ALIGNMENT_POINT
INumber RefractionModelTemperatureN[1]
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)
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)
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_TRACKING_OUTSIDE_LIMITS
@ 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.
INumber MiniNewAlpRON[MALPRO_COUNT]
INumber ModelCountN[1]
bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual int SetRefractionModelTemperature(double temperature)
bool Park() override
Park the telescope to its home position.
bool SyncConfigBehaviour(bool cmcfg)
INumberVectorProperty MiniNewAlpRONP
ISwitchVectorProperty UnattendedFlipSP
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]
ISState
Switch state.
Definition: indiapi.h:150
@ ALT
altitude|declination axis motor
One number descriptor.
One switch descriptor.
One text descriptor.
Number vector property descriptor.
Definition: indiapi.h:319
Switch vector property descriptor.
Definition: indiapi.h:367
Text vector property descriptor.
Definition: indiapi.h:246