CARMA C++
|
10-m Antenna Optics CAN device class. More...
#include <carma/antenna/ovro/canbus/Optics.h>
Public Types | |
enum | CAL_POS { SKY = 0x00, AMBIENT = 0x01, PARTIAL = 0x02, HOT = 0x03 } |
Calibrator wheel position enumeration. More... | |
enum | MM_RX_SELECTION { MIRROR = 0x00, THROUGH = 0x01, GRID = 0x02 } |
Mm Rx selection enumerator. More... | |
enum | POLARIZATION_STATE { LINEAR_VERTICAL = 0x00, LINEAR_HORIZONTAL = 0x01, LEFT_CIRCULAR = 0x02, RIGHT_CIRCULAR = 0x03 } |
Polarization State enumeration. More... | |
enum | RECEIVER { RX_CM = 0x00, RX_3MM = 0x01, RX_1MM = 0x02, RX_GRID = 0x03 } |
Receiver enumeration. More... | |
Public Member Functions | |
std::map < carma::canbus::msgType, std::string > | getHalfSecMonitors () const |
Retrieve a map of this devices half second monitor points. More... | |
std::map < carma::canbus::msgType, std::string > | getSlowMonitors () const |
Return a map of this devices slow monitor points. More... | |
void | moveMmRxSelect (enum MM_RX_SELECTION mmRx) |
Rotate the receiver select mechanism in the sidecab. More... | |
void | moveTertiary (bool in) |
Move the tertiary mirror to a selected position. More... | |
Optics (carma::canbus::nodeType node, carma::canbus::CanOutput &io, carma::monitor::OvroSubsystem &ovroSubsys) | |
Constructor. More... | |
void | processMsg (carma::canbus::msgType mid, std::vector< carma::canbus::byteType > &data, bool sim) |
Process a CAN message addressed to the SecondaryMirror module. More... | |
void | selectReceiver (enum RECEIVER rx) |
Select receiver. More... | |
void | setCalPosition (enum CAL_POS pos) |
Set Calibrator Position. More... | |
void | setCalPosition (enum CAL_POS pos, unsigned long sequenceNo, bool sequenceNoFromRx) |
Set calibrator position with a sequence number. More... | |
void | setCmCalPosition (enum CAL_POS pos) |
Set centimeter calibrator position. More... | |
void | setMmCalPosition (enum CAL_POS pos) |
Set millimeter calibrator position. More... | |
void | setMmRxSelectorAngle (float angleInDegrees) |
Set mm rx selector position. More... | |
carma::canbus::Message | simulateMsg (carma::canbus::msgType mid) |
Produce a simulated CAN message for a given msgType. More... | |
void | updateFrameData () |
Update Frame Data. More... | |
~Optics () | |
Destructor. More... | |
![]() | |
bool | isOnline () |
Is Device ONLINE? More... | |
void | reset () |
Reset the can module via CORBA using Device::softReset() method. More... | |
virtual void | setState (deviceStateType state) |
Set the state of the device. More... | |
void | startChannelOneFastSampling (unsigned short fastItem) |
Start fast sampling on channel one with the requested data item. More... | |
void | startChannelTwoFastSampling (unsigned short fastItem) |
Start fast sampling on channel two with the requested data item. More... | |
void | stopChannelOneFastSampling () |
Stop fast sampling on channel one. More... | |
void | stopChannelTwoFastSampling () |
Stop fast sampling on channel two. More... | |
XacDevice (carma::canbus::apiType api, carma::canbus::nodeType node, carma::canbus::CanOutput &canOutput) | |
Constructor. More... | |
virtual | ~XacDevice () |
Destructor. More... | |
![]() | |
carma::canbus::Message | createDummyMsg () const |
Create a dummy CAN message. More... | |
carma::canbus::Message | createMsgToAllNodes (msgType messageId) const |
Create a CAN message addressed to all nodes of this type. More... | |
carma::canbus::Message | createMsgToHost (msgType messageId) const |
Create a CAN message addressed from this Device to the host. More... | |
carma::canbus::Message | createMsgToNode (msgType messageId) const |
Create a CAN message addressed to this device from the host. More... | |
Device (apiType api, nodeType node, CanOutput &io) | |
Device constructor. More... | |
apiType | getApi () const |
Return api code of device. More... | |
char | getApiVersion () const |
Get API Version of this Device. More... | |
boardType | getBoardType () const |
Return board type id of device. More... | |
busIdType | getBusId () const |
Return bus Id that node resides on. More... | |
virtual MsgIdInfoMap | getControls () const |
Return a map of devices controls. More... | |
keyType | getKey () const |
Create a key unique to this api and node. More... | |
double | getLastRxTime () const |
Get Last RX Time for device. More... | |
unsigned int | getNlatePackets () const |
Get number of late packets. More... | |
nodeType | getNode () const |
Return node location code of device. More... | |
serialNumberType | getSerialNumber () const |
Return serial number of device. More... | |
deviceStateType | getState () const |
Status access routine. More... | |
void | reset () |
Perform a software reset of module. More... | |
void | setBoardType (boardType bt) |
Set board type of device. More... | |
void | setBusId (busIdType busId) |
Set busId of device. More... | |
virtual void | setLastRxTime (double rxMjd) |
Set latest rx time. More... | |
void | setSerialNumber (serialNumberType sn) |
Set serial number of device. More... | |
void | startChannelOneFastSampling (unsigned short fastItem) |
Start fast sampling the specified data item on channel 1. More... | |
void | startChannelTwoFastSampling (unsigned short fastItem) |
Start fast sampling the specified data item on channel 2. More... | |
void | stopChannelOneFastSampling () |
Stop fast sampling on channel 1 This routine will stop fast sampling on channel 1 regardless of whether this node is fast sampling the channel or not! In other words the request goes out globally. More... | |
void | stopChannelTwoFastSampling () |
Stop fast sampling on channel 2 This routine will stop fast sampling on channel 2 regardless of whether this node is fast sampling the channel or not! In other words the request goes out globally. More... | |
virtual | ~Device () |
Device destructor. More... | |
Additional Inherited Members | |
![]() | |
static keyType | createKey (apiType api, nodeType node) |
![]() | |
static const carma::canbus::msgType | SYSTEM_MONITOR_PACKET_1 = 0x120 |
static const carma::canbus::msgType | SYSTEM_MONITOR_PACKET_2 = 0x121 |
static const carma::canbus::msgType | SYSTEM_MONITOR_PACKET_3 = 0x122 |
static const carma::canbus::msgType | SYSTEM_MONITOR_PACKET_4 = 0x123 |
static const carma::canbus::msgType | SYSTEM_MONITOR_PACKET_5 = 0x124 |
![]() | |
virtual void | initialize () |
Initialization hook. More... | |
void | processSystemMonitorPacket (carma::canbus::msgType mid, carma::canbus::DataVector &data, carma::monitor::Xac &xac) |
Process a system monitor packet. More... | |
void | processSystemMonitorPacket1 (carma::canbus::DataVector &data, carma::monitor::Xac &xac) |
Process System Monitor Packet 1 This routine processes standard system monitor packet 1 and places the data into the input Xac reference. More... | |
void | processSystemMonitorPacket2 (carma::canbus::DataVector &data, carma::monitor::Xac &xac) |
Process System Monitor Packet 2. More... | |
void | processSystemMonitorPacket3 (carma::canbus::DataVector &data, carma::monitor::Xac &xac) |
Process System Monitor Packet 3. More... | |
void | processSystemMonitorPacket4 (carma::canbus::DataVector &data, carma::monitor::Xac &xac) |
Process System Monitor Packet 4. More... | |
void | processSystemMonitorPacket5 (carma::canbus::DataVector &data, carma::monitor::Xac &xac) |
Process System Monitor Packet 5. More... | |
carma::canbus::Message | simSystemMonitorPacket (carma::canbus::msgType mid) |
Simulate system monitor packet. More... | |
carma::canbus::Message | simSystemMonitorPacket1 () |
Simulate System Monitor Packet 1. More... | |
carma::canbus::Message | simSystemMonitorPacket2 () |
Simulate System Monitor Packet 2. More... | |
carma::canbus::Message | simSystemMonitorPacket3 () |
Simulate System Monitor Packet 3. More... | |
carma::canbus::Message | simSystemMonitorPacket4 () |
Simulate System Monitor Packet 4. More... | |
carma::canbus::Message | simSystemMonitorPacket5 () |
Simulate System Monitor Packet 5. More... | |
![]() | |
void | incrementLatePacketCount () |
Increment the late packet count by 1. More... | |
bool | isPacketLate (double window=100.0) |
Determine if the last packet sent from this device was late. More... | |
void | resetLatePacketCount () |
Reset the late packet count to 0. More... | |
void | setApiVersion (char api) |
Set API Version. More... | |
![]() | |
static bool | isSystemMonitorPacket (carma::canbus::msgType) |
Check that input message type is a system monitor packet. More... | |
![]() | |
const apiType | api_ |
CanOutput & | io_ |
Reference to CanOutput object. More... | |
const keyType | key_ |
const nodeType | node_ |
![]() | |
static const msgType | RESET = 0x0000 |
Software reset message id. More... | |
static const msgType | START_CHANNEL_1_FAST_SAMPLING = 0x0004 |
Begin channel 1 fast sampling message id. More... | |
static const msgType | START_CHANNEL_2_FAST_SAMPLING = 0x0005 |
Begin channel 2 fast sampling message id. More... | |
static const msgType | STOP_CHANNEL_1_FAST_SAMPLING = 0x0002 |
Stop channel 1 fast sampling message id. More... | |
static const msgType | STOP_CHANNEL_2_FAST_SAMPLING = 0x0003 |
10-m Antenna Optics CAN device class.
This class implements API No. 72 for the OVRO Antenna Optics CAN module. Note that this class doesn't directly subclass IDL generated interfaces. I've decided instead to use delegation which should provide a small level of indirection if we ever decide to switch the underlying high level communication model.
Calibrator wheel position enumeration.
It is quite likely that this is the third or fourth duplication of this enumeration. However, it is necessary to prevent the CORBA or IDL defined enumerations from being included herin. Separation of church and state or something like that. In reality, this is just creating more work for me with the tradeoff being that the class is less coupled.
carma::antenna::ovro::Optics::Optics | ( | carma::canbus::nodeType | node, |
carma::canbus::CanOutput & | io, | ||
carma::monitor::OvroSubsystem & | ovroSubsys | ||
) |
Constructor.
node | Location id of this instance (node location id). |
io | Reference to CanOutput class. |
ovroSubsys | Reference to ovro monitor subsystem. |
carma::antenna::ovro::Optics::~Optics | ( | ) |
Destructor.
|
virtual |
Retrieve a map of this devices half second monitor points.
The monitor points returned from this routine will be simulated if the device is in the OFFLINE state.
Implements carma::canbus::Device.
|
virtual |
Return a map of this devices slow monitor points.
These monitor points will be simulated every 5 seconds if the device is in the OFFLINE state.
Reimplemented from carma::canbus::devices::XacDevice.
void carma::antenna::ovro::Optics::moveMmRxSelect | ( | enum MM_RX_SELECTION | mmRx | ) |
Rotate the receiver select mechanism in the sidecab.
mmRx | Positions specified by RECEIVER enum - RX_CM is not used. |
void carma::antenna::ovro::Optics::moveTertiary | ( | bool | in | ) |
Move the tertiary mirror to a selected position.
in | If true move tertiary in for mm rx, else move it out for cm rx. |
|
virtual |
Process a CAN message addressed to the SecondaryMirror module.
This routine is responsible for processing all CAN messages addressed to this device.
mid | the 10bit message id (carma::canbus::msgType) |
data | reference to the byte vector containing the raw data. |
sim | Indicates if message is real or simulated. |
Implements carma::canbus::Device.
void carma::antenna::ovro::Optics::selectReceiver | ( | enum RECEIVER | rx | ) |
Select receiver.
rx | Specific receiver to place in beam. |
void carma::antenna::ovro::Optics::setCalPosition | ( | enum CAL_POS | pos | ) |
Set Calibrator Position.
pos | Calibrator position. |
void carma::antenna::ovro::Optics::setCalPosition | ( | enum CAL_POS | pos, |
unsigned long | sequenceNo, | ||
bool | sequenceNoFromRx | ||
) |
Set calibrator position with a sequence number.
pos | Calibrator position. |
sequenceNo | Sequence number to return in the monitor stream. |
void carma::antenna::ovro::Optics::setCmCalPosition | ( | enum CAL_POS | pos | ) |
Set centimeter calibrator position.
Set the centimeter receiver calibration wheel to requested position. This will move the cm cal wheel regardless of the current receiver selection. The partial and hot load states are ignored for this command.
pos | Cm calibrator position. |
void carma::antenna::ovro::Optics::setMmCalPosition | ( | enum CAL_POS | pos | ) |
Set millimeter calibrator position.
Set the millimeter receiver calibration wheel to requested position. This will move the mm cal wheel regardless of the current receiver selection.
pos | Calibrator position. |
void carma::antenna::ovro::Optics::setMmRxSelectorAngle | ( | float | angleInDegrees | ) |
Set mm rx selector position.
Set mm receiver select mechanism to an arbitrary specified angle
angleInDegrees | Angle in degrees. |
|
virtual |
Produce a simulated CAN message for a given msgType.
This routine creates a Message with simulated data for an input message id. The returned message is automatically placed in the CAN message queue for retrieval and processing by the Master class. It thus can be used to test the processMsg method above.
mid | the 10bit message id (carma::canbus::msgType) |
Implements carma::canbus::Device.
|
virtual |
Update Frame Data.
Reimplemented from carma::canbus::Device.