CARMA C++
carma::clock::Clock Class Reference

The Clock class is an instantiation of the carma::canbus::Device class for the Master Clock. More...

#include <carma/clock/Clock.h>

Inheritance diagram for carma::clock::Clock:
carma::canbus::devices::XacDevice carma::canbus::Device

Public Member Functions

 Clock (carma::canbus::nodeType node, carma::canbus::CanOutput &io, carma::monitor::MasterClockSubsystem *masterClockSubsystem)
 Clock constructor. More...
 
void initialize (carma::clock::ppsModeType ppsMode, carma::clock::rbModeType rbMode, carma::clock::gpsSourceType gpsSource, carma::clock::tenMHzSourceType tenMHzSource, carma::clock::walshSyncType walshSync)
 Initialize master clock. More...
 
void resetRb ()
 reset PRS10 Rb Time Standard and resync to primary GPS More...
 
void resync10MHzGps (carma::clock::walshSyncType walshSync)
 synchronize 1pps from Rubidium oscillator with GPS-derived 1 pps signal More...
 
void set10MHzSource (carma::clock::tenMHzSourceType tenMHzSource)
 set 10MHz source to be from the internal Rb oscillator or some external source More...
 
void setGpsSource (carma::clock::gpsSourceType gpsSource)
 set primary GPS source More...
 
void setHbDelay (CORBA::UShort delay, carma::clock::delayRegister reg)
 set heartbeat delay More...
 
void setPpsMode (carma::clock::ppsModeType ppsMode)
 set 1pps to come from GPS or Rb oscillator counter More...
 
void setRbMode (carma::clock::rbModeType rbMode)
 set Rb oscillation mode to be free-running or to phase lock to GPS More...
 
- Public Member Functions inherited from carma::canbus::devices::XacDevice
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...
 
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...
 

Static Public Member Functions

static carma::canbus::apiType getApiId ()
 return CANbus API More...
 
- Static Public Member Functions inherited from carma::canbus::Device
static keyType createKey (apiType api, nodeType node)
 

Additional Inherited Members

- Static Public Attributes inherited from carma::canbus::devices::XacDevice
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 inherited from carma::canbus::devices::XacDevice
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 inherited from carma::canbus::devices::XacDevice
static bool isSystemMonitorPacket (carma::canbus::msgType)
 Check that input message type is a system monitor packet. More...
 
- 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

The Clock class is an instantiation of the carma::canbus::Device class for the Master Clock.

This device has sends monitor packets on a 1/2 second time scale as well as allowing control functions for initialization and aligning the offset between the hardware output and gps signal.

See Also
carma::canbus::Device
POA_carma::clock::ClockControl

Definition at line 41 of file Clock.h.

Constructor & Destructor Documentation

carma::clock::Clock::Clock ( carma::canbus::nodeType  node,
carma::canbus::CanOutput io,
carma::monitor::MasterClockSubsystem *  masterClockSubsystem 
)

Clock constructor.

Parameters
node,:unique location id on CAN bus
io,:reference to CanOutput class from Master

Member Function Documentation

static carma::canbus::apiType carma::clock::Clock::getApiId ( )
static

return CANbus API

void carma::clock::Clock::initialize ( carma::clock::ppsModeType  ppsMode,
carma::clock::rbModeType  rbMode,
carma::clock::gpsSourceType  gpsSource,
carma::clock::tenMHzSourceType  tenMHzSource,
carma::clock::walshSyncType  walshSync 
)

Initialize master clock.

Parameters
ppsMode- {GPSPPS or TENMHZPPS}
rbMode- {FREE or GPSLOCKED}
walshPeriod- desired Walsh period of master clock
gpsSource- {GPSA or GPSB}
tenMHzSource{INTERNAL or EXTERNAL}
void carma::clock::Clock::resetRb ( )

reset PRS10 Rb Time Standard and resync to primary GPS

void carma::clock::Clock::resync10MHzGps ( carma::clock::walshSyncType  walshSync)

synchronize 1pps from Rubidium oscillator with GPS-derived 1 pps signal

Parameters
walshSyncsync state of oscillator {ENABLE, DISABLE}
void carma::clock::Clock::set10MHzSource ( carma::clock::tenMHzSourceType  tenMHzSource)

set 10MHz source to be from the internal Rb oscillator or some external source

Parameters
tenMHzSource{INTERNAL or EXTERNAL}
void carma::clock::Clock::setGpsSource ( carma::clock::gpsSourceType  gpsSource)

set primary GPS source

Parameters
gpsSource- {GPSA or GPSB}
void carma::clock::Clock::setHbDelay ( CORBA::UShort  delay,
carma::clock::delayRegister  reg 
)

set heartbeat delay

Parameters
delayhearbeat delay
registerdelay register {REGISTER1, REGISTER2}
void carma::clock::Clock::setPpsMode ( carma::clock::ppsModeType  ppsMode)

set 1pps to come from GPS or Rb oscillator counter

Parameters
ppsMode- {RBPRS10, GPSPPS, TENMHZPPS}
void carma::clock::Clock::setRbMode ( carma::clock::rbModeType  rbMode)

set Rb oscillation mode to be free-running or to phase lock to GPS

Parameters
rbMode- {FREE, GPS000424, GPS001648, GPS003336, GPS010712, GPS021424, GPS042848, GPS085736, GPS175502}

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