Instrument Neutral Distributed Interface INDI 2.2.5
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:
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 ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override;
39
40 protected:
41 // virtual void getBasicData(void) override;
42 //FocuserInterface
43
44 IPState MoveFocuser(FocusDirection dir, int speed, uint16_t duration) override;
45 IPState MoveAbsFocuser (uint32_t targetTicks) override;
46 IPState MoveRelFocuser (FocusDirection dir, uint32_t ticks) override;
47 virtual bool SetFocuserBacklash(int32_t steps) override;
48 virtual bool AbortFocuser () override;
49 virtual bool ReadScopeStatus() override;
50 virtual bool SyncFocuser(uint32_t ticks) override;
51 virtual bool SetTrackEnabled(bool enabled) override;
52
53 // Home
54 virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override;
55
56 //End FocuserInterface
57
58 private:
59 virtual char getCommandChar(int fd, const char *cmd);
60 virtual int executeMeadeCommand(const char *cmd, char *data);
61 virtual bool executeMeadeCommandBlind(const char *cmd);
62 //virtual int executeMeadeCommandNumber(const char *cmd);
63 virtual int flushIO(int fd);
64 int OATUpdateProperties();
65 int OATUpdateFocuser();
66 void initFocuserProperties(const char *);
67
68 private:
69 IText MeadeCommandT;
70 ITextVectorProperty MeadeCommandTP;
71
72 INumber PolarAlignAltN;
73 INumberVectorProperty PolarAlignAltNP;
74
75 INumber PolarAlignAzN;
76 INumberVectorProperty PolarAlignAzNP;
77
78 INumber RAHomeN;
79 INumberVectorProperty RAHomeNP;
80
81 INumber RAHomeOffsetN;
82 INumberVectorProperty RAHomeOffsetNP;
83
84 INumber DecLimitsN[2];
85 INumberVectorProperty DecLimitsNP;
86
87 // ISwitchVectorProperty HomeSP;
88 // ISwitch HomeS;
89
90 char MeadeCommandResult[1024];
91 int32_t FocuserBacklash;
92 bool PolarActive;
93 INDI::FocuserInterface::FocusDirection FocuserDirectionLast;
94};
95
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 SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
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 bool SyncFocuser(uint32_t ticks) override
SyncFocuser Set current position to ticks without moving the focuser.
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.
virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override
Execute a homing action.
IPState
Property state.
Definition indiapi.h:158
int fd
uint8_t cmd[4]
Definition pwc-ioctl.h:2
One number descriptor.
One text descriptor.
Number vector property descriptor.
Definition indiapi.h:317
Text vector property descriptor.
Definition indiapi.h:244