The Activity abstract class encapsulates the state for extended projects, such as calibrations.
More...
#include <activities.h>
|
enum | ActivityTypes {
BaseActivity,
CalibrationActivity,
ScheduleFollowingActivity,
DriveAzAltActivity,
TrackSiderealActivity,
TrackAzimuthActivity
} |
| The activity types here correspond to the this class and its subclasses. More...
|
|
|
virtual void | az_click (ms_t t, double azimuth) |
| The method called when the system detects an azimuthal click. More...
|
|
virtual void | alt_click (ms_t t, double altitude) |
| The method called when the system detects an altitude click. More...
|
|
virtual void | at_endstop (ms_t t, int az_click_count, int alt_click_count)=0 |
| The method called when the system detects a timeout, at the limit of an axis's travel. More...
|
|
bool | is_complete (void) const |
| Return true if the activity is complete. More...
|
|
bool | is_valid (void) const |
| Return true if the activity is valid. More...
|
|
virtual void | cancel (void) |
| Cancel the activity. More...
|
|
ActivityTypes | type (void) |
| Return the type of Activity.
|
|
virtual ms_t | start (ms_t now) |
| The activity will be started by the main loop calling the start function. More...
|
|
virtual ms_t | poke (ms_t t) |
| From time to time, the main loop will 'poke' this activity, by calling this function. More...
|
|
The Activity abstract class encapsulates the state for extended projects, such as calibrations.
The various callbacks below may return the current object, or a pointer to a new Activity subclass.
The method is_complete indicates that an Activity has completed, and that any state or results within it may be retrieved.
The activity types here correspond to the this class and its subclasses.
These are used as the values returned by type, and are associated in the obvious ways with the associated derived types of this class.
void Activity::alt_click |
( |
ms_t |
t, |
|
|
double |
altitude |
|
) |
| |
|
virtual |
The method called when the system detects an altitude click.
This is for the information of the activity; it should not attempt to update a telescope position.
- Parameters
-
t | the current time |
altitude | the estimated angle, in radians north from horizontal |
Reimplemented in Calibration.
virtual void Activity::at_endstop |
( |
ms_t |
t, |
|
|
int |
az_click_count, |
|
|
int |
alt_click_count |
|
) |
| |
|
pure virtual |
The method called when the system detects a timeout, at the limit of an axis's travel.
- Parameters
-
t | the current time |
az_click_count | the azimuthal click-count at this position |
alt_click_count | the altitudinal click-count at this position |
Implemented in ScheduleFollowing, and Calibration.
void Activity::az_click |
( |
ms_t |
t, |
|
|
double |
azimuth |
|
) |
| |
|
virtual |
The method called when the system detects an azimuthal click.
This is for the information of the activity; it should not attempt to update a telescope position.
- Parameters
-
t | the current time |
azimuth | the estimated angle, in radians east from south |
Reimplemented in Calibration.
void Activity::cancel |
( |
void |
| ) |
|
|
virtual |
void Activity::delete_all_allocations |
( |
void |
| ) |
|
|
static |
Delete all activity allocations.
This doesn't do any cancelling or other tidyup. It's primarily intended to support unit tests, but might be of use in, for example, some catch-all exception handler.
bool Activity::is_complete |
( |
void |
| ) |
const |
|
inline |
Return true if the activity is complete.
bool Activity::is_valid |
( |
void |
| ) |
const |
|
inline |
Return true if the activity is valid.
void Activity::mark_as_complete |
( |
void |
| ) |
|
|
inlineprotected |
Set to true by a derived class when its work is done.
- See also
- is_completeMark the activity as complete
void Activity::mark_as_invalid |
( |
void |
| ) |
|
|
inlineprotected |
Mark the activity as invalid.
int Activity::max_activities |
( |
void |
| ) |
|
|
static |
Return the maximum number of activities it's possible to have allocated at one time.
This is a compilation constant.
int Activity::n_activities |
( |
void |
| ) |
|
|
static |
Return the number of currently allocated activities.
This will generally be the same as the number of activities in the queue, but this counts the allocations rather than the queue size.
void * Activity::operator new |
( |
size_t |
size | ) |
|
|
static |
Allocate space for an Activity.
If there is no space for a new activity, then we throw a recoverable error, which takes us back to the qp main loop.
virtual ms_t Activity::poke |
( |
ms_t |
t | ) |
|
|
inlinevirtual |
From time to time, the main loop will 'poke' this activity, by calling this function.
This allows the activity to undertake some periodic activity.
- Parameters
-
- Returns
- the time at which the main loop should next poke this activity
Reimplemented in ScheduleFollowing.
virtual ms_t Activity::start |
( |
ms_t |
now | ) |
|
|
inlinevirtual |
byte Activity::activity_status |
|
protected |
The documentation for this class was generated from the following files: