Instrument Neutral Distributed Interface INDI  2.0.2
lx200_OpenAstroTech.h
Go to the documentation of this file.
1 /*
2  OpenAstroTech
3  Copyright (C) 2021 Anjo Krank
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 */
20 
21 #pragma once
22 
23 #include "lx200gps.h"
24 
25 #define MAJOR_VERSION 0
26 #define MINOR_VERSION 9
27 
29 {
30  public:
31  LX200_OpenAstroTech(void);
32 
33  virtual bool Handshake() override;
34  virtual const char *getDefaultName(void) override;
35  virtual bool initProperties() override;
36  virtual bool updateProperties() override;
37  virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
38  virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
39  virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
40 
41  protected:
42 // virtual void getBasicData(void) override;
43  //FocuserInterface
44 
45  IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override;
46  IPState MoveAbsFocuser (uint32_t targetTicks) override;
47  IPState MoveRelFocuser (FocusDirection dir, uint32_t ticks) override;
48  virtual bool SetFocuserBacklash(int32_t steps) override;
49  virtual bool AbortFocuser () override;
50  virtual bool ReadScopeStatus() override;
51 
52  //End FocuserInterface
53 
54  private:
55  virtual char getCommandChar(int fd, const char *cmd);
56  virtual int executeMeadeCommand(const char *cmd, char *data);
57  virtual bool executeMeadeCommandBlind(const char *cmd);
58  virtual int flushIO(int fd);
59  int OATUpdateProperties();
60  int OATUpdateFocuser();
61  void initFocuserProperties(const char *);
62 
63  private:
64  IText MeadeCommandT;
65  ITextVectorProperty MeadeCommandTP;
66 
67  INumber PolarAlignAltN;
68  INumberVectorProperty PolarAlignAltNP;
69 
70  INumber PolarAlignAzN;
71  INumberVectorProperty PolarAlignAzNP;
72 
73  INumber RAHomeN;
74  INumberVectorProperty RAHomeNP;
75 
76  INumber RAHomeOffsetN;
77  INumberVectorProperty RAHomeOffsetNP;
78 
79  INumber DecLimitsN[2];
80  INumberVectorProperty DecLimitsNP;
81 
82  ISwitchVectorProperty HomeSP;
83  ISwitch HomeS;
84 
85  char MeadeCommandResult[1024];
86  int32_t FocuserBacklash;
87  bool PolarActive;
88  INDI::FocuserInterface::FocusDirection FocuserDirectionLast;
89 };
90 
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool AbortFocuser() override
AbortFocuser all focus motion.
IPState MoveAbsFocuser(uint32_t targetTicks) override
MoveFocuser the focuser to an absolute position.
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual const char * getDefaultName(void) override
IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override
MoveFocuser the focuser in a particular direction with a specific speed for a finite duration.
virtual bool SetFocuserBacklash(int32_t steps) override
SetFocuserBacklash Set the focuser backlash compensation value.
IPState MoveRelFocuser(FocusDirection dir, uint32_t ticks) override
MoveFocuser the focuser to an relative position.
ISState
Switch state.
Definition: indiapi.h:150
IPState
Property state.
Definition: indiapi.h:160
int fd
Definition: intelliscope.c:43
__u8 cmd[4]
Definition: pwc-ioctl.h:2
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