Instrument Neutral Distributed Interface INDI  1.5.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
INDI::Dome Class Reference

Class to provide general functionality of a Dome device. More...

#include <indidome.h>

Inheritance diagram for INDI::Dome:
INDI::DefaultDevice INDI::BaseDevice BaaderDome DomeScript DomeSim RollOff

Public Types

- Public Types inherited from INDI::BaseDevice

Public Member Functions

 Dome ()
 
virtual ~Dome ()
 
virtual bool initProperties ()
 Initilize properties initial state and value. The child class must implement this function. More...
 
virtual void ISGetProperties (const char *dev)
 define the driver's properties to the client. Usually, only a minimum set of properties are defined to the client in this function if the device is in disconnected state. Those properties should be enough to enable the client to establish a connection to the device. In addition to CONNECT/DISCONNECT, such properties may include port name, IP address, etc. You should check if the device is already connected, and if this is true, then you must define the remainder of the the properties to the client in this function. Otherwise, the remainder of the driver's properties are defined to the client in updateProperties() function which is called when a client connects/disconnects from a device. More...
 
virtual bool updateProperties ()
 updateProperties is called whenever there is a change in the CONNECTION status of the driver. This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before. More...
 
virtual bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 Process the client newNumber command. More...
 
virtual bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 Process the client newSwitch command. More...
 
virtual bool ISSnoopDevice (XMLEle *root)
 Process a snoop event from INDI server. This function is called when a snooped property is updated in a snooped driver. More...
 
void setDomeConnection (const uint8_t &value)
 setDomeConnection Set Dome connection mode. Child class should call this in the constructor before INDI::Dome registers any connection interfaces More...
 
uint8_t getDomeConnection () const
 
uint32_t GetDomeCapability () const
 GetDomeCapability returns the capability of the dome. More...
 
void SetDomeCapability (uint32_t cap)
 SetDomeCapability set the dome capabilities. All capabilities must be initialized. More...
 
bool CanAbort ()
 
bool CanAbsMove ()
 
bool CanRelMove ()
 
bool CanPark ()
 
bool HasShutter ()
 
bool HasVariableSpeed ()
 
bool isLocked ()
 isLocked, is the dome currently locked? More...
 
DomeState getDomeState () const
 
void setDomeState (const DomeState &value)
 
IPState getWeatherState () const
 
IPState getMountState () const
 
- Public Member Functions inherited from INDI::DefaultDevice
 DefaultDevice ()
 
virtual ~DefaultDevice ()
 
void addAuxControls ()
 Add Debug, Simulation, and Configuration options to the driver. More...
 
void addDebugControl ()
 Add Debug control to the driver. More...
 
void addSimulationControl ()
 Add Simulation control to the driver. More...
 
void addConfigurationControl ()
 Add Configuration control to the driver. More...
 
void resetProperties ()
 Set all properties to IDLE state. More...
 
void defineNumber (INumberVectorProperty *nvp)
 Define number vector to client & register it. Alternatively, IDDefNumber can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineText (ITextVectorProperty *tvp)
 Define text vector to client & register it. Alternatively, IDDefText can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineSwitch (ISwitchVectorProperty *svp)
 Define switch vector to client & register it. Alternatively, IDDefswitch can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineLight (ILightVectorProperty *lvp)
 Define light vector to client & register it. Alternatively, IDDeflight can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
void defineBLOB (IBLOBVectorProperty *bvp)
 Define BLOB vector to client & register it. Alternatively, IDDefBLOB can be used but the property will not get registered and the driver will not be able to save configuration files. More...
 
virtual bool deleteProperty (const char *propertyName)
 Delete a property and unregister it. It will also be deleted from all clients. More...
 
virtual void setConnected (bool status, IPState state=IPS_OK, const char *msg=nullptr)
 Set connection switch status in the client. More...
 
int SetTimer (int ms)
 Set a timer to call the function TimerHit after ms milliseconds. More...
 
void RemoveTimer (int id)
 Remove timer added with SetTimer. More...
 
virtual void TimerHit ()
 Callback function to be called once SetTimer duration elapses. More...
 
virtual const char * getDriverExec ()
 
virtual const char * getDriverName ()
 
void setVersion (uint16_t vMajor, uint16_t vMinor)
 Set driver version information to be defined in DRIVER_INFO property as vMajor.vMinor. More...
 
uint16_t getMajorVersion ()
 
uint16_t getMinorVersion ()
 
virtual bool ISNewBLOB (const char *dev, const char *name, int sizes[], int blobsizes[], char *blobs[], char *formats[], char *names[], int n)
 Process the client newBLOB command. More...
 
virtual uint16_t getDriverInterface ()
 
void setDriverInterface (uint16_t value)
 setInterface Set driver interface. By default the driver interface is set to GENERAL_DEVICE. You may send an ORed list of DeviceInterface values. More...
 
- Public Member Functions inherited from INDI::BaseDevice
 BaseDevice ()
 
virtual ~BaseDevice ()
 
INumberVectorPropertygetNumber (const char *name)
 
ITextVectorPropertygetText (const char *name)
 
ISwitchVectorPropertygetSwitch (const char *name)
 
