X2 Standard  Version 1.28
Loading...
Searching...
No Matches
x2mount.h
1#pragma once
2#include "../../licensedinterfaces/mountdriverinterface.h"
3
4//Optional interfaces, uncomment and implement as required.
5//#include "../../licensedinterfaces/mount/slewtointerface.h"
6//#include "../../licensedinterfaces/mount/syncmountinterface.h"
7//#include "../../licensedinterfaces/mount/asymmetricalequatorialinterface.h"
8#include "../../licensedinterfaces/mount/openloopmoveinterface.h"
9//#include "../../licensedinterfaces/mount/needsrefractioninterface.h"
10//#include "../../licensedinterfaces/mount/linkfromuithreadinterface.h"
11//#include "../../licensedinterfaces/mount/trackingratesinterface.h"
12#include "../../licensedinterfaces/mount/pulseguideinterface2.h"
13
14// Forward declare the interfaces that the this driver is "given" by TheSkyX
15class SerXInterface;
19class LoggerInterface;
20class MutexInterface;
21class AbstractSyncMount;
23
32 //Optional interfaces, uncomment and implement as required.
33 //,public SyncMountInterface,
34 //,public SlewToInterface,
35 //,public AsymmetricalEquatorialInterface,
37 //,public NeedsRefractionInterface,
38 //,public LinkFromUIThreadInterface,
39 //,public TrackingRatesInterface
41{
42public:
44 X2Mount(const char* pszDriverSelection,
45 const int& nInstanceIndex,
46 SerXInterface * pSerX,
48 SleeperInterface * pSleeper,
49 BasicIniUtilInterface * pIniUtil,
50 LoggerInterface * pLogger,
51 MutexInterface * pIOMutex,
52 TickCountInterface * pTickCount);
53
54 ~X2Mount();
55
56// Operations
57public:
58
63 virtual int queryAbstraction(const char* pszName, void** ppVal) ;
65
69 virtual int establishLink(void) ;
70 virtual int terminateLink(void) ;
71 virtual bool isLinked(void) const ;
72 virtual bool isEstablishLinkAbortable(void) const ;
74
78 virtual void driverInfoDetailedInfo(BasicStringInterface& str) const;
79 virtual double driverInfoVersion(void) const ;
81
85 virtual void deviceInfoNameShort(BasicStringInterface& str) const ;
86 virtual void deviceInfoNameLong(BasicStringInterface& str) const ;
89 virtual void deviceInfoModel(BasicStringInterface& str) ;
91
92 virtual int raDec(double& ra, double& dec, const bool& bCached = false) ;
93 virtual int abort(void) ;
94
95 //Optional interfaces, uncomment and implement as required.
96
97 //SyncMountInterface
98 //virtual int syncMount(const double& ra, const double& dec) ;
99 //virtual bool isSynced() ;
100
101 //SlewToInterface
102 //virtual int startSlewTo(const double& dRa, const double& dDec) ;
103 //virtual int isCompleteSlewTo(bool& bComplete) const ;
104 //virtual int endSlewTo(void) ;
105
106 //AsymmetricalEquatorialInterface
107 //virtual bool knowsBeyondThePole();
108 //virtual int beyondThePole(bool& bYes);
109 //virtual double flipHourAngle();
110 //virtual int gemLimits(double& dHoursEast, double& dHoursWest);
111
112 //OpenLoopMoveInterface
113 virtual int startOpenLoopMove(const MountDriverInterface::MoveDir& Dir, const int& nRateIndex);
114 virtual int endOpenLoopMove(void) ;
115 virtual bool allowDiagonalMoves() ;
116 virtual int rateCountOpenLoopMove(void) const ;
117 virtual int rateNameFromIndexOpenLoopMove(const int& nZeroBasedIndex, char* pszOut, const int& nOutMaxSize);
118 virtual int rateIndexOpenLoopMove(void);
119
120 //NeedsRefractionInterface
121 //virtual bool needsRefactionAdjustments(void);
122
123 //LinkFromUIThreadInterface
124
125 //TrackingRatesInterface
126 //virtual int setTrackingRates( const bool& bTrackingOn, const bool& bIgnoreRates, const double& dRaRateArcSecPerSec, const double& dDecRateArcSecPerSec);
127 //virtual int trackingRates( bool& bTrackingOn, double& dRaRateArcSecPerSec, double& dDecRateArcSecPerSec);
128
129 //PulseGuideInterface
130 virtual int useOpenLoopMoveInterface(int& nGuideRateIndex, OpenLoopMoveInterface** pOLSI)
131 {
132 nGuideRateIndex = 2; // 2 is rate "1.0x"
133 return queryAbstraction(OpenLoopMoveInterface_Name, (void**)pOLSI);
134 }
135
136// Implementation
137private:
138
139 SerXInterface *GetSerX() {return m_pSerX; }
140 TheSkyXFacadeForDriversInterface *GetTheSkyXFacadeForMounts() {return m_pTheSkyXForMounts;}
141 SleeperInterface *GetSleeper() {return m_pSleeper; }
142 BasicIniUtilInterface *GetSimpleIniUtil() {return m_pIniUtil; }
143 LoggerInterface *GetLogger() {return m_pLogger; }
144 MutexInterface *GetMutex() {return m_pIOMutex;}
145 TickCountInterface *GetTickCountInterface() {return m_pTickCount;}
146
147
148 int m_nPrivateMulitInstanceIndex;
149 SerXInterface* m_pSerX;
150 TheSkyXFacadeForDriversInterface* m_pTheSkyXForMounts;
151 SleeperInterface* m_pSleeper;
152 BasicIniUtilInterface* m_pIniUtil;
153 LoggerInterface* m_pLogger;
154 MutexInterface* m_pIOMutex;
155 TickCountInterface* m_pTickCount;
156
157
158
159};
The BasicIniUtilInterface is used to make properties persistent.
Definition basiciniutilinterface.h:21
The BasicStringInterface allows a string as an output.
Definition basicstringinterface.h:17
DeviceType
Definition driverrootinterface.h:26
@ DT_MOUNT
Definition driverrootinterface.h:28
The LoggerInterface is a cross-platform logging utility passed to X2 implementors to show real-time,...
Definition loggerinterface.h:58
The MountDriverInterface allows an X2 implementor to a write X2 mount driver.
Definition mountdriverinterface.h:26
MoveDir
Definition mountdriverinterface.h:51
The MutexInterface provides a cross-platform mutex.
Definition mutexinterface.h:16
The OpenLoopMoveInterface allows a mount to move at a given rate for a open-ended amount of time.
Definition openloopmoveinterface.h:23
The PulseGuideInterface2 allows X2 mount drivers to be an integral part of TheSky's autoguiding by mo...
Definition pulseguideinterface2.h:30
The SerXInterface is a cross-plaform serial port.
Definition serxinterface.h:18
The SleeperInterface is a cross-platform "sleeper".
Definition sleeperinterface.h:15
The TheSkyXFacadeForDriversInterface is a simplified interface to TheSkyX passed to X2 implementors.
Definition theskyxfacadefordriversinterface.h:19
The TickCountInterface is a cross-platform way to measure relative timing.
Definition tickcountinterface.h:17
virtual int rateNameFromIndexOpenLoopMove(const int &nZeroBasedIndex, char *pszOut, const int &nOutMaxSize)
Definition x2mount.cpp:158
virtual double driverInfoVersion(void) const
Definition x2mount.cpp:102
virtual DeviceType deviceType(void)
Definition x2mount.h:62
virtual void driverInfoDetailedInfo(BasicStringInterface &str) const
Definition x2mount.cpp:98
virtual int queryAbstraction(const char *pszName, void **ppVal)
Definition x2mount.cpp:55
virtual int startOpenLoopMove(const MountDriverInterface::MoveDir &Dir, const int &nRateIndex)
Definition x2mount.cpp:142
virtual int abort(void)
Definition x2mount.cpp:136
virtual int rateCountOpenLoopMove(void) const
Definition x2mount.cpp:154
X2Mount(const char *pszDriverSelection, const int &nInstanceIndex, SerXInterface *pSerX, TheSkyXFacadeForDriversInterface *pTheSkyX, SleeperInterface *pSleeper, BasicIniUtilInterface *pIniUtil, LoggerInterface *pLogger, MutexInterface *pIOMutex, TickCountInterface *pTickCount)
Definition x2mount.cpp:15
virtual void deviceInfoDetailedDescription(BasicStringInterface &str) const
Definition x2mount.cpp:117
virtual int raDec(double &ra, double &dec, const bool &bCached=false)
Definition x2mount.cpp:132
virtual int rateIndexOpenLoopMove(void)
Definition x2mount.cpp:162
virtual void deviceInfoModel(BasicStringInterface &str)
Definition x2mount.cpp:126
virtual bool allowDiagonalMoves()
Definition x2mount.cpp:150
virtual int useOpenLoopMoveInterface(int &nGuideRateIndex, OpenLoopMoveInterface **pOLSI)
Definition x2mount.h:130
virtual void deviceInfoNameShort(BasicStringInterface &str) const
Definition x2mount.cpp:108
virtual int endOpenLoopMove(void)
Definition x2mount.cpp:146
virtual int terminateLink(void)
Definition x2mount.cpp:85
virtual void deviceInfoFirmwareVersion(BasicStringInterface &str)
Definition x2mount.cpp:122
virtual int establishLink(void)
Definition x2mount.cpp:81
virtual bool isLinked(void) const
Definition x2mount.cpp:89
virtual void deviceInfoNameLong(BasicStringInterface &str) const
Definition x2mount.cpp:112
X2 Examples
(C) 2026 Software Bisque, Inc. All rights reserved.