CARMA C++
carma::canbus::devices::XacDevice Class Reference

XacDevice canbus::device class implementation. More...

#include <carma/canbus/devices/XacDevice.h>

Inheritance diagram for carma::canbus::devices::XacDevice:
carma::canbus::Device carma::antenna::common::AntennaIF carma::antenna::common::LOReferenceMonitor carma::antenna::common::SisReceiver carma::antenna::common::Varactor carma::antenna::ovro::CryoCompressor carma::antenna::ovro::CryoTemperatures carma::antenna::ovro::Drive carma::antenna::ovro::Encoder carma::antenna::ovro::EnvironmentalMonitor carma::antenna::ovro::GunnPll carma::antenna::ovro::Optics carma::antenna::ovro::SecondaryMirror carma::antenna::ovro::Tiltmeter carma::antenna::ovro::Tiltmeter carma::antenna::ovro::YigPll carma::clock::Clock carma::downconverter::BlockDownconverter carma::downconverter::Downconverter carma::downconverter::LoControl carma::downconverter::LoMonitor carma::downconverter::NoiseSource carma::downconverter::QuadratureModulator carma::downconverter::SpectralDownconverter carma::loberotator::Loberotator

Public Member Functions

virtual std::map< msgType,
std::string > 
getSlowMonitors () const
 Return a map of slow monitor points supported by this class The XacDevice class supports processing of the standard System Monitor Packets defined in CANbus API docs. 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...
 
- Public Member Functions inherited from carma::canbus::Device
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...
 
virtual MsgIdInfoMap getHalfSecMonitors () const =0
 Return a map of devices half second monitor points. 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...
 
virtual void processMsg (msgType messageId, std::vector< byteType > &data, bool sim)=0
 Process a CAN message. 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...
 
virtual carma::canbus::Message simulateMsg (msgType messageId)=0
 Simulate a CAN message. 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 void updateFrameData ()
 Update device or monitor data on frame timescale... More...
 
virtual ~Device ()
 Device destructor. More...
 

Static Public Attributes

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
 

Protected Member Functions

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...
 
- Protected Member Functions inherited from carma::canbus::Device
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 Protected Member Functions

static bool isSystemMonitorPacket (carma::canbus::msgType)
 Check that input message type is a system monitor packet. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from carma::canbus::Device
static keyType createKey (apiType api, nodeType node)
 
- Protected Attributes inherited from carma::canbus::Device
const apiType api_
 
CanOutputio_
 Reference to CanOutput object. More...
 
const keyType key_
 
const nodeType node_
 
- Static Protected Attributes inherited from carma::canbus::Device
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
 

Detailed Description

XacDevice canbus::device class implementation.

This class implements the carma::canbus::Device base class for devices with XAC processors which transmit the standard 'System Monitor Packets' as defined in the Carma CANbus API Template. If your CAN module transmits these System Monitor Packets, you can inherit from this device and you won't need to define how to unpack those messages. The class implements several base control commands as well.

Definition at line 37 of file XacDevice.h.

Constructor & Destructor Documentation

carma::canbus::devices::XacDevice::XacDevice ( carma::canbus::apiType  api,
carma::canbus::nodeType  node,
carma::canbus::CanOutput canOutput 
)

Constructor.

Creates an XacDevice

Parameters
apiunique code identifying a specific set of instructions and CAN message formats for a specific device.
nodeNode id of device.
canOutputReference to CanOutput class - should be obtained from downcasting the canbus::Master reference in inherited canbus::Master class.
virtual carma::canbus::devices::XacDevice::~XacDevice ( )
virtual

Destructor.

Member Function Documentation

virtual void carma::canbus::devices::XacDevice::initialize ( )
protectedvirtual

Initialization hook.

This get's called when the xac slow monitor packet 1 'initialization request' flag is set.

bool carma::canbus::devices::XacDevice::isOnline ( )

Is Device ONLINE?