ILightVectorPropertygetLight (const char *name)
 
IBLOBVectorPropertygetBLOB (const char *name)
 
IPState getPropertyState (const char *name)
 
IPerm getPropertyPermission (const char *name)
 
void registerProperty (void *p, INDI_PROPERTY_TYPE type)
 
int removeProperty (const char *name, char *errmsg)
 Remove a property. More...
 
void * getRawProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
INDI::PropertygetProperty (const char *name, INDI_PROPERTY_TYPE type=INDI_UNKNOWN)
 Return a property and its type given its name. More...
 
std::vector< INDI::Property * > * getProperties ()
 Return a list of all properties in the device. More...
 
bool buildSkeleton (const char *filename)
 Build driver properties from a skeleton file. More...
 
bool isConnected ()
 
void setDeviceName (const char *dev)
 Set the device name. More...
 
const char * getDeviceName ()
 
void addMessage (const std::string &msg)
 Add message to the driver's message queue. More...
 
void checkMessage (XMLEle *root)
 
void doMessage (XMLEle *msg)
 
std::string messageQueue (int index) const
 
std::string lastMessage ()
 
void setMediator (INDI::BaseMediator *med)
 Set the driver's mediator to receive notification of news devices and updated property values. More...
 
INDI::BaseMediatorgetMediator ()
 
const char * getDriverName ()
 
const char * getDriverExec ()
 
const char * getDriverVersion ()
 

Static Public Member Functions

static void buttonHelper (const char *button_n, ISState state, void *context)
 

Public Attributes

enum INDI::Dome:: { ... }  DomeConnection
 

Protected Member Functions

virtual bool SetSpeed (double rpm)
 SetSpeed Set Dome speed. This does not initiate motion, it sets the speed for the next motion command. If motion is in progress, then change speed accordingly. More...
 
virtual IPState Move (DomeDirection dir, DomeMotionCommand operation)
 Move the Dome in a particular direction. More...
 
virtual IPState MoveAbs (double az)
 Move the Dome to an absolute azimuth. More...
 
virtual IPState MoveRel (double azDiff)
 Move the Dome to an relative position. More...
 
virtual bool Abort ()
 Abort all dome motion. More...
 
virtual IPState Park ()
 Goto Park Position. The park position is an absolute azimuth value. More...
 
virtual IPState UnPark ()
 UnPark dome. The action of the Unpark command is dome specific, but it may include opening the shutter and moving to home position. When UnPark() is successful The observatory should be in a ready state to utilize the mount to perform observations. More...
 
virtual IPState ControlShutter (ShutterOperation operation)
 Open or Close shutter. More...
 
const char * GetShutterStatusString (ShutterStatus status)
 getShutterStatusString More...
 
void SetParkDataType (DomeParkData type)
 setParkDataType Sets the type of parking data stored in the park data file and presented to the user. More...
 
bool InitPark ()
 InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking position. InitPark() should be called after successful connection to the dome on startup. More...
 
bool isParked ()
 isParked is dome currently parked? More...
 
void SetParked (bool isparked)
 SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData.xml) is updated in the process. More...
 
double GetAxis1Park ()
 
double GetAxis1ParkDefault ()
 
void SetAxis1Park (double value)
 SetRAPark Set current AZ parking position. The data park file (stored in ~/.indi/ParkData.xml) is updated in the process. More...
 
void SetAxis1ParkDefault (double steps)
 SetAxis1Park Set default AZ parking position. More...
 
virtual bool SetCurrentPark ()
 SetCurrentPark Set current coordinates/encoders value as the desired parking position. More...
 
virtual bool SetDefaultPark ()
 SetDefaultPark Set default coordinates/encoders value as the desired parking position. More...
 
char * LoadParkData ()
 
bool WriteParkData ()
 
bool GetTargetAz (double &Az, double &Alt, double &minAz, double &maxAz)
 GetTargetAz. More...
 
bool Intersection (point3D p1, point3D p2, double r, double &mu1, double &mu2)
 Intersection Calculate the intersection of a ray and a sphere. The line segment is defined from p1 to p2. The sphere is of radius r and centered at (0,0,0). From http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/ There are potentially two points of intersection given by p := p1 + mu1 (p2 - p1) p := p1 + mu2 (p2 - p1) More...
 
bool OpticalCenter (point3D MountCenter, double dOpticalAxis, double Lat, double Ah, point3D &OP)
 OpticalCenter This function calculates the distance from the optical axis to the Dome center. More...
 
bool OpticalVector (double Az, double Alt, point3D &OV)
 OpticalVector This function calculates a second point for determining the optical axis. More...
 
bool CheckHorizon (double HA, double dec, double lat)
 CheckHorizon Returns true if telescope points above horizon. More...
 
virtual bool saveConfigItems (FILE *fp)
 saveConfigItems Saves the Device Port and Dome Presets in the configuration file More...
 
void UpdateMountCoords ()
 updateCoords updates the horizontal coordinates (Az & Alt) of the mount from the snooped RA, DEC and observer's location. More...
 
