X2 Standard  Version 1.25
Public Member Functions | List of all members
X2Mount Class Reference

The X2Mount example. More...

#include <x2mount.h>

Inheritance diagram for X2Mount:
MountDriverInterface OpenLoopMoveInterface PulseGuideInterface2 DriverRootInterface LinkInterface HardwareInfoInterface DriverInfoInterface NeedsRefractionInterface

Public Member Functions

 X2Mount (const char *pszDriverSelection, const int &nInstanceIndex, SerXInterface *pSerX, TheSkyXFacadeForDriversInterface *pTheSkyX, SleeperInterface *pSleeper, BasicIniUtilInterface *pIniUtil, LoggerInterface *pLogger, MutexInterface *pIOMutex, TickCountInterface *pTickCount)
 
DriverRootInterface Implementation
virtual DeviceType deviceType (void)
 
virtual int queryAbstraction (const char *pszName, void **ppVal)
 
LinkInterface Implementation
virtual int establishLink (void)
 
virtual int terminateLink (void)
 
virtual bool isLinked (void) const
 
virtual bool isEstablishLinkAbortable (void) const
 
DriverInfoInterface Implementation
virtual void driverInfoDetailedInfo (BasicStringInterface &str) const
 
virtual double driverInfoVersion (void) const
 
- Public Member Functions inherited from MountDriverInterface
virtual bool needsRefactionAdjustments (void)
 

HardwareInfoInterface Implementation

See HardwareInfoInterface.

virtual void deviceInfoNameShort (BasicStringInterface &str) const
 
virtual void deviceInfoNameLong (BasicStringInterface &str) const
 
virtual void deviceInfoDetailedDescription (BasicStringInterface &str) const
 
virtual void deviceInfoFirmwareVersion (BasicStringInterface &str)
 
virtual void deviceInfoModel (BasicStringInterface &str)
 
virtual int raDec (double &ra, double &dec, const bool &bCached=false)
 
virtual int abort (void)
 
virtual int startOpenLoopMove (const MountDriverInterface::MoveDir &Dir, const int &nRateIndex)
 
virtual int endOpenLoopMove (void)
 
virtual bool allowDiagonalMoves ()
 
virtual int rateCountOpenLoopMove (void) const
 
virtual int rateNameFromIndexOpenLoopMove (const int &nZeroBasedIndex, char *pszOut, const int &nOutMaxSize)
 
virtual int rateIndexOpenLoopMove (void)
 
virtual int useOpenLoopMoveInterface (int &nGuideRateIndex, OpenLoopMoveInterface **pOLSI)
 

Additional Inherited Members

- Public Types inherited from MountDriverInterface
enum  MotorState {
  MKS_MOTOR_HOMING =(0x0100), MKS_MOTOR_SERVO =(0x0200), MKS_MOTOR_INDEXING =(0x0400), MKS_MOTOR_SLEWING =(0x0800),
  MKS_MOTOR_HOMED =(0x1000), MKS_MOTOR_JOYSTICKING =(0x2000), MKS_MOTOR_OFF =(0x4000), MKS_MOTOR_MOVING = (MKS_MOTOR_HOMING | MKS_MOTOR_SLEWING | MKS_MOTOR_JOYSTICKING)
}
 
enum  Axis { AXIS_RA = 0, AXIS_DEC = 1 }
 
enum  MoveDir { MD_NORTH = 0, MD_SOUTH = 1, MD_EAST = 2, MD_WEST = 3 }
 
enum  MoveRate {
  MR_FLASH = -2, MR_BASE = -1, MR_0R5X = 0, MR_1X = 1,
  MR_2X = 2, MR_4X = 3, MR_8X = 4, MR_16X = 5,
  MR_32X = 6, MR_64X = 7, MR_128X = 8, MR_256X = 9,
  MR_SLEW = 10
}
 
- Public Types inherited from DriverRootInterface
enum  DeviceType {
  DT_UNKNOWN = 0, DT_MOUNT = 1, DT_FOCUSER = 2, DT_CAMERA = 3,
  DT_FILTERWHEEL = 4, DT_DOME = 5, DT_ROTATOR = 6, DT_WEATHER = 7,
  DT_GPSTFP = 8, DT_VIDEO = 9, DT_OTA =10, DT_AO =11,
  DT_POWERCONTROL =12, DT_PRIVATE_A =13
}
 
- Public Attributes inherited from PulseGuideInterface2
bool m_bPrivatePGAbort
 

Detailed Description

The X2Mount example.

Use this example to write an X2Mount driver.

Constructor & Destructor Documentation

◆ X2Mount()

X2Mount::X2Mount ( const char *  pszDriverSelection,
const int &  nInstanceIndex,
SerXInterface pSerX,
TheSkyXFacadeForDriversInterface pTheSkyX,
SleeperInterface pSleeper,
BasicIniUtilInterface pIniUtil,
LoggerInterface pLogger,
MutexInterface pIOMutex,
TickCountInterface pTickCount 
)

Standard X2 constructor

Member Function Documentation

◆ abort()

int X2Mount::abort ( void  )
virtual

Abort any operation currently in progress.

Implements MountDriverInterface.

◆ allowDiagonalMoves()