static bool carma::canbus::devices::XacDevice::isSystemMonitorPacket ( carma::canbus::msgType  )
staticprotected

Check that input message type is a system monitor packet.

void carma::canbus::devices::XacDevice::processSystemMonitorPacket ( carma::canbus::msgType  mid,
carma::canbus::DataVector data,
carma::monitor::Xac &  xac 
)
protected

Process a system monitor packet.

void carma::canbus::devices::XacDevice::processSystemMonitorPacket1 ( carma::canbus::DataVector data,
carma::monitor::Xac &  xac 
)
protected

Process System Monitor Packet 1 This routine processes standard system monitor packet 1 and places the data into the input Xac reference.

Note that this routine will set the device state to carma::canbus::STARTING if the INITREQ flag is set in the input packet.

Parameters
datavector containing bytes of raw data.
xacmonitor system reference
void carma::canbus::devices::XacDevice::processSystemMonitorPacket2 ( carma::canbus::DataVector data,
carma::monitor::Xac &  xac 
)
protected

Process System Monitor Packet 2.

Parameters
datavector containing bytes of raw data.
xacmonitor system reference
void carma::canbus::devices::XacDevice::processSystemMonitorPacket3 ( carma::canbus::DataVector data,
carma::monitor::Xac &  xac 
)
protected

Process System Monitor Packet 3.

Parameters
datavector containing bytes of raw data.
xacmonitor system reference
void carma::canbus::devices::XacDevice::processSystemMonitorPacket4 ( carma::canbus::DataVector data,
carma::monitor::Xac &  xac 
)
protected

Process System Monitor Packet 4.

Parameters
datavector containing bytes of raw data.
xacmonitor system reference
void carma::canbus::devices::XacDevice::processSystemMonitorPacket5 ( carma::canbus::DataVector data,
carma::monitor::Xac &  xac 
)
protected

Process System Monitor Packet 5.

Parameters
datavector containing bytes of raw data.
xacmonitor system reference
void carma::canbus::devices::XacDevice::reset ( )

Reset the can module via CORBA using Device::softReset() method.

virtual void carma::canbus::devices::XacDevice::setState ( deviceStateType  state)
virtual

Set the state of the device.

This function overrides the Device::setState version and simply calls the base version while adding logging functionality.

Reimplemented from carma::canbus::Device.

carma::canbus::Message carma::canbus::devices::XacDevice::simSystemMonitorPacket ( carma::canbus::msgType  mid)
protected

Simulate system monitor packet.

Exceptions
IllegalArgumentExceptionif mid is not a system monitor msg.
carma::canbus::Message carma::canbus::devices::XacDevice::simSystemMonitorPacket1 ( )
protected

Simulate System Monitor Packet 1.

carma::canbus::Message carma::canbus::devices::XacDevice::simSystemMonitorPacket2 ( )
protected

Simulate System Monitor Packet 2.

carma::canbus::Message carma::canbus::devices::XacDevice::simSystemMonitorPacket3 ( )
protected

Simulate System Monitor Packet 3.

carma::canbus::Message carma::canbus::devices::XacDevice::simSystemMonitorPacket4 ( )
protected

Simulate System Monitor Packet 4.

carma::canbus::Message carma::canbus::devices::XacDevice::simSystemMonitorPacket5 ( )
protected

Simulate System Monitor Packet 5.

void carma::canbus::devices::XacDevice::startChannelOneFastSampling ( unsigned short  fastItem)

Start fast sampling on channel one with the requested data item.

void carma::canbus::devices::XacDevice::startChannelTwoFastSampling ( unsigned short  fastItem)

Start fast sampling on channel two with the requested data item.

void carma::canbus::devices::XacDevice::stopChannelOneFastSampling ( )

Stop fast sampling on channel one.

void carma::canbus::devices::XacDevice::stopChannelTwoFastSampling ( )

Stop fast sampling on channel two.


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