virtual void UpdateAutoSync ()
 UpdateAutoSync This function calculates the target dome azimuth from the mount's target coordinates given the dome parameters. If the difference between the dome's and mount's azimuth angles exceeds the AutoSync threshold, the dome will be commanded to sync to the mount azimuth position. More...
 
virtual bool Handshake ()
 perform handshake with device to check communication More...
 
double Csc (double x)
 
double Sec (double x)
 
- Protected Member Functions inherited from INDI::DefaultDevice
void setDynamicPropertiesBehavior (bool defineEnabled, bool deleteEnabled)
 setDynamicPropertiesBehavior controls handling of dynamic properties. Dyanmic properties are those generated from an external skeleton XML file. By default all properties, including dynamic properties, are defined to the client in ISGetProperties(). Furthermore, when ┼▒deleteProperty(properyName) is called, the dynamic property is deleted by default, and can only be restored by calling buildSkeleton(filename) again. However, it is sometimes desirable to skip the definition of the dynamic properties on startup and delegate this task to the child class. To control this behavior, set enabled to false. More...
 
virtual bool loadConfig (bool silent=false, const char *property=nullptr)
 Load the last saved configuration file. More...
 
virtual bool saveConfig (bool silent=false, const char *property=nullptr)
 Save the current properties in a configuration file. More...
 
virtual bool saveAllConfigItems (FILE *fp)
 saveAllConfigItems Save all the drivers' properties in the configuration file More...
 
virtual bool loadDefaultConfig ()
 Load the default configuration file. More...
 
void setDebug (bool enable)
 Toggle driver debug status A driver can be more verbose if Debug option is enabled by the client. More...
 
void setSimulation (bool enable)
 Toggle driver simulation status A driver can run in simulation mode if Simulation option is enabled by the client. More...
 
virtual void debugTriggered (bool enable)
 Inform driver that the debug option was triggered. This function is called after setDebug is triggered by the client. Reimplement this function if your driver needs to take specific action after debug is enabled/disabled. Otherwise, you can use isDebug() to check if simulation is enabled or disabled. More...
 
virtual void simulationTriggered (bool enable)
 Inform driver that the simulation option was triggered. This function is called after setSimulation is triggered by the client. Reimplement this function if your driver needs to take specific action after simulation is enabled/disabled. Otherwise, you can use isSimulation() to check if simulation is enabled or disabled. More...
 
bool isDebug ()
 
bool isSimulation ()
 
virtual bool Connect ()
 Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interface (Serial or TCP) governed by connectionMode. If connection is successful, it proceed to call Handshake() function to ensure communication with device is successful. For other communication interface, override the method in the child class implementation. More...
 
virtual bool Disconnect ()
 Disconnect from device. More...
 
void registerConnection (Connection::Interface *newConnection)
 registerConnection Add new connection plugin to the existing connection pool. The connection type shall be defined to the client in ISGetProperties() More...
 
bool unRegisterConnection (Connection::Interface *existingConnection)
 unRegisterConnection Remove connection from existing pool More...
 
Connection::InterfacegetActiveConnection ()
 
virtual const char * getDefaultName ()=0
 
- Protected Member Functions inherited from INDI::BaseDevice
int buildProp (XMLEle *root, char *errmsg)
 Build a property given the supplied XML element (defXXX) More...
 
int setValue (XMLEle *root, char *errmsg)
 handle SetXXX commands from client More...
 
int setBLOB (IBLOBVectorProperty *pp, XMLEle *root, char *errmsg)
 Parse and store BLOB in the respective vector. More...
 

Protected Attributes

INumberVectorProperty DomeSpeedNP
 
INumber DomeSpeedN [1]
 
ISwitchVectorProperty DomeMotionSP
 
ISwitch DomeMotionS [2]
 
INumberVectorProperty DomeAbsPosNP
 
INumber DomeAbsPosN [1]
 
INumberVectorProperty DomeRelPosNP
 
INumber DomeRelPosN [1]
 
ISwitchVectorProperty AbortSP
 
ISwitch AbortS [1]
 
INumberVectorProperty DomeParamNP
 
INumber DomeParamN [1]
 
ISwitchVectorProperty DomeShutterSP
 
ISwitch DomeShutterS [2]
 
ISwitchVectorProperty ParkSP
 
ISwitch ParkS [2]
 
INumber ParkPositionN [1]
 
INumberVectorProperty ParkPositionNP
 
ISwitch ParkOptionS [3]
 
ISwitchVectorProperty ParkOptionSP
 
ISwitch AutoParkS [2]
 
ISwitchVectorProperty AutoParkSP
 
uint32_t capability
 
ShutterStatus shutterState
 
DomeParkData parkDataType
 
ITextVectorProperty ActiveDeviceTP
 
IText ActiveDeviceT [2]
 
ISwitchVectorProperty TelescopeClosedLockTP
 
ISwitch TelescopeClosedLockT [2]
 
INumber PresetN [3]
 
INumberVectorProperty PresetNP
 
ISwitch PresetGotoS [3]
 
ISwitchVectorProperty PresetGotoSP
 
INumber DomeMeasurementsN [6]
 
INumberVectorProperty DomeMeasurementsNP
 
ISwitchVectorProperty OTASideSP
 
ISwitch OTASideS [2]
 
