My Project
|
#include <Tracker.h>
Protected Types | |
enum | NextDriveState { IGNORE, HALT, SLEW, WAIT, TARGET, SYNC, SLAVE, REBOOT } |
Protected Member Functions | |
Tracker (AntennaDrive *parent) | |
virtual | ~Tracker () |
virtual void | processMsg (TrackerMsg *msg) |
void | resetMembers () |
void | reset () |
virtual void | initialize () |
void | archiveStatus () |
void | updatePmac (TimeVal &mjd, AxisPositions *current) |
void | updateMountLimits () |
void | sourcePosition (gcp::util::TimeVal &mjd) |
void | sourcePosition (gcp::util::TimeVal &mjd, Pointing &thisTargetVal) |
void | sourcePositionTrack (gcp::util::TimeVal &mjd, double utc) |
void | sourcePositionTrack (gcp::util::TimeVal &mjd, double utc, Pointing &thisTargetVal) |
void | sourcePositionCenter (gcp::util::TimeVal &mjd) |
void | sourcePositionCenter (gcp::util::TimeVal &mjd, Pointing &thisTargetVal) |
virtual void | pmacNewPosition (gcp::util::PmacMode::Mode mode, AxisPositions *current, gcp::util::TimeVal &mjd) |
void | finalizePointing (double pmra, double pmdec, PointingCorrections *f, Pointing *p, gcp::util::TimeVal &mjd) |
void | finalizePointing (double pmra, double pmdec, PointingCorrections *f, Pointing *p, gcp::util::TimeVal &mjd, Pointing &thisTargetVal) |
void | finalizePointing (gcp::util::TimeVal &mjd) |
void | finalizePointing (gcp::util::TimeVal &mjd, Pointing &thisTargetVal) |
void | registerRequest (unsigned seq) |
virtual void | addTick (TrackerMsg *msg) |
virtual void | addTickOvro (TrackerMsg *msg) |
void | calCollimation (TrackerMsg *msg) |
void | calEncoders (TrackerMsg *msg) |
void | calFlexure (TrackerMsg *msg) |
void | calTilts (TrackerMsg *msg) |
void | changeYear (TrackerMsg *msg) |
void | extendEqnEqx (TrackerMsg *msg) |
void | extendTrack (TrackerMsg *msg) |
void | extendScan (TrackerMsg *msg) |
void | extendUt1Utc (TrackerMsg *msg) |
void | haltTelescope (TrackerMsg *msg=0) |
void | locateSite (TrackerMsg *msg) |
void | locateAntenna (TrackerMsg *msg) |
void | rebootDrive (TrackerMsg *msg) |
void | recordEncoderLimits (TrackerMsg *msg) |
void | selectModel (TrackerMsg *msg) |
void | setEncoderZero (TrackerMsg *msg) |
void | setOffset (TrackerMsg *msg) |
void | setSlewRate (TrackerMsg *msg) |
void | slewTelescope (TrackerMsg *msg) |
void | updateRefraction (TrackerMsg *msg) |
void | updateRefraction () |
virtual void | connectPmac () |
virtual void | disconnectPmac () |
bool | okToPoint () |
void | setNextState (NextDriveState state) |
void | strobeServo (TrackerMsg *msg) |
bool | acknowledgeCompletion () |
void | executeServoCmd (TrackerMsg *msg) |
![]() | |
GenericTask () | |
GenericTask (Thread *thread) | |
virtual | ~GenericTask () |
void | sendTaskMsg (TrackerMsg *msg) |
void | startThreads (void *arg) |
void | startThread (void *arg, unsigned order) |
unsigned | getMinStartOrder () |
bool | threadsNeedStarting () |
void | cancelThreads () |
void | cancelThread (unsigned order) |
unsigned | getMinCancelOrder () |
bool | threadsNeedCancelling () |
void | pingThreads (void *arg) |
void | raise (std::string name, int sigNo) |
Thread * | getThread (std::string name) |
bool | threadsAreRunning () |
void | shutdownConnection (int fd) |
virtual void | serviceMsgQ (void) |
virtual void | restart (void) |
virtual void | run (void) |
virtual void | processTaskMsg (bool *stop) |
virtual void | processMsg (TrackerMsg *msg) |
virtual void | respondToHeartBeat () |
virtual void | installTimer (TrackerMsg *msg) |
virtual void | installSignal (TrackerMsg *msg) |
virtual void | enableTimer (TrackerMsg *msg) |
virtual void | addHandler (TrackerMsg *msg) |
void | stepCommands () |
Protected Attributes | |
bool | simPmac_ |
bool | simGps_ |
AntennaDrive * | parent_ |
bool | shutdownPending_ |
int | year_ |
NextDriveState | whatNext_ |
unsigned | archived_ |
unsigned | lacking_ |
bool | encoderCalPending_ |
volatile long | lastReq_ |
volatile long | lastAck_ |
gcp::util::TrackingStatus::Status | oldStatus_ |
gcp::util::TrackingStatus::Status | newStatus_ |
bool | paramsUpdated_ |
int | pmacTracking_ |
Atmosphere | atmos_ |
Model | model_ |
ServoCommsSa * | servo_ |
Pointing | nextTarget_ |
Pointing | nextTarget1_ |
Pointing | nextTarget2_ |
Position | lastCommanded_ |
Position | prevCommanded_ |
Position | tertCommanded_ |
Site | site_ |
gcp::util::Atmosphere | refracCalculator_ |
gcp::util::Source | src_ |
Scan | scan_ |
gcp::util::TimeVal | currentTick_ |
gcp::util::TimeVal | lastTick_ |
TrackerBoard * | tracker_ |
TrackerOffset | offset_ |
![]() | |
Thread * | thread_ |
std::vector< Thread * > | threads_ |
PipeQ< TrackerMsg > | msgq_ |
gcp::util::FdSet | fdSet_ |
std::vector< Command * > | commands_ |
struct timeval * | timeOut_ |
TimeVal | commandTimeOut_ |
Friends | |
class | AntennaDrive |
Additional Inherited Members | |
![]() | |
SpecificTask () | |
virtual | ~SpecificTask () |
SpecificShare * | getShare () |
![]() | |
void | sendRestartMsg () |
void | sendStopMsg () |
void | sendHeartBeatMsg () |
virtual void | fwdTaskMsg (TrackerMsg *msg) |
![]() | |
SpecificShare * | share_ |
Define a class that will handle pointing and tracking for this antenna.
|
protected |
The following identifiers define stages in the state machine that controls the drive.
|
protected |
Constructor function requires the shared resource object which will maintain pertinent registers of this antenna's state.
Exception | ....................................................................... Allocate all of the resources needed by the tracker task. Note that no further resource allocation or re-allocation should be peformed while the task is running. This means that the instrument can be left unattended after start-up without the fear of resource depletion causing unexpected failures. |
Input:
parent AntennaDrive * Resources of the parent object.
|
protectedvirtual |
Destructor.
....................................................................... Delete the resources of a tracker-task.
|
protectedvirtual |
Respond to a tick from the time-code reader ISR by recording the new clock offset. If a resynchronization of the clock has been requested, also check the time against the time-code reader and correct it if necessary.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Respond to a 1-second tick from the time-code reader ISR by recording the new clock offset. If a resynchronization of the clock has been requested, also check the time against the time-code reader and correct it if necessary.
Modification for South African Telescope – need to calculate three positions to send to the telescope
Input:
msg TrackerMsg* The message received on the Tracker message queue.
|
protectedvirtual |
OLD ADDTICK....................................................................... Respond to a 1-second tick from the time-code reader ISR by recording the new clock offset. If a resynchronization of the clock has been requested, also check the time against the time-code reader and correct it if necessary.
Input:
msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Record the current tracking status (newStatus_) in the archive database and in oldStatus_.
....................................................................... Record the current tracking status (trk->new_status) in the archive database and in trk->old_status.
|
protected |
Calibrate the collimation of the telescope.
....................................................................... Calibrate the collimation of the telescope.
|
protected |
Record new encoder offsets and multipliers.
....................................................................... Record new encoder offsets and multipliers.
Input: msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Calibrate the gravitational flexure of the telescope.
....................................................................... Calibrate the gravitational flexure of the telescope.
|
protected |
Calibrate the axis tilts of the telescope.
....................................................................... Calibrate the axis tilts of the telescope.
|
protected |
Update the year. Note that the time code reader doesn't supply the year, so the year has to be provided by the control program.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Update the year. Note that the time code reader doesn't supply the year, so the year has to be provided by the control program.
Input:
msg TrackerMsg* The message received on the Tracker message queue.
|
protectedvirtual |
Attempt to connect to the pmac.
....................................................................... Attempt to connect to the pmac.
|
protectedvirtual |
A function called when an error occurs talking to the pmac.
....................................................................... This function will be called if an error occurs talking to the pmac.
|
protected |
............................................................ Execute a Servo specific command
|
protected |
Update the equation-of-the-equinoxes interpolator.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
Exception | ....................................................................... Update the equation-of-the-equinoxes interpolator. |
|
protected |
Extend the ephemeris of the current scan
....................................................................... Extend the ephemeris of the current scan
Input: msg TrackerMsg* The message received on the Tracker message queue.
Initialize the scan cache fixed members if this is the start of a new scan.
Let the pointing routines know that the current scan is active.
|
protected |
Extend the ephemeris of the current source.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Extend the ephemeris of the current source.
Input: msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Update the UT1-UTC interpolator.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
Exception | ....................................................................... Update the UT1-UTC interpolator. |
Input: msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Prototype the functions that implement the various stages of pointing calculations
....................................................................... Compute the final az,el,pa and associated drive rates.
Input:
pmra double The proper motion in Right Ascension (radians/sec). pmdec double The proper motion in Declination (radians/sec). f PointingCorrections * The corrected az,el and latitude.
|
protected |
....................................................................... Compute the final az,el,pa and associated drive rates.
Input:
pmra double The proper motion in Right Ascension (radians/sec). pmdec double The proper motion in Declination (radians/sec). f PointingCorrections * The corrected az,el and latitude.
|
protected |
Arrange to halt the telescope. If the pmac new_position flag is set this will be done immediately, otherwise it will be postponed to the next 1-second tick.
msg | TrackerMsg * If the halt command was received from the control program then this must contain a transaction sequence number. Otherwise send NULL. |
....................................................................... Arrange to halt the telescope. If the pmac new_position flag is set this will be done immediately, otherwise it will be postponed to the next 1-second tick.
Input: msg TrackerMsg * If the halt command was received from the control program then this must contain a transaction sequence number. Otherwise send NULL.
|
protectedvirtual |
|
protected |
Update the antenna-specific offset
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Update the local and system-wide site-location parameters.
Input:
msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Update the local and system-wide site-location parameters.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Update the local and system-wide site-location parameters.
Input:
msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Return true if we have enough information to roughly point the telescope.
....................................................................... Return true if we have enough information to roughly point the telescope.
|
protectedvirtual |
current | AxisPositions * The current position of the telescope, as readPosition(). |
Exception | ....................................................................... Write a given drive command into the drive dual-port-ram. Before invoking this function, the caller must call DriveBoard::isBusy() to see whether the drive is ready for a new command. |
Input:
mode PmacMode The command-type to send. current AxisPositions * The current position of the telescope, as
|
protectedvirtual |
Public method to initate a response to a message received on the AntennaDrive message queue
Exception | ....................................................................... Process a message received on the Tracker message queue |
Input:
msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Arrange to reboot the pmac. If the pmac new_position flag is set this will be done immediately, otherwise it will be postponed to the next 1-second tick.
msg | TrackerMsg * If the halt command was received from the control program then this must contain a transaction sequence number. Otherwise send NULL. |
....................................................................... Arrange to reboot the drive.
Input: msg TrackerMsg * If the halt command was received from the control program then this must contain a transaction sequence number. Otherwise send NULL.
|
protected |
Record new encoder limits.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Record new encoder limits.
Input:
msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Register the receipt of a control-program command that needs to be acknowledged when has taken effect. Also mark the tracking parameters as modified.
Input: seq unsigned The sequence number assigned to the command by the control program.
....................................................................... Register the receipt of a control-program command that needs to be acknowledged when has taken effect. Also mark the tracking parameters as modified.
Input: seq unsigned The sequence number assigned to the command by the control program.
|
protected |
This function is called by new_Tracker() and ini_Tracker() to clear legacy pointing model terms before the thread is next run. It assumes that all pointers either point at something valid or have been set to NULL.
....................................................................... This function is called by new_Tracker() and ini_Tracker() to clear legacy pointing model terms before the thread is next run. It assumes that all pointers either point at something valid or have been set to NULL.
|
protected |
....................................................................... Reset non-pointer members of the Tracker object
|
protected |
Select between the optical and radio pointing models.
....................................................................... Select between the optical and radio pointing models.
|
protected |
Install new encoder offsets.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Install new encoder offsets.
Input: msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Adjust the tracking offsets of specified drive axes, and round them into the range -pi..pi.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Adjust the tracking offsets of specified drive axes, and round them into the range -pi..pi.
Input: msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Install new slew rates.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Install new slew rates.
Input: msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Arrange to slew the telescope to a given az,el,dk coordinate.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Arrange to slew the telescope to a given az,el,dk coordinate.
Input: msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
Compute the encoder positions and rates needed to track a given source at a given utc.
mjd | int The day component of the MJD utc at which coordinates are required. |
sec | int The MJD utc time of day, in seconds. |
....................................................................... Compute the encoder positions and rates needed to track a given source at a given utc.
Input: mjd int The day component of the MJD utc at which coordinates are required. sec int The MJD utc time of day, in seconds.
|
protected |
....................................................................... Compute the encoder positions and rates needed to track a given source at a given utc.
Input: mjd int The day component of the MJD utc at which coordinates are required. target to modify sec int The MJD utc time of day, in seconds.
|
protected |
Update the mount-angle limits that correspond to revised values of model.{az,el,dk}.{per_turn,per_radian,zero,min,max}, and mark them as unarchived.
....................................................................... Update the mount-angle limits that correspond to revised values of model.{az,el,dk}.{per_turn,per_radian,zero,min,max}, and mark them as unarchived.
|
protected |
....................................................................... This is a private function of Tracker::addTick() used to update the pmac on each one second tick when PmacBoard::isBusy() returns false.
Input:
mjd TimeVal& The Julian Date (utc). current AxisPositions* The current position of the telescope.
|
protected |
Record new refraction coefficients received from the weather station task.
msg | TrackerMsg* The message received on the AntennaDrive message queue. |
....................................................................... Record new refraction coefficients received from the weather station task.
Input:
msg TrackerMsg* The message received on the Tracker message queue.
|
protected |
....................................................................... Update the refraction
|
protected |
The time of the last time-code-reader interrupt
|
protected |
The current mount tracking offsets
|
protected |
Pointer to the resources of the parent task.
|
protected |
True when a shutdown request has been received.
|
protected |
A virtual board of tracker registers