Instrument Neutral Distributed Interface INDI 2.2.5
ieqpro.h
Go to the documentation of this file.
1/*
2 INDI IEQ Pro driver
3
4 Copyright (C) 2015 Jasem Mutlaq
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 <memory>
24
25#include "ieqdriverbase.h"
26#include "indiguiderinterface.h"
27#include "inditelescope.h"
28
30{
31 public:
32 IEQPro();
33
34 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
35
36 protected:
37 virtual const char *getDefaultName() override;
38
39 virtual bool Handshake() override;
40
41 virtual bool initProperties() override;
42 virtual bool updateProperties() override;
43
44 virtual bool ReadScopeStatus() override;
45
46 virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override;
47 virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override;
48
49 virtual bool saveConfigItems(FILE *fp) override;
50
51 virtual bool Park() override;
52 virtual bool UnPark() override;
53
54 virtual bool Sync(double ra, double dec) override;
55 virtual bool Goto(double, double) override;
56 virtual bool Abort() override;
57
58 virtual bool updateTime(ln_date *utc, double utc_offset) override;
59 virtual bool updateLocation(double latitude, double longitude, double elevation) override;
60
61 virtual void debugTriggered(bool enable) override;
62 virtual void simulationTriggered(bool enable) override;
63
64 // Parking
65 virtual bool SetCurrentPark() override;
66 virtual bool SetDefaultPark() override;
67
68 // Track Mode
69 virtual bool SetTrackMode(uint8_t mode) override;
70
71 // Track Rate
72 virtual bool SetTrackRate(double raRate, double deRate) override;
73
74 // Track On/Off
75 virtual bool SetTrackEnabled(bool enabled) override;
76
77 // Slew Rate
78 virtual bool SetSlewRate(int index) override;
79
80 // Homing
81 virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override;
82
83 // Sim
84 //void mountSim();
85
86 // Guide
87 virtual IPState GuideNorth(uint32_t ms) override;
88 virtual IPState GuideSouth(uint32_t ms) override;
89 virtual IPState GuideEast(uint32_t ms) override;
90 virtual IPState GuideWest(uint32_t ms) override;
91
92 private:
96 void getStartupData();
97
98 /* Firmware */
99 IText FirmwareT[5] {};
100 ITextVectorProperty FirmwareTP;
101
102 /* Tracking Mode */
103 //ISwitchVectorProperty TrackModeSP;
104 //ISwitch TrackModeS[4];
105
106 /* Custom Tracking Rate */
107 //INumber CustomTrackRateN[1];
108 //INumberVectorProperty CustomTrackRateNP;
109
110 /* GPS Status */
111 ISwitch GPSStatusS[3];
112 ISwitchVectorProperty GPSStatusSP;
113
114 /* Time Source */
115 ISwitch TimeSourceS[3];
116 ISwitchVectorProperty TimeSourceSP;
117
118 /* Hemisphere */
119 ISwitch HemisphereS[2];
120 ISwitchVectorProperty HemisphereSP;
121
122 /* Home Control */
123 // ISwitch HomeS[3];
124 // ISwitchVectorProperty HomeSP;
125
126 /* Guide Rate */
127 INumber GuideRateN[2];
128 INumberVectorProperty GuideRateNP;
129
130 unsigned int DBG_SCOPE;
131 double currentRA = 0, currentDEC = 0;
132 double targetRA = 0, targetDEC = 0;
133
134 bool canParkNatively { false };
135 bool canFindHome { false };
136 bool canGuideRate { false };
137 bool slewDirty { false };
138
139 iEQ::Base::Info scopeInfo;
140 iEQ::Base::FirmwareInfo firmwareInfo;
141 std::unique_ptr<iEQ::Base> driver;
142};
int SetSlewRate(void)
virtual IPState GuideSouth(uint32_t ms) override
Guide south for ms milliseconds. South is defined as DEC-.
Definition ieqpro.cpp:822
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
Definition ieqpro.cpp:998
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
Definition ieqpro.cpp:846
IEQPro()
Definition ieqpro.cpp:44
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
Definition ieqpro.cpp:491
virtual bool initProperties() override
Called to initialize basic properties required all the time.
Definition ieqpro.cpp:71
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
Definition ieqpro.cpp:537
virtual IPState GuideNorth(uint32_t ms) override
Guide north for ms milliseconds. North is defined as DEC+.
Definition ieqpro.cpp:816
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
Definition ieqpro.cpp:958
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
Definition ieqpro.cpp:163
virtual bool Handshake() override
perform handshake with device to check communication
Definition ieqpro.cpp:652
virtual bool UnPark() override
Unpark the telescope if already parked.
Definition ieqpro.cpp:639
virtual void debugTriggered(bool enable) override
Inform driver that the debug option was triggered. This function is called after setDebug is triggere...
Definition ieqpro.cpp:737
virtual void simulationTriggered(bool enable) override
Inform driver that the simulation option was triggered. This function is called after setSimulation i...
Definition ieqpro.cpp:742
virtual IPState GuideWest(uint32_t ms) override
Guide west for ms milliseconds. West is defined as RA-.
Definition ieqpro.cpp:834
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
Definition ieqpro.cpp:941
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
Definition ieqpro.cpp:560
virtual IPState GuideEast(uint32_t ms) override
Guide east for ms milliseconds. East is defined as RA+.
Definition ieqpro.cpp:828
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
Definition ieqpro.cpp:782
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
Definition ieqpro.cpp:674
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
Definition ieqpro.cpp:312
virtual const char * getDefaultName() override
Definition ieqpro.cpp:66
virtual bool ReadScopeStatus() override
Read telescope status.
Definition ieqpro.cpp:339
virtual bool SetTrackRate(double raRate, double deRate) override
SetTrackRate Set custom tracking rates.
Definition ieqpro.cpp:979
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
Definition ieqpro.cpp:748
virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override
Execute a homing action.
Definition ieqpro.cpp:1012
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
Definition ieqpro.cpp:969
virtual bool Park() override
Park the telescope to its home position.
Definition ieqpro.cpp:565
virtual bool updateLocation(double latitude, double longitude, double elevation) override
Update telescope location settings.
Definition ieqpro.cpp:709
double ra
double dec
IPState
Property state.
Definition indiapi.h:158
INDI_DIR_WE
INDI_DIR_NS
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