ISwitchVectorProperty DomeAutoSyncSP
 
ISwitch DomeAutoSyncS [2]
 
double prev_az
 
double prev_alt
 
double prev_ra
 
double prev_dec
 
int PortFD = -1
 
Connection::SerialserialConnection = NULL
 
Connection::TCPtcpConnection = NULL
 
- Protected Attributes inherited from INDI::DefaultDevice
uint32_t updatePeriodMS = 1000
 Period in milliseconds to call TimerHit(). Default 1000 ms. More...
 

Detailed Description

Class to provide general functionality of a Dome device.

Both relative and absolute position domes are supported. Furthermore, if no position feedback is available from the dome, an open-loop control is possible with simple direction commands (Clockwise and counter clockwise).

Before using any of the dome functions, you must define the capabilities of the dome by calling SetDomeCapability() function. All positions are represented as degrees of azimuth.

Relative motion is specified in degrees as either positive (clock wise direction), or negative (counter clock-wise direction).

Slaving is used to synchronizes the dome's azimuth position with that of the mount. The mount's coordinates are snooped from the active mount that has its name specified in ACTIVE_TELESCOPE property in the ACTIVE_DEVICES vector. Dome motion begins when it receives TARGET_EOD_COORD property from the mount driver when the mount starts slewing to the desired target coordinates /em OR when the mount's current tracking position exceeds the AutoSync threshold. Therefore, slaving is performed while slewing and tracking. The user is required to fill in all required parameters before slaving can be used. The AutoSync threshold is the difference in degrees between the dome's azimuth angle and the mount's azimuth angle that should trigger a dome motion. By default, it is set to 0.5 degrees which would trigger dome motion due to any difference between the dome and mount azimuth angles that exceeds 0.5 degrees. For example, if the threshold is set to 5 degrees, the dome will only start moving to sync with the mount's azimuth angle once the difference in azimuth angles is equal or exceeds 5 degrees.

Custom parking position is available for absolute/relative position domes.

For roll-off observatories, parking state reflects whether the roof is closed or open.

Developers need to subclass INDI::Dome to implement any driver for Domes within INDI.

