CARMA C++
|
Manages antenna drive control DO connections. More...
#include <carma/control/DriveHandle.h>
Public Types | |
enum | SourceMode { SOURCE_MODE_RA_DEC, SOURCE_MODE_AZ_EL, SOURCE_MODE_IDLE, SOURCE_MODE_INVALID } |
Public Member Functions | |
void | checkModeForEquatOffset (void) |
Check if the drive mode is in an appropriate state for calling setEquatOffset. More... | |
void | conditionallyUpdateTrackTolerance (const double freq) |
Check to see if the HPBW has changed enough to warrant a threshold update, converting from hpbw to arcsec. More... | |
DriveHandle (unsigned short carmaAntNo, const services::Location &coords, monitor::MonitorSystem &monitorSystem, monitor::ControlSubsystemBase::Antenna &antenna) | |
Constructor. More... | |
::std::string | getCarmaAntennaName () const |
Returns antenna name as full carma name. More... | |
unsigned short | getCarmaAntennaNo () const |
services::Ephemeris | getEphemeris () const |
services::Location | getLocation () const |
Method to get antenna's location as longitude, latitude, altitude. More... | |
carma::services::Source | getSource () |
SourceMode | getSourceMode () const |
Method to get source mode of antenna - it can point at nothing, or at a source specified by RA/DEC, or a point in the sky specified by Az/El. More... | |
::std::string | getSourceName () |
::std::string | getTypedAntennaName () const |
Returns antenna name as full type qualified name. More... | |
bool | isActionComplete (const monitor::MonitorSystem &monsys, int monDataErrorLimit) |
Compare next sequence number with one returned by the monitor system. More... | |
void | setAz (double azDegrees, int preferredSequenceNo) |
Set antenna azimuth. More... | |
void | setAzel (double azDegrees, double elDegrees, int preferredSequenceNo) |
Set antenna azimuth and elevation. More... | |
void | setAzOffset (double azArcmin, int preferredSequenceNo) |
Set antenna Az offset for astronomy or engineering. More... | |
void | setBimaMountPointingConstants (::std::vector< double > dazCoefs,::std::vector< double > delCoefs) |
Set BIMA mount pointing constants. More... | |
void | setEl (double elDegrees, int preferredSequenceNo) |
Set antenna elevation. More... | |
void | setElOffset (double elArcmin, int preferredSequenceNo) |
Set antenna El offset for astronomy or engineering. More... | |
void | setEquatOffset (double ra, double dec) |
Defines equatorial offsets in ra and dec from the input source. More... | |
void | setLocation (const services::Location &location) |
Method to set antenna's absolute location. More... | |
void | setMountOffset (double azArcmin, double elArcmin, int preferredSequenceNo) |
Set mount offsets. More... | |
void | setOffset (double azArcmin, double elArcmin, int preferredSequenceNo) |
Set antenna Az/El offsets for astronomy or engineering. More... | |
void | setOvroMountPointingConstants (double m1, double m2, double m3, double m4, double m5) |
Set OVRO mount pointing constants. More... | |
void | setSafeRange (float azLow, float azHigh, float elLow, float elHigh) |
Set the azimuth and elevation ranges within which this antenna is safe from collisions with other antennas. More... | |
void | setSzaEncoderLimits (double azMinEncoderCount, double azMaxEncoderCount, double elMinEncoderCount, double elMaxEncoderCount) |
Set SZA encoder limits. More... | |
void | setSzaEncoderZeros (double azEncoderZeroDegrees, double elEncoderZeroDegrees) |
Set SZA encoder zeros. More... | |
void | setSzaMountPointingConstants (double azEncoderCountsPerTurn, double elEncoderCountsPerTurn, double azMinEncoderCount, double azMaxEncoderCount, double elMinEncoderCount, double elMaxEncoderCount, double azEncoderZeroDegrees, double elEncoderZeroDegrees, double haTiltDegrees, double latTiltDegrees, double elTiltDegrees, double opticalXCollimationDegrees, double opticalYCollimationDegrees, double opticalFlexureSinDegrees, double opticalFlexureCosDegrees, double radioXCollimationDegrees, double radioYCollimationDegrees, double radioFlexureSinDegrees, double radioFlexureCosDegrees) |
Set SZA mount pointing constants. More... | |
void | setSzaTilts (double haTiltDegrees, double latTiltDegrees, double elTiltDegrees) |
Set SZA tilts. More... | |
void | startTrack (const ::std::string source, const carma::control::MjdTriplet mjdTriplet, const ::std::string userCatalog, const carma::control::AzWrapMode azWrapMode, double time, int preferredSequenceNo) |
For use the first time this drive tracks a given object. More... | |
void | startTrackX (const carma::services::Source source, const carma::control::MjdTriplet mjdTriplet, const carma::control::AzWrapMode azWrapMode, double time, int preferredSequenceNo) |
Version of startTrack that takes a Source object instead of a source name and catalog. More... | |
void | stop () |
Stop the antenna at its current azimuth and elevation. More... | |
void | stow (antenna::common::DriveControl::Position position, int preferredSequenceNo) |
Move the antenna one of the stow positions (zenith, service, safe). More... | |
void | test (double aSeconds, double bSeconds, long whichTest) |
void | trackCurrentSourceWithOffsets (const carma::control::MjdTriplet mjdTriplet, const ::std::string userCatalog, carma::control::AzWrapMode azWrapMode, int preferredSequenceNo) |
Continue tracking the current source with new equatorial offsets. More... | |
void | trackCurrentSourceWithOffsets (const carma::control::MjdTriplet mjdTriplet, carma::control::AzWrapMode azWrapMode, int preferredSequenceNo) |
void | trackingThreshold (float hpbw) |
Set the tracking threshold. More... | |
void | updateTracking (double mjd) |
Updates tracking information to antenna,. More... | |
void | updateTrackTolerance (const float tolerance, const double freq) |
Set the tracking threshold to the antennas. More... | |
void | updateWeather (double mjd, const services::Temperature &airTemp, const services::Pressure &atmPressure, double relhumid, const services::Temperature &dewpointTemp, const services::Velocity &windSpeed, const services::Angle &windDirection, bool logGoodSend) |
Updates weather information to drive. More... | |
![]() | |
template<typename S > | |
S::_var_type | narrowedRemoteObj () const |
Returns remote object handle as var. More... | |
T::_var_type | remoteObj () const |
Returns remote object handle as var. More... | |
RemoteObjHandleT (const ::std::string &doName, monitor::MonitorPointBool *mpReachable, const monitor::MonitorSubsystem *subsystem, monitor::MonitorSystem *system, bool defaultLogIfNotReachable, bool defaultLogSentCommands) | |
Constructor. More... | |
virtual | ~RemoteObjHandleT () |
Destructor. More... | |
![]() | |
bool | attemptToReconnectIfNeeded () |
Try reconnect to the DO if needed. More... | |
::std::string | doName () const |
get the DO name More... | |
void | forceFullReconnect () |
Force a full re-lookup of the DO by name. More... | |
bool | isObjReachable () |
If state is 'not reachable' and monitor system is current, tries to reconnect. More... | |
bool | isObjReachable (bool logIfNotReachable) |
RemoteObjHandleBase (const ::std::string &doName, monitor::MonitorPointBool *mpReachable, const monitor::MonitorSubsystem *subsystem, monitor::MonitorSystem *system, bool defaultLogIfNotReachable, bool defaultLogSentCommands) | |
Constructor. More... | |
virtual | ~RemoteObjHandleBase () |
Destructor. More... | |
Additional Inherited Members | |
![]() | |
virtual bool | resolveObjRef () |
![]() | |
bool | getDefaultLogIfNotReachable () const |
bool | getDefaultLogSentCommands () const |
void | invalidateObjRef () |
void | invalidateObjRefIfNeededForCaught () |
void | logException (const ::std::string &callString, const ::std::string &exString) const |
void | logSentCommand (const ::std::string &callString, const double mjd) const |
void | logSentCommand (const ::std::string &callString, const double mjd, const ::std::string &subDoName) const |
void | logSentCommandIfNeeded (const ::std::string &callString, const double mjd) const |
void | logSentCommandIfNeeded (const ::std::string &callString, const double mjd, const ::std::string &subDoName) const |
void | markObjRefValid () |
void | processException (const ::std::string &callString, const ::CORBA::Exception &corbaException) |
void | throwBadRemoteObjAccess () const |
void | throwIfObjRefIsNotValid () const |
Manages antenna drive control DO connections.
Definition at line 55 of file DriveHandle.h.
carma::control::DriveHandle::DriveHandle | ( | unsigned short | carmaAntNo, |
const services::Location & | coords, | ||
monitor::MonitorSystem & | monitorSystem, | ||
monitor::ControlSubsystemBase::Antenna & | antenna | ||
) |
Constructor.
carmaAntNo | const long - CARMA antenna number |
coords | antenna location coordinates |
monitorSystem | carma monitor system Allows antenna to get a reference to its own monitor stream. |
antenna | const monitor::ControlSubsystemBase::Antenna& antenna control monitor system, which contains control and monitor points set by the control subsystem. |
void carma::control::DriveHandle::checkModeForEquatOffset | ( | void | ) |
Check if the drive mode is in an appropriate state for calling setEquatOffset.
This method will throw an exception if the drive mode is wrong. This method is necessary to inform observers what they did wrong, since firing off setEquatOffset in a WorkerPool swallows the exception message. So call this first in a iterative loop, before doing WorkerPool magic.
This method is not expensive since the call stays inside the drive handle and never goes to the DO.
void carma::control::DriveHandle::conditionallyUpdateTrackTolerance | ( | const double | freq | ) |
Check to see if the HPBW has changed enough to warrant a threshold update, converting from hpbw to arcsec.
We use a 3% change criterion. If it has, then update the threshold to the antennas. This is used when the frequency is updated.
The | current LO freq in GHz (used in conversion to arcsec). |
::std::string carma::control::DriveHandle::getCarmaAntennaName | ( | ) | const |
Returns antenna name as full carma name.
For OVRO antenna 3 returns "carma3".
unsigned short carma::control::DriveHandle::getCarmaAntennaNo | ( | ) | const |
services::Ephemeris carma::control::DriveHandle::getEphemeris | ( | ) | const |
services::Location carma::control::DriveHandle::getLocation | ( | ) | const |
Method to get antenna's location as longitude, latitude, altitude.
none |
SourceMode carma::control::DriveHandle::getSourceMode | ( | ) | const |
Method to get source mode of antenna - it can point at nothing, or at a source specified by RA/DEC, or a point in the sky specified by Az/El.
none |
::std::string carma::control::DriveHandle::getSourceName | ( | ) |
::std::string carma::control::DriveHandle::getTypedAntennaName | ( | ) | const |
Returns antenna name as full type qualified name.
For OVRO antenna 3 returns "ovro3".
bool carma::control::DriveHandle::isActionComplete | ( | const monitor::MonitorSystem & | monsys, |
int | monDataErrorLimit | ||
) |
Compare next sequence number with one returned by the monitor system.
If they are the same then the last drive action is complete.
monsys | monitor system from which to retrieve completion |
monitorDataErrorLimit | number of consecutive monitor data invalid limit before thowing an exception |
if | number of consecutive monitor data errors is exceeed |
void carma::control::DriveHandle::setAz | ( | double | azDegrees, |
int | preferredSequenceNo | ||
) |
Set antenna azimuth.
azDegrees | azimuth |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::setAzel | ( | double | azDegrees, |
double | elDegrees, | ||
int | preferredSequenceNo | ||
) |
Set antenna azimuth and elevation.
azDegrees | azimuth |
elDegrees | elevation |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::setAzOffset | ( | double | azArcmin, |
int | preferredSequenceNo | ||
) |
Set antenna Az offset for astronomy or engineering.
azArcmin | offset (arcmin) |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::setBimaMountPointingConstants | ( | ::std::vector< double > | dazCoefs, |
::std::vector< double > | delCoefs | ||
) |
Set BIMA mount pointing constants.
void carma::control::DriveHandle::setEl | ( | double | elDegrees, |
int | preferredSequenceNo | ||
) |
Set antenna elevation.
elDegrees | elevation |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::setElOffset | ( | double | elArcmin, |
int | preferredSequenceNo | ||
) |
Set antenna El offset for astronomy or engineering.
elArcmin | offset (arcmin) |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::setEquatOffset | ( | double | ra, |
double | dec | ||
) |
Defines equatorial offsets in ra and dec from the input source.
Note that these are sky offsets, not coordinate offsets; to convert an ra coord offset to a sky offset, multiply by cos(dec) Has no effect if not in equatorial mode. These offsets are set to zero when a new track command is given.
void carma::control::DriveHandle::setLocation | ( | const services::Location & | location | ) |
Method to set antenna's absolute location.
location | The longitude, latitude, and altitude, represented by a Location object. The input is expected to be in the geocentric coordinate system (ECEF), but gets changed to WGS84 before it is sent to the antennas. Baselines and interferometry geometry are done in ECEF but antennas are pointed in WGS84. |
void carma::control::DriveHandle::setMountOffset | ( | double | azArcmin, |
double | elArcmin, | ||
int | preferredSequenceNo | ||
) |
Set mount offsets.
azArcmin | Azimuth offset in arcminutes on the sky. |
elArcmin | Elevation offset in arcminutes on the sky. |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::setOffset | ( | double | azArcmin, |
double | elArcmin, | ||
int | preferredSequenceNo | ||
) |
Set antenna Az/El offsets for astronomy or engineering.
azArcmin | offset (arcmin) |
elArcmin | offset (arcmin) |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::setOvroMountPointingConstants | ( | double | m1, |
double | m2, | ||
double | m3, | ||
double | m4, | ||
double | m5 | ||
) |
Set OVRO mount pointing constants.
void carma::control::DriveHandle::setSafeRange | ( | float | azLow, |
float | azHigh, | ||
float | elLow, | ||
float | elHigh | ||
) |
Set the azimuth and elevation ranges within which this antenna is safe from collisions with other antennas.
Note: an invocation DriveControl::stow(SAFE) must throw an exception if valid safe ranges have not been set with this command beforehand.
azLow | - the low end of the safe azimuth range, in degrees. |
azHigh | - the high end of the safe azimuth range, in degrees. |
elLow | - the low end of the safe elevation range, in degrees. |
elHigh | - the high end of the safe elevation range, in degrees. |
carmaAntNoSeq | Sequence of carma antenna numbers. A sequence of the single value zero means all subarray antennas. |
void carma::control::DriveHandle::setSzaEncoderLimits | ( | double | azMinEncoderCount, |
double | azMaxEncoderCount, | ||
double | elMinEncoderCount, | ||
double | elMaxEncoderCount | ||
) |
Set SZA encoder limits.
void carma::control::DriveHandle::setSzaEncoderZeros | ( | double | azEncoderZeroDegrees, |
double | elEncoderZeroDegrees | ||
) |
Set SZA encoder zeros.
void carma::control::DriveHandle::setSzaMountPointingConstants | ( | double | azEncoderCountsPerTurn, |
double | elEncoderCountsPerTurn, | ||
double | azMinEncoderCount, | ||
double | azMaxEncoderCount, | ||
double | elMinEncoderCount, | ||
double | elMaxEncoderCount, | ||
double | azEncoderZeroDegrees, | ||
double | elEncoderZeroDegrees, | ||
double | haTiltDegrees, | ||
double | latTiltDegrees, | ||
double | elTiltDegrees, | ||
double | opticalXCollimationDegrees, | ||
double | opticalYCollimationDegrees, | ||
double | opticalFlexureSinDegrees, | ||
double | opticalFlexureCosDegrees, | ||
double | radioXCollimationDegrees, | ||
double | radioYCollimationDegrees, | ||
double | radioFlexureSinDegrees, | ||
double | radioFlexureCosDegrees | ||
) |
Set SZA mount pointing constants.
void carma::control::DriveHandle::setSzaTilts | ( | double | haTiltDegrees, |
double | latTiltDegrees, | ||
double | elTiltDegrees | ||
) |
Set SZA tilts.
void carma::control::DriveHandle::startTrack | ( | const ::std::string | source, |
const carma::control::MjdTriplet | mjdTriplet, | ||
const ::std::string | userCatalog, | ||
const carma::control::AzWrapMode | azWrapMode, | ||
double | time, | ||
int | preferredSequenceNo | ||
) |
For use the first time this drive tracks a given object.
This method calls track() three times to send a full triplet to the drives. All tracking offsets are set to zero.
source | The source name |
Triplet | of MJDs aligned to the antenna update cycle. |
userCatalog | - The fully qualified name of the user source catalog to search for the source, before looking in the system catalog. |
azWrapMode | - The azimuth wrap mode, one of ZERO, ADD, SUB, TIME |
time | when azWrapMode==TIME, an az wrap will be requested that allows the source to be tracked for 'time' minutes. Ignored if azWrapMode != TIME. |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::startTrackX | ( | const carma::services::Source | source, |
const carma::control::MjdTriplet | mjdTriplet, | ||
const carma::control::AzWrapMode | azWrapMode, | ||
double | time, | ||
int | preferredSequenceNo | ||
) |
Version of startTrack that takes a Source object instead of a source name and catalog.
This avoids multiple file system reads, which can cause command timeouts if the filesystem is under stress. See bug 906
void carma::control::DriveHandle::stop | ( | ) |
Stop the antenna at its current azimuth and elevation.
void carma::control::DriveHandle::stow | ( | antenna::common::DriveControl::Position | position, |
int | preferredSequenceNo | ||
) |
Move the antenna one of the stow positions (zenith, service, safe).
position | Stow position to move to. |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::trackCurrentSourceWithOffsets | ( | const carma::control::MjdTriplet | mjdTriplet, |
const ::std::string | userCatalog, | ||
carma::control::AzWrapMode | azWrapMode, | ||
int | preferredSequenceNo | ||
) |
Continue tracking the current source with new equatorial offsets.
This method will send a new triplet to the drive DO.
Triplet | of MJDs aligned to the antenna update cycle. |
userCatalog | - The fully qualified name of the user source catalog to search for the source, before looking in the system catalog. |
azWrapMode | - The azimuth wrap mode, one of ZERO, ADD, SUB, TIME |
preferredSequenceNo | will be used unless it is already the one returned by the monitor system, in which case one that is ten greater will be used. |
void carma::control::DriveHandle::trackingThreshold | ( | float | hpbw | ) |
Set the tracking threshold.
threshold | tracking threshold in HPBW (halfpower beam widths) |
void carma::control::DriveHandle::updateTracking | ( | double | mjd | ) |
Updates tracking information to antenna,.
mjdAnt | Timestamp for antenna tracking |
void carma::control::DriveHandle::updateTrackTolerance | ( | const float | tolerance, |
const double | freq | ||
) |
Set the tracking threshold to the antennas.
tolerance | The tracking threshold in HPBW. |
freq | The current LO freq in GHz (used in conversion to arcsec). |
void carma::control::DriveHandle::updateWeather | ( | double | mjd, |
const services::Temperature & | airTemp, | ||
const services::Pressure & | atmPressure, | ||
double | relhumid, | ||
const services::Temperature & | dewpointTemp, | ||
const services::Velocity & | windSpeed, | ||
const services::Angle & | windDirection, | ||
bool | logGoodSend | ||
) |
Updates weather information to drive.
mjd,double,time | instant for which tracking info is to be updated |
airTemp | Ambient temperature |
atmPressure | Atmospheric pressure |
relHumid | Relative humidity, percent (a number between 0 and 100) |
dewPointTemp | Dew point temperature |
windspeed | Wind speed |
windDirection | Wind direction, 0 degrees = north, 90 = east |