Instrument Neutral Distributed Interface INDI 2.2.5
paramount.h
Go to the documentation of this file.
1/*******************************************************************************
2 Copyright(c) 2017 Jasem Mutlaq. All rights reserved.
3
4 Driver for using TheSky6 Pro Scripted operations for mounts via the TCP server.
5 While this technically can operate any mount connected to the TheSky6 Pro, it is
6 intended for Paramount mounts control.
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License version 2 as published by the Free Software Foundation.
11 .
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16 .
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*******************************************************************************/
22
23#pragma once
24
25#include "indiguiderinterface.h"
26#include "inditelescope.h"
27#include "inditimer.h"
28
30{
31 public:
32 Paramount();
33 virtual ~Paramount() = default;
34
35 virtual const char *getDefaultName() override;
36 virtual bool Handshake() override;
37 virtual bool ReadScopeStatus() override;
38 virtual bool initProperties() override;
39 virtual bool updateProperties() override;
40
41 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override;
42
43 protected:
44 virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override;
45 virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override;
46 virtual bool Abort() override;
47
48 virtual bool updateTime(ln_date *utc, double utc_offset) override;
49
50 virtual bool SetParkPosition(double Axis1Value, double Axis2Value) override;
51 virtual bool Goto(double, double) override;
52 virtual bool Park() override;
53 virtual bool UnPark() override;
54 virtual bool Sync(double ra, double dec) override;
55
56 // Tracking
57 virtual bool SetTrackMode(uint8_t mode) override;
58 virtual bool SetTrackRate(double raRate, double deRate) override;
59 virtual bool SetTrackEnabled(bool enabled) override;
60
61 // Parking
62 virtual bool SetCurrentPark() override;
63 virtual bool SetDefaultPark() override;
64
65 // Guiding
66 virtual IPState GuideNorth(uint32_t ms) override;
67 virtual IPState GuideSouth(uint32_t ms) override;
68 virtual IPState GuideEast(uint32_t ms) override;
69 virtual IPState GuideWest(uint32_t ms) override;
70 // these all call these two functions
71 IPState GuideNS(int32_t ms);
72 IPState GuideWE(int32_t ms);
73
74 // Home
75 virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override;
76
77 private:
78 void mountSim();
79 bool getMountRADE();
80 bool isSlewComplete();
81
82 bool sendTheSkyOKCommand(const char *command, const char *errorMessage, uint8_t timeout = 3);
83 bool isTheSkyParked();
84 bool isTheSkyTracking();
85 bool startOpenLoopMotion(uint8_t motion, uint16_t rate);
86 bool stopOpenLoopMotion();
87 bool setTheSkyTracking(bool enable, bool isSidereal, double raRate, double deRate);
89
90 // Homing
91 bool findHome();
92
93 double currentRA { 0 };
94 double currentDEC { 90 };
95 double targetRA { 0 };
96 double targetDEC { 0 };
97
98 unsigned int DBG_SCOPE { 0 };
99
100 // Jog Rate
101 INumber JogRateN[2];
102 INumberVectorProperty JogRateNP;
103
104 // Guide Rate
105 INumber GuideRateN[2];
106 INumberVectorProperty GuideRateNP;
107
108 // Tracking Mode
109 ISwitch TrackModeS[4];
110 ISwitchVectorProperty TrackModeSP;
111
112 // Timers
113 INDI::Timer m_NSTimer;
114 INDI::Timer m_WETimer;
115 // Tracking Rate
116 // INumber TrackRateN[2];
117 // INumberVectorProperty TrackRateNP;
118};
The Timer class provides repetitive and single-shot timers.
Definition inditimer.h:41
virtual bool SetTrackEnabled(bool enabled) override
SetTrackEnabled Engages or disengages mount tracking. If there are no tracking modes available,...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool updateProperties() override
Called when connected state changes, to add/remove properties.
virtual IPState GuideWest(uint32_t ms) override
Guide west for ms milliseconds. West is defined as RA-.
virtual IPState GuideNorth(uint32_t ms) override
Guide north for ms milliseconds. North is defined as DEC+.
virtual bool initProperties() override
Called to initialize basic properties required all the time.
virtual bool SetTrackMode(uint8_t mode) override
SetTrackMode Set active tracking mode. Do not change track state.
virtual bool SetTrackRate(double raRate, double deRate) override
SetTrackRate Set custom tracking rates.
virtual IPState GuideEast(uint32_t ms) override
Guide east for ms milliseconds. East is defined as RA+.
virtual bool SetDefaultPark() override
SetDefaultPark Set default coordinates/encoders value as the desired parking position.
virtual bool MoveWE(INDI_DIR_WE dir, TelescopeMotionCommand command) override
Move the telescope in the direction dir.
virtual bool Sync(double ra, double dec) override
Set the telescope current RA and DEC coordinates to the supplied RA and DEC coordinates.
IPState GuideNS(int32_t ms)
IPState GuideWE(int32_t ms)
virtual bool ReadScopeStatus() override
Read telescope status.
virtual bool updateTime(ln_date *utc, double utc_offset) override
Update telescope time, date, and UTC offset.
virtual bool Goto(double, double) override
Move the scope to the supplied RA and DEC coordinates.
virtual bool UnPark() override
Unpark the telescope if already parked.
virtual bool Abort() override
Abort any telescope motion including tracking if possible.
virtual bool SetCurrentPark() override
SetCurrentPark Set current coordinates/encoders value as the desired parking position.
virtual IPState ExecuteHomeAction(TelescopeHomeAction action) override
Execute a homing action.
virtual bool Park() override
Park the telescope to its home position.
virtual bool Handshake() override
perform handshake with device to check communication
virtual bool MoveNS(INDI_DIR_NS dir, TelescopeMotionCommand command) override
Start or Stop the telescope motion in the direction dir.
virtual IPState GuideSouth(uint32_t ms) override
Guide south for ms milliseconds. South is defined as DEC-.
virtual bool SetParkPosition(double Axis1Value, double Axis2Value) override
SetParkPosition Set desired parking position to the supplied value. This ONLY sets the desired park p...
virtual const char * getDefaultName() override
virtual ~Paramount()=default
double ra
double dec
IPState
Property state.
Definition indiapi.h:158
INDI_DIR_WE
INDI_DIR_NS
One number descriptor.
One switch descriptor.
Number vector property descriptor.
Definition indiapi.h:317
Switch vector property descriptor.
Definition indiapi.h:365