bool X2Mount::allowDiagonalMoves ( )
virtual

Return true if the mount can be commanded to move in more than one perpendicular axis at the same time, otherwise return false.

Reimplemented from OpenLoopMoveInterface.

◆ deviceInfoDetailedDescription()

void X2Mount::deviceInfoDetailedDescription ( BasicStringInterface str) const
virtual

Return a detailed device description.

Implements MountDriverInterface.

◆ deviceInfoFirmwareVersion()

void X2Mount::deviceInfoFirmwareVersion ( BasicStringInterface str)
virtual

Return the firmware version, if available.

Implements MountDriverInterface.

◆ deviceInfoModel()

void X2Mount::deviceInfoModel ( BasicStringInterface str)
virtual

Return the device model name.

Implements MountDriverInterface.

◆ deviceInfoNameLong()

void X2Mount::deviceInfoNameLong ( BasicStringInterface str) const
virtual

Return a detailed device name.

Implements MountDriverInterface.

◆ deviceInfoNameShort()

void X2Mount::deviceInfoNameShort ( BasicStringInterface str) const
virtual

Return a short device name.

Implements MountDriverInterface.

◆ deviceType()

virtual DeviceType X2Mount::deviceType ( void  )
inlinevirtual

Returns the type of device.

Reimplemented from MountDriverInterface.

◆ driverInfoDetailedInfo()

void X2Mount::driverInfoDetailedInfo ( BasicStringInterface str) const
virtual

Return detailed information about the driver.

Implements MountDriverInterface.

◆ driverInfoVersion()

double X2Mount::driverInfoVersion ( void  ) const
virtual

Return a version number.

Implements MountDriverInterface.

◆ endOpenLoopMove()

int X2Mount::endOpenLoopMove ( void  )
virtual

End the open-loop move. This function is always called for every corresponding startOpenLoopMove(), allowing software implementations of the move.

Implements OpenLoopMoveInterface.

◆ establishLink()

int X2Mount::establishLink ( void  )
virtual

Connect (link) to the device.

Implements MountDriverInterface.

◆ isLinked()

bool X2Mount::isLinked ( void  ) const
virtual

Return true if there is a connection, otherwise return false.

Implements MountDriverInterface.

◆ queryAbstraction()

int X2Mount::queryAbstraction ( const char *  pszName,
void **  ppVal 
)
virtual

Return a pointer to well defined interface.

Implements MountDriverInterface.

◆ raDec()

int X2Mount::raDec ( double &  dRawRA,
double &  dRawDec,
const bool &  bCached = false 
)
virtual

Return the mechanical or raw right ascension and declination coordinates of the mount.

Parameters
dRawRAis the right ascension coordinate of the mount from 0 to 24.
dRawDecis the declination coordinate of the mount from -90 to +90.
bCachedmay be ignored.
See also
NeedsRefractionInterface for clarity on what is meant by "mechanical or raw" coordinates.

Implements MountDriverInterface.

◆ rateCountOpenLoopMove()

int X2Mount::rateCountOpenLoopMove ( void  ) const
virtual

Return the number (count) of avaiable moves.

Implements OpenLoopMoveInterface.

◆ rateIndexOpenLoopMove()

int X2Mount::rateIndexOpenLoopMove ( void  )
virtual

Return the current index of move selection.

Implements OpenLoopMoveInterface.

◆ rateNameFromIndexOpenLoopMove()

int X2Mount::rateNameFromIndexOpenLoopMove ( const int &  nZeroBasedIndex,
char *  pszOut,
const int &  nOutMaxSize 
)
virtual

Return a string along with the amount or size of the corresponding move.

Implements OpenLoopMoveInterface.

◆ startOpenLoopMove()

int X2Mount::startOpenLoopMove ( const MountDriverInterface::MoveDir Dir,
const int &  nRateIndex 
)
virtual

Start the open-loop move.

Implements OpenLoopMoveInterface.

◆ terminateLink()

int X2Mount::terminateLink ( void  )
virtual

Disconnect from the device.

Implements MountDriverInterface.

◆ useOpenLoopMoveInterface()

virtual int X2Mount::useOpenLoopMoveInterface ( int &  nGuideRateIndex,
OpenLoopMoveInterface **  pOLSI 
)
inlinevirtual

This is the function that needs implemented when a mount relies on the OpenLoopMoveInterface to "PulseGuide". Simply return the desired rate index (defined by OpenLoopMoveInterface) that you want TheSky to use while autoguiding in addtion to the mount's OpenLoopMoveInterface.

The source file provides sample implementation. Note, there is no default implementation so that technical support is not overwhelmed with poor autoguiding by third party mounts that hasn't been verified/tested. As the author supporting this interface you take responsibility to test and ensure autoguiding with the corresponding mount through this interface works well and by enabling this implementation you agree to this.

Parameters
nGuideRateIndexSets the speed, as defined by the OpenLoopMoveInterface, by index, TheSky uses while autoguiding.
OpenLoopMoveInterfaceA pointer to the mount's OpenLoopMoveInterface.
returnAn error code, zero means no error.

Implements PulseGuideInterface2.


The documentation for this class was generated from the following files:
X2 Examples
(C) 2023 Software Bisque, Inc. All rights reserved.