Instrument Neutral Distributed Interface INDI 2.2.5
drivers/telescope/lx200ap_gtocp2.h
Go to the documentation of this file.
1/*
2 Astro-Physics INDI driver
3
4 Tailored for GTOCP2
5
6 Copyright (C) 2018 Jasem Mutlaq
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
28{
29 public:
32
34
35 virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override;
36 virtual void ISGetProperties(const char *dev) override;
37
38 protected:
39 virtual const char *getDefaultName() override;
40 virtual bool initProperties() override;
41 virtual bool updateProperties() override;
42
43 virtual bool ReadScopeStatus() override;
44 virtual bool Handshake() override;
45 virtual bool Disconnect() override;
46
47 // Parking
48 virtual bool SetCurrentPark() override;
49 virtual bool SetDefaultPark() override;
50 virtual bool Park() override;
51 virtual bool UnPark() override;
52
53 virtual bool Sync(double ra, double dec) override;
54 virtual bool Goto(double, double) override;
55 virtual bool updateTime(ln_date *utc, double utc_offset) override;
56 virtual bool updateLocation(double latitude, double longitude, double elevation) override;
57 virtual bool SetSlewRate(int index) override;
58
59 virtual int SendPulseCmd(int8_t direction, uint32_t duration_msec) override;
60
61 virtual bool getUTFOffset(double *offset) override;
62
63 // Tracking
64 virtual bool SetTrackMode(uint8_t mode) override;
65 virtual bool SetTrackEnabled(bool enabled) override;
66 virtual bool SetTrackRate(double raRate, double deRate) override;
67
68 // NSWE Motion Commands
69 virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override;
70 virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override;
71
72 virtual bool saveConfigItems(FILE *fp) override;
73
74 virtual void debugTriggered(bool enable) override;
75
77
79
81
82 INDI::PropertySwitch APSlewSpeedSP {3}; // 600x, 900x, 1200x
83
85
86 INDI::PropertySwitch SyncCMRSP {2}; // :CM#, :CMR#
88
89 INDI::PropertySwitch APGuideSpeedSP {3}; // 0.25x, 0.50x, 1.0x
90
91 INDI::PropertyText VersionTP {1}; // Firmware Version
92
93 private:
94 bool initMount();
95
96 // Side of pier
97 void syncSideOfPier();
98
99 bool timeUpdated = false, locationUpdated = false;
100 ControllerVersion firmwareVersion = MCV_UNKNOWN;
101
102 double currentAlt = 0, currentAz = 0;
103 double lastRA = 0, lastDE = 0;
104 double lastAZ = 0, lastAL = 0;
105
106 bool motionCommanded = true;
107 bool mountInitialized = false;
108};
int SetSlewRate(void)
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...
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual bool Handshake() override
perform handshake with device to check communication
virtual const char * getDefaultName() override
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
virtual bool Disconnect() override
Disconnect from device.
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
virtual int SendPulseCmd(int8_t direction, uint32_t duration_msec) override
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool getUTFOffset(double *offset) override
virtual void debugTriggered(bool enable) override
Inform driver that the debug option was triggered. This function is called after setDebug is triggere...
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool SetTrackRate(double raRate, double deRate) override
SetTrackRate Set custom tracking rates.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
virtual bool Park() override
Park the telescope to its home position.
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
double ra
double dec
ISState
Switch state.
Definition indiapi.h:148
INDI_DIR_WE
INDI_DIR_NS