QP  0.7-SNAPSHOT
Control software for the ??SRT telescope
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
State Class Reference

The State class holds the state of the system while it is slewing or tracking. More...

#include <state.h>

Public Member Functions

 State (Schedule *schedule, const ms_t current_time, const Position *obs=NULL)
 Initialise the state. More...
 
 State ()
 No-arg constructor. More...
 
ms_t step (ms_t t)
 Retrospectively update the state by incrementally rotating the pointing. More...
 
void alt_click (ms_t t, double current_speed, double angle)
 Report a click in altitude. More...
 
void az_click (ms_t t, double current_speed, double angle)
 Return the current pointing of the state, as a vector in AzAlt coordinates. More...
 
double suggested_phidot_frac (void)
 Return the suggested rate of change in longitude, in units of fractional speed. More...
 
double suggested_thetadot_frac (void)
 Return the suggested rate of change in altitude, in units of fractional speed. More...
 
void set_schedule (Schedule *)
 Sets the schedule which the state is to follow. More...
 

Detailed Description

The State class holds the state of the system while it is slewing or tracking.

Constructor & Destructor Documentation

State::State ( Schedule schedule,
const ms_t  current_time,
const Position observatory = NULL 
)

Initialise the state.

Parameters
schedulethe schedule which this state is to follow
current_timethe current millis() time
observatorya System::Geog location for the observatory, or NULL if the position is to be taken to be in AzAlt coordinates
State::State ( )

No-arg constructor.

This isn't able to do anything useful, and is only for the case where we have no option but to initialise a static State object without complete information.

Member Function Documentation

void State::alt_click ( ms_t  t,
double  current_speed,
double  angle 
)

Report a click in altitude.

The caller is responsible for keeping track of the number of clicks received, and thus being able to calculate the actual position of the telescope at this point.

Parameters
tthe time the click was registered
current_speedthe current commanded speed of the telescope, as a fraction of full speed
anglethe angular position of the telescope at the point this click was received
void State::az_click ( ms_t  t,
double  current_speed,
double  angle 
)

Return the current pointing of the state, as a vector in AzAlt coordinates.

Return the current position of the state, as a Position object. Report an azimuthal click. The caller is responsible for keeping track of the number of clicks received, and thus being able to calculate the actual position of the telescope at this point.

Parameters
tthe time the click was registered
current_speedthe current commanded speed of the telescope, as a fraction of full speed
anglethe angular position of the telescope at the point this click was received
void State::set_schedule ( Schedule sch)

Sets the schedule which the state is to follow.

The state retains a pointer to this schedule, but does not take a copy of it.

ms_t State::step ( ms_t  actual_reftime_ms)

Retrospectively update the state by incrementally rotating the pointing.

This updates the phidot and thetadot values. This steps the state by the rotation corresponding to the controller's actual phi and theta speeds, which are presumed to have been applied for the given number of ms.

Because this updates the state's notion of its position, this method should be called before any change in commanded speed. XXX NO

Parameters
actual_reftime_msthe current reference time, in ms.
Returns
(new) step time in millisecond, or zero to indicate that we've arrived at a destination, or should otherwise stop
double State::suggested_phidot_frac ( void  )

Return the suggested rate of change in longitude, in units of fractional speed.

This is a suggestion to the controller, made by this state's internal schedule, of what commanded (fractional) speed would keep the telescope working on that schedule. Longitude increases east of south.

double State::suggested_thetadot_frac ( void  )

Return the suggested rate of change in altitude, in units of fractional speed.

Positive moves towards the zenith.

See also
suggested_phidot_frac

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