X2 Standard  Version 1.24
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 
13 // Forward declare the interfaces that the this driver is "given" by TheSkyX
14 class SerXInterface;
16 class SleeperInterface;
18 class LoggerInterface;
19 class MutexInterface;
20 class AbstractSyncMount;
21 class TickCountInterface;
22 
31  //Optional interfaces, uncomment and implement as required.
32  //,public SyncMountInterface,
33  //,public SlewToInterface,
34  //,public AsymmetricalEquatorialInterface,
35  //,public OpenLoopMoveInterface,
36  //,public NeedsRefractionInterface,
37  //,public LinkFromUIThreadInterface,
38  //,public TrackingRatesInterface
39 {
40 public:
42  X2Mount(const char* pszDriverSelection,
43  const int& nInstanceIndex,
44  SerXInterface * pSerX,
46  SleeperInterface * pSleeper,
47  BasicIniUtilInterface * pIniUtil,
48  LoggerInterface * pLogger,
49  MutexInterface * pIOMutex,
50  TickCountInterface * pTickCount);
51 
52  ~X2Mount();
53 
54 // Operations
55 public:
56 
61  virtual int queryAbstraction(const char* pszName, void** ppVal) ;
63 
67  virtual int establishLink(void) ;
68  virtual int terminateLink(void) ;
69  virtual bool isLinked(void) const ;
70  virtual bool isEstablishLinkAbortable(void) const ;
72 
76  virtual void driverInfoDetailedInfo(BasicStringInterface& str) const;
77  virtual double driverInfoVersion(void) const ;
79 
83  virtual void deviceInfoNameShort(BasicStringInterface& str) const ;
84  virtual void deviceInfoNameLong(BasicStringInterface& str) const ;
85  virtual void deviceInfoDetailedDescription(BasicStringInterface& str) const ;
87  virtual void deviceInfoModel(BasicStringInterface& str) ;
89 
90  virtual int raDec(double& ra, double& dec, const bool& bCached = false) ;
91  virtual int abort(void) ;
92 
93  //Optional interfaces, uncomment and implement as required.
94 
95  //SyncMountInterface
96  //virtual int syncMount(const double& ra, const double& dec) ;
97  //virtual bool isSynced() ;
98 
99  //SlewToInterface
100  //virtual int startSlewTo(const double& dRa, const double& dDec) ;
101  //virtual int isCompleteSlewTo(bool& bComplete) const ;
102  //virtual int endSlewTo(void) ;
103 
104  //AsymmetricalEquatorialInterface
105  //virtual bool knowsBeyondThePole();
106  //virtual int beyondThePole(bool& bYes);
107  //virtual double flipHourAngle();
108  //virtual int gemLimits(double& dHoursEast, double& dHoursWest);
109 
110  //OpenLoopMoveInterface
111  //virtual int startOpenLoopMove(const MountDriverInterface::MoveDir& Dir, const int& nRateIndex);
112  //virtual int endOpenLoopMove(void) ;
113  //virtual bool allowDiagonalMoves() ;
114  //virtual int rateCountOpenLoopMove(void) const ;
115  //virtual int rateNameFromIndexOpenLoopMove(const int& nZeroBasedIndex, char* pszOut, const int& nOutMaxSize);
116  //virtual int rateIndexOpenLoopMove(void);
117 
118  //NeedsRefractionInterface
119  //virtual bool needsRefactionAdjustments(void);
120 
121  //LinkFromUIThreadInterface
122 
123  //TrackingRatesInterface
124  //virtual int setTrackingRates( const bool& bTrackingOn, const bool& bIgnoreRates, const double& dRaRateArcSecPerSec, const double& dDecRateArcSecPerSec);
125  //virtual int trackingRates( bool& bTrackingOn, double& dRaRateArcSecPerSec, double& dDecRateArcSecPerSec);
126 
127 // Implementation
128 private:
129 
130  SerXInterface *GetSerX() {return m_pSerX; }
131  TheSkyXFacadeForDriversInterface *GetTheSkyXFacadeForMounts() {return m_pTheSkyXForMounts;}
132  SleeperInterface *GetSleeper() {return m_pSleeper; }
133  BasicIniUtilInterface *GetSimpleIniUtil() {return m_pIniUtil; }
134  LoggerInterface *GetLogger() {return m_pLogger; }
135  MutexInterface *GetMutex() {return m_pIOMutex;}
136  TickCountInterface *GetTickCountInterface() {return m_pTickCount;}
137 
138 
139  int m_nPrivateMulitInstanceIndex;
140  SerXInterface* m_pSerX;
141  TheSkyXFacadeForDriversInterface* m_pTheSkyXForMounts;
142  SleeperInterface* m_pSleeper;
143  BasicIniUtilInterface* m_pIniUtil;
144  LoggerInterface* m_pLogger;
145  MutexInterface* m_pIOMutex;
146  TickCountInterface* m_pTickCount;
147 
148 
149 
150 };
X2Mount::deviceInfoNameShort
virtual void deviceInfoNameShort(BasicStringInterface &str) const
Definition: x2mount.cpp:105
X2Mount::driverInfoVersion
virtual double driverInfoVersion(void) const
Definition: x2mount.cpp:99
X2Mount::deviceInfoNameLong
virtual void deviceInfoNameLong(BasicStringInterface &str) const
Definition: x2mount.cpp:109
X2Mount::driverInfoDetailedInfo
virtual void driverInfoDetailedInfo(BasicStringInterface &str) const
Definition: x2mount.cpp:95
TickCountInterface
The TickCountInterface is a cross-platform way to measure relative timing.
Definition: tickcountinterface.h:17
DriverRootInterface::DT_MOUNT
@ DT_MOUNT
Definition: driverrootinterface.h:28
MutexInterface
The MutexInterface provides a cross-platform mutex.
Definition: mutexinterface.h:16
X2Mount::queryAbstraction
virtual int queryAbstraction(const char *pszName, void **ppVal)
Definition: x2mount.cpp:55
X2Mount::deviceInfoFirmwareVersion
virtual void deviceInfoFirmwareVersion(BasicStringInterface &str)
Definition: x2mount.cpp:119
TheSkyXFacadeForDriversInterface
The TheSkyXFacadeForDriversInterface is a simplified interface to TheSkyX passed to X2 implementors.
Definition: theskyxfacadefordriversinterface.h:19
X2Mount::isLinked
virtual bool isLinked(void) const
Definition: x2mount.cpp:86
X2Mount::terminateLink
virtual int terminateLink(void)
Definition: x2mount.cpp:82
X2Mount::abort
virtual int abort(void)
Definition: x2mount.cpp:133
DriverRootInterface::DeviceType
DeviceType
Definition: driverrootinterface.h:26
X2Mount::X2Mount
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
X2Mount::deviceInfoDetailedDescription
virtual void deviceInfoDetailedDescription(BasicStringInterface &str) const
Definition: x2mount.cpp:114
MountDriverInterface
The MountDriverInterface allows an X2 implementor to a write X2 mount driver.
Definition: mountdriverinterface.h:26
BasicIniUtilInterface
The BasicIniUtilInterface is used to make properties persistent.
Definition: basiciniutilinterface.h:21
LoggerInterface
The LoggerInterface is a cross-platform logging utility passed to X2 implementors to show real-time,...
Definition: loggerinterface.h:58
X2Mount::deviceType
virtual DeviceType deviceType(void)
Definition: x2mount.h:60
X2Mount::deviceInfoModel
virtual void deviceInfoModel(BasicStringInterface &str)
Definition: x2mount.cpp:123
X2Mount::raDec
virtual int raDec(double &ra, double &dec, const bool &bCached=false)
Definition: x2mount.cpp:129
SleeperInterface
The SleeperInterface is a cross-platform "sleeper".
Definition: sleeperinterface.h:15
SerXInterface
The SerXInterface is a cross-plaform serial port.
Definition: serxinterface.h:18
X2Mount
The X2Mount example.
Definition: x2mount.h:39
BasicStringInterface
The BasicStringInterface allows a string as an output.
Definition: basicstringinterface.h:17
X2Mount::establishLink
virtual int establishLink(void)
Definition: x2mount.cpp:78
X2 Examples
(C) Software Bisque, Inc. All rights reserved.