Note
The code used calculate dome target AZ and ZD is written by Ferran Casarramona, and adapted from code from Markus Wildi. The transformations are based on the paper Matrix Method for Coodinates Transformation written by Toshimi Taki (http://www.asahi-net.or.jp/~zs3t-tk).
Author
Jasem Mutlaq

Definition at line 71 of file indidome.h.

Member Enumeration Documentation

anonymous enum
Enumerator
DOME_CAN_ABORT 

Can the dome motion be aborted?

DOME_CAN_ABS_MOVE 

Can the dome move to an absolute azimuth position?

DOME_CAN_REL_MOVE 

Can the dome move to a relative position a number of degrees away from current position? Positive degress is Clockwise direction. Negative Degrees is counter clock wise direction

DOME_CAN_PARK 

Can the dome park and unpark itself?

DOME_HAS_SHUTTER 

Does the dome has a shutter than can be opened and closed electronically?

DOME_HAS_VARIABLE_SPEED 

Can the dome move in different configurable speeds?

Definition at line 137 of file indidome.h.

anonymous enum
Enumerator
CONNECTION_NONE 
CONNECTION_SERIAL 

Do not use any connection plugin

CONNECTION_TCP 

For regular serial and bluetooth connections

Definition at line 152 of file indidome.h.

Enumerator
DOME_CW 
DOME_CCW 

Definition at line 87 of file indidome.h.

Measurements necessary for dome-slit synchronization. All values are in meters. The displacements are measured from the true dome centre, and the dome is assumed spherical.

Note
: The mount centre is the point where RA and Dec. axis crosses, no matter the kind of mount. For example, for a fork mount this displacement is typically 0 if it's perfectly centred with RA axis.
Enumerator
DM_DOME_RADIUS 

Dome RADIUS

DM_SHUTTER_WIDTH 

Shutter width

DM_NORTH_DISPLACEMENT 

Displacement to north of the mount center

DM_EAST_DISPLACEMENT 

Displacement to east of the mount center

DM_UP_DISPLACEMENT 

Up Displacement of the mount center

DM_OTA_OFFSET 

Distance from the optical axis to the mount center

Definition at line 78 of file indidome.h.

Enumerator
MOTION_START 
MOTION_STOP 

Definition at line 92 of file indidome.h.

Dome Parking data type enum

Enumerator
PARK_NONE 

Open loop Parking

PARK_AZ 

Parking via azimuth angle control

PARK_AZ_ENCODER 

Parking via azimuth encoder control

Definition at line 99 of file indidome.h.

Dome status.

Enumerator
DOME_IDLE 

Dome is idle

DOME_MOVING 

Dome is in motion

DOME_SYNCED 

Dome is synced

DOME_PARKING 

Dome is parking

DOME_UNPARKING 

Dome is unparking

DOME_PARKED 

Dome is parked

DOME_UNPARKED 

Dome is unparked

Definition at line 117 of file indidome.h.

Shutter operation command.

Enumerator
SHUTTER_OPEN 

Open Shutter

SHUTTER_CLOSE 

Close Shutter

Definition at line 109 of file indidome.h.

Shutter Status.

Enumerator
SHUTTER_OPENED 

Shutter is open

SHUTTER_CLOSED 

Shutter is closed

SHUTTER_MOVING 

Shutter is in motion

SHUTTER_UNKNOWN 

Shutter status is unknown

Definition at line 130 of file indidome.h.

Constructor & Destructor Documentation

Dome::Dome ( )

Definition at line 43 of file indidome.cpp.

Dome::~Dome ( )
virtual

Definition at line 67 of file indidome.cpp.

Member Function Documentation

bool Dome::Abort ( )
protectedvirtual

Abort all dome motion.

Returns
True if abort is successful, false otherwise.

Reimplemented in BaaderDome, DomeScript, DomeSim, and RollOff.

Definition at line 1676 of file indidome.cpp.

void Dome::buttonHelper ( const char *  button_n,
ISState  state,
void *  context 
)
static

Definition at line 818 of file indidome.cpp.

bool INDI::Dome::CanAbort ( )
inline
Returns
True if dome support aborting motion

Definition at line 198 of file indidome.h.

bool INDI::Dome::CanAbsMove ( )
inline
Returns
True if dome has absolute postion encoders.

Definition at line 203 of file indidome.h.

bool INDI::Dome::CanPark ( )
inline
Returns
True if dome can park.

Definition at line 213 of file indidome.h.

bool INDI::Dome::CanRelMove ( )
inline
Returns
True if dome has relative position encoders.

Definition at line 208 of file indidome.h.

bool Dome::CheckHorizon ( double  HA,
double  dec,
double  lat 
)
protected

CheckHorizon Returns true if telescope points above horizon.

Parameters
HAHour angle
decDeclination
latobserver's latitude
Returns
True if telescope points above horizon, false otherwise.

Definition at line 1137 of file indidome.cpp.

IPState Dome::ControlShutter ( ShutterOperation  operation)
protectedvirtual

Open or Close shutter.

Parameters
operationEither open or close the shutter.
Returns
Return IPS_OK if shutter operation is complete. Return IPS_BUSY if shutter operation is in progress. Return IPS_ALERT if there is an error.

Reimplemented in BaaderDome, DomeScript, and DomeSim.

Definition at line 1751 of file indidome.cpp.

double Dome::Csc ( double  x)
protected

Definition at line 1127 of file indidome.cpp.

double Dome::GetAxis1Park ( )
protected
Returns
Get current AZ parking position.

Definition at line 1482 of file indidome.cpp.

double Dome::GetAxis1ParkDefault ( )
protected
Returns
Get default AZ parking position.

Definition at line 1487 of file indidome.cpp.

uint32_t INDI::Dome::GetDomeCapability ( ) const
inline

GetDomeCapability returns the capability of the dome.

Definition at line 187 of file indidome.h.

uint8_t Dome::getDomeConnection ( ) const
Returns
Get current Dome connection mode

Definition at line 1899 of file indidome.cpp.

DomeState INDI::Dome::getDomeState ( ) const
IPState Dome::getMountState ( ) const

Definition at line 850 of file indidome.cpp.

const char * Dome::GetShutterStatusString ( ShutterStatus  status)
protected

getShutterStatusString

Parameters
statusStatus of shutter
Returns
Returns string representation of the shutter status

Definition at line 1231 of file indidome.cpp.

bool Dome::GetTargetAz ( double &  Az,
double &  Alt,
double &  minAz,
double &  maxAz 
)
protected

GetTargetAz.

Parameters
AzReturns Azimuth required to the dome in order to center the shutter aperture with telescope
Alt
minAzReturns Minimum azimuth in order to avoid any dome interference to the full aperture of the telescope
maxAzReturns Maximum azimuth in order to avoid any dome interference to the full aperture of the telescope
Returns
Returns false if it can't solve it due bad geometry of the observatory

Definition at line 954 of file indidome.cpp.

IPState Dome::getWeatherState ( ) const

Definition at line 855 of file indidome.cpp.

bool Dome::Handshake ( )
protectedvirtual

perform handshake with device to check communication

Reimplemented in BaaderDome.

Definition at line 1881 of file indidome.cpp.

bool INDI::Dome::HasShutter ( )
inline
Returns
True if dome has controllable shutter door

Definition at line 218 of file indidome.h.

bool INDI::Dome::HasVariableSpeed ( )
inline
Returns
True if dome support multiple speeds

Definition at line 223 of file indidome.h.

bool Dome::InitPark ( )
protected

InitPark Loads parking data (stored in ~/.indi/ParkData.xml) that contains parking status and parking position. InitPark() should be called after successful connection to the dome on startup.

Returns
True if loading is successful and data is read, false otherwise. On success, you must call SetAzParkDefault() to set the default parking values. On failure, you must call SetAzParkDefault() to set the default parking values in addition to SetAzPark() to set the current parking position.

Definition at line 1306 of file indidome.cpp.

bool Dome::initProperties ( )
virtual

Initilize properties initial state and value. The child class must implement this function.

Returns
True if initilization is successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in BaaderDome, DomeScript, DomeSim, and RollOff.

Definition at line 71 of file indidome.cpp.

bool Dome::Intersection ( point3D  p1,
point3D  p2,
double  r,
double &  mu1,
double &  mu2 
)
protected

Intersection Calculate the intersection of a ray and a sphere. The line segment is defined from p1 to p2. The sphere is of radius r and centered at (0,0,0). From http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/ There are potentially two points of intersection given by p := p1 + mu1 (p2 - p1) p := p1 + mu2 (p2 - p1)

Parameters
p1First point
p2Direction of the ray
rRADIUS of sphere
mu1First point of potentional intersection.
mu2Second point of potentional intersection.
Returns
Returns FALSE if the ray doesn't intersect the sphere.

Definition at line 1069 of file indidome.cpp.

void Dome::ISGetProperties ( const char *  dev)
virtual

define the driver's properties to the client. Usually, only a minimum set of properties are defined to the client in this function if the device is in disconnected state. Those properties should be enough to enable the client to establish a connection to the device. In addition to CONNECT/DISCONNECT, such properties may include port name, IP address, etc. You should check if the device is already connected, and if this is true, then you must define the remainder of the the properties to the client in this function. Otherwise, the remainder of the driver's properties are defined to the client in updateProperties() function which is called when a client connects/disconnects from a device.

Parameters
devname of the device
Note
This function is called by the INDI framework, do not call it directly. See LX200 Generic driver for an example implementation

Reimplemented from INDI::DefaultDevice.

Reimplemented in DomeScript.

Definition at line 203 of file indidome.cpp.

bool Dome::isLocked ( )

isLocked, is the dome currently locked?

Returns
True if lock status equals true, and TelescopeClosedLockTP is Telescope Locks.

Definition at line 813 of file indidome.cpp.

bool Dome::ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)
virtual

Process the client newNumber command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Definition at line 306 of file indidome.cpp.

bool Dome::ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)
virtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in BaaderDome, and RollOff.

Definition at line 372 of file indidome.cpp.

bool Dome::ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)
virtual

Process the client newSwitch command.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in DomeScript.

Definition at line 605 of file indidome.cpp.

bool Dome::isParked ( )
protected

isParked is dome currently parked?

Returns
True if parked, false otherwise.

Definition at line 1301 of file indidome.cpp.

bool Dome::ISSnoopDevice ( XMLEle root)
virtual

Process a snoop event from INDI server. This function is called when a snooped property is updated in a snooped driver.

Note
This function is called by the INDI framework, do not call it directly.
Returns
True if any property was successfully processed, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in RollOff.

Definition at line 630 of file indidome.cpp.

char * Dome::LoadParkData ( )
protected

Definition at line 1333 of file indidome.cpp.

IPState Dome::Move ( DomeDirection  dir,
DomeMotionCommand  operation 
)
protectedvirtual

Move the Dome in a particular direction.

Parameters
dirDirection of Dome, either DOME_CW or DOME_CCW.
Returns
Return IPS_OK if dome operation is complete. IPS_BUSY if operation is in progress. IPS_ALERT on error.

Reimplemented in RollOff, DomeScript, and DomeSim.

Definition at line 1504 of file indidome.cpp.

IPState Dome::MoveAbs ( double  az)
protectedvirtual

Move the Dome to an absolute azimuth.

Parameters
azThe new position of the Dome.
Returns
Return IPS_OK if motion is completed and Dome reached requested position. Return IPS_BUSY if Dome started motion to requested position and is in progress. Return IPS_ALERT if there is an error.

Reimplemented in BaaderDome, DomeScript, and DomeSim.

Definition at line 1611 of file indidome.cpp.

IPState Dome::MoveRel ( double  azDiff)
protectedvirtual

Move the Dome to an relative position.

Parameters
azDiffThe relative azimuth angle to move. Positive degree is clock-wise direction. Negative degrees is counter clock-wise direction.
Returns
Return IPS_OK if motion is completed and Dome reached requested position. Return IPS_BUSY if Dome started motion to requested position and is in progress. Return IPS_ALERT if there is an error.

Reimplemented in BaaderDome, and DomeSim.

Definition at line 1544 of file indidome.cpp.

bool Dome::OpticalCenter ( point3D  MountCenter,
double  dOpticalAxis,
double  Lat,
double  Ah,
point3D OP 
)
protected

OpticalCenter This function calculates the distance from the optical axis to the Dome center.

Parameters
MountCenterDistance from the Dome center to the point where mount axis crosses
dOpticalAxisDistance from the mount center to the optical axis.
LatLatitude
AhHour Angle (in hours)
OPa 3D point from the optical center to the Dome center.
Returns
false in case of error.

Definition at line 1093 of file indidome.cpp.

bool Dome::OpticalVector ( double  Az,
double  Alt,
point3D OV 
)
protected

OpticalVector This function calculates a second point for determining the optical axis.

Parameters
AzAzimuth
AltAltitude
OVa 3D point that determines the optical line.
Returns
false in case of error.

Definition at line 1114 of file indidome.cpp.

IPState Dome::Park ( )
protectedvirtual

Goto Park Position. The park position is an absolute azimuth value.

Returns
Return IPS_OK if motion is completed and Dome reached park position. Return IPS_BUSY if Dome started motion to park requested position and is in progress. Return -IPS_ALERT if there is an error.

Reimplemented in BaaderDome, DomeScript, RollOff, and DomeSim.

Definition at line 1795 of file indidome.cpp.

bool Dome::saveConfigItems ( FILE *  fp)
protectedvirtual

saveConfigItems Saves the Device Port and Dome Presets in the configuration file

Parameters
fppointer to configuration file
Returns
true if successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in BaaderDome, RollOff, and DomeScript.

Definition at line 790 of file indidome.cpp.

double Dome::Sec ( double  x)
protected

Definition at line 1132 of file indidome.cpp.

void Dome::SetAxis1Park ( double  value)
protected

SetRAPark Set current AZ parking position. The data park file (stored in ~/.indi/ParkData.xml) is updated in the process.

Parameters
valuecurrent Axis 1 value (AZ either in angles or encoder values as specificed by the DomeParkData type).

Definition at line 1492 of file indidome.cpp.

void Dome::SetAxis1ParkDefault ( double  steps)
protected

SetAxis1Park Set default AZ parking position.

Parameters
valueDefault Axis 1 value (AZ either in angles or encoder values as specificed by the DomeParkData type).

Definition at line 1499 of file indidome.cpp.

bool Dome::SetCurrentPark ( )
protectedvirtual

SetCurrentPark Set current coordinates/encoders value as the desired parking position.

Note
This function performs no action unless subclassed by the child class if required.

Reimplemented in BaaderDome, and DomeSim.

Definition at line 1869 of file indidome.cpp.

bool Dome::SetDefaultPark ( )
protectedvirtual

SetDefaultPark Set default coordinates/encoders value as the desired parking position.

Note
This function performs no action unless subclassed by the child class if required.

Reimplemented in BaaderDome, and DomeSim.

Definition at line 1875 of file indidome.cpp.

void Dome::SetDomeCapability ( uint32_t  cap)

SetDomeCapability set the dome capabilities. All capabilities must be initialized.

Parameters
cappointer to dome capability

Definition at line 1223 of file indidome.cpp.

void Dome::setDomeConnection ( const uint8_t &  value)

setDomeConnection Set Dome connection mode. Child class should call this in the constructor before INDI::Dome registers any connection interfaces

Parameters
valueORed combination of DomeConnection values.

Definition at line 1904 of file indidome.cpp.

void Dome::setDomeState ( const DomeState value)

Definition at line 865 of file indidome.cpp.

void Dome::SetParkDataType ( DomeParkData  type)
protected

setParkDataType Sets the type of parking data stored in the park data file and presented to the user.

Parameters
typeparking data type. If PARK_NONE then no properties will be presented to the user for custom parking position.

Definition at line 1251 of file indidome.cpp.

void Dome::SetParked ( bool  isparked)
protected

SetParked Change the mount parking status. The data park file (stored in ~/.indi/ParkData.xml) is updated in the process.

Parameters
isparkedset to true if parked, false otherwise.

Definition at line 1281 of file indidome.cpp.

bool Dome::SetSpeed ( double  rpm)
protectedvirtual

SetSpeed Set Dome speed. This does not initiate motion, it sets the speed for the next motion command. If motion is in progress, then change speed accordingly.

Parameters
rpmDome speed (RPM)
Returns
true if successful, false otherwise

Definition at line 1730 of file indidome.cpp.

IPState Dome::UnPark ( )
protectedvirtual

UnPark dome. The action of the Unpark command is dome specific, but it may include opening the shutter and moving to home position. When UnPark() is successful The observatory should be in a ready state to utilize the mount to perform observations.

Returns
Return IPS_OK if motion is completed and Dome is unparked. Return IPS_BUSY if Dome unparking is in progress. Return -IPS_ALERT if there is an error.

Reimplemented in BaaderDome, DomeScript, RollOff, and DomeSim.

Definition at line 1832 of file indidome.cpp.

void Dome::UpdateAutoSync ( )
protectedvirtual

UpdateAutoSync This function calculates the target dome azimuth from the mount's target coordinates given the dome parameters. If the difference between the dome's and mount's azimuth angles exceeds the AutoSync threshold, the dome will be commanded to sync to the mount azimuth position.

Definition at line 1182 of file indidome.cpp.

void Dome::UpdateMountCoords ( )
protected

updateCoords updates the horizontal coordinates (Az & Alt) of the mount from the snooped RA, DEC and observer's location.

Definition at line 1149 of file indidome.cpp.

bool Dome::updateProperties ( )
virtual

updateProperties is called whenever there is a change in the CONNECTION status of the driver. This will enable the driver to react to changes of switching ON/OFF a device. For example, a driver may only define a set of properties after a device is connected, but not before.

Returns
True if update is successful, false otherwise.

Reimplemented from INDI::DefaultDevice.

Reimplemented in BaaderDome, DomeScript, DomeSim, and RollOff.

Definition at line 217 of file indidome.cpp.

bool Dome::WriteParkData ( )
protected

Definition at line 1428 of file indidome.cpp.

Member Data Documentation

ISwitch INDI::Dome::AbortS[1]
protected

Definition at line 458 of file indidome.h.

ISwitchVectorProperty INDI::Dome::AbortSP
protected

Definition at line 457 of file indidome.h.

IText INDI::Dome::ActiveDeviceT[2]
protected

Definition at line 483 of file indidome.h.

ITextVectorProperty INDI::Dome::ActiveDeviceTP
protected

Definition at line 482 of file indidome.h.

ISwitch INDI::Dome::AutoParkS[2]
protected

Definition at line 475 of file indidome.h.

ISwitchVectorProperty INDI::Dome::AutoParkSP
protected

Definition at line 476 of file indidome.h.

uint32_t INDI::Dome::capability
protected

Definition at line 478 of file indidome.h.

INumber INDI::Dome::DomeAbsPosN[1]
protected

Definition at line 452 of file indidome.h.

INumberVectorProperty INDI::Dome::DomeAbsPosNP
protected

Definition at line 451 of file indidome.h.

ISwitch INDI::Dome::DomeAutoSyncS[2]
protected

Definition at line 498 of file indidome.h.

ISwitchVectorProperty INDI::Dome::DomeAutoSyncSP
protected

Definition at line 497 of file indidome.h.

enum { ... } INDI::Dome::DomeConnection
INumber INDI::Dome::DomeMeasurementsN[6]
protected

Definition at line 493 of file indidome.h.

INumberVectorProperty INDI::Dome::DomeMeasurementsNP
protected

Definition at line 494 of file indidome.h.

ISwitch INDI::Dome::DomeMotionS[2]
protected

Definition at line 449 of file indidome.h.

ISwitchVectorProperty INDI::Dome::DomeMotionSP
protected

Definition at line 448 of file indidome.h.

INumber INDI::Dome::DomeParamN[1]
protected

Definition at line 461 of file indidome.h.

INumberVectorProperty INDI::Dome::DomeParamNP
protected

Definition at line 460 of file indidome.h.

INumber INDI::Dome::DomeRelPosN[1]
protected

Definition at line 455 of file indidome.h.

INumberVectorProperty INDI::Dome::DomeRelPosNP
protected

Definition at line 454 of file indidome.h.

ISwitch INDI::Dome::DomeShutterS[2]
protected

Definition at line 464 of file indidome.h.

ISwitchVectorProperty INDI::Dome::DomeShutterSP
protected

Definition at line 463 of file indidome.h.

INumber INDI::Dome::DomeSpeedN[1]
protected

Definition at line 446 of file indidome.h.

INumberVectorProperty INDI::Dome::DomeSpeedNP
protected

Definition at line 445 of file indidome.h.

ISwitch INDI::Dome::OTASideS[2]
protected

Definition at line 496 of file indidome.h.

ISwitchVectorProperty INDI::Dome::OTASideSP
protected

Definition at line 495 of file indidome.h.

DomeParkData INDI::Dome::parkDataType
protected

Definition at line 480 of file indidome.h.

ISwitch INDI::Dome::ParkOptionS[3]
protected

Definition at line 472 of file indidome.h.

ISwitchVectorProperty INDI::Dome::ParkOptionSP
protected

Definition at line 473 of file indidome.h.

INumber INDI::Dome::ParkPositionN[1]
protected

Definition at line 469 of file indidome.h.

INumberVectorProperty INDI::Dome::ParkPositionNP
protected

Definition at line 470 of file indidome.h.

ISwitch INDI::Dome::ParkS[2]
protected

Definition at line 467 of file indidome.h.

ISwitchVectorProperty INDI::Dome::ParkSP
protected

Definition at line 466 of file indidome.h.

int INDI::Dome::PortFD = -1
protected

Definition at line 503 of file indidome.h.

ISwitch INDI::Dome::PresetGotoS[3]
protected

Definition at line 491 of file indidome.h.

ISwitchVectorProperty INDI::Dome::PresetGotoSP
protected

Definition at line 492 of file indidome.h.

INumber INDI::Dome::PresetN[3]
protected

Definition at line 489 of file indidome.h.

INumberVectorProperty INDI::Dome::PresetNP
protected

Definition at line 490 of file indidome.h.

double INDI::Dome::prev_alt
protected

Definition at line 500 of file indidome.h.

double INDI::Dome::prev_az
protected

Definition at line 500 of file indidome.h.

double INDI::Dome::prev_dec
protected

Definition at line 500 of file indidome.h.

double INDI::Dome::prev_ra
protected

Definition at line 500 of file indidome.h.

Connection::Serial* INDI::Dome::serialConnection = NULL
protected

Definition at line 505 of file indidome.h.

ShutterStatus INDI::Dome::shutterState
protected

Definition at line 479 of file indidome.h.

Connection::TCP* INDI::Dome::tcpConnection = NULL
protected

Definition at line 506 of file indidome.h.

ISwitch INDI::Dome::TelescopeClosedLockT[2]
protected

Definition at line 487 of file indidome.h.

ISwitchVectorProperty INDI::Dome::TelescopeClosedLockTP
protected

Definition at line 486 of file indidome.h.


The documentation for this class was generated from the following files: