CARMA C++
carma::antenna::ovro::OvroMaster Class Reference

Ovro Antenna canbus Master class. More...

#include <carma/antenna/ovro/canbus/OvroMaster.h>

Inheritance diagram for carma::antenna::ovro::OvroMaster:
carma::canbus::Master carma::canbus::CanDio carma::canbus::CanIo carma::canbus::CanOutput

Public Types

enum  AntennaIFType { IF1, IF2 }
 
enum  GunnType { LO1CM, LO1MM, LO3MM, LOANY }
 Gunn types. More...
 
enum  SisRxPolType { SINGLE, LEFT_CIRCULAR, RIGHT_CIRCULAR }
 
enum  SisRxType { SIS_RX1MM, SIS_RX3MM }
 Sis Receiver types. More...
 
- Public Types inherited from carma::canbus::CanDio
typedef ::std::pair< int, int > BoardSlotPair
 Pair containing boardId (first) and slotId (second). More...
 
typedef ::std::pair
< BoardSlotPair, bool > 
DevTermPair
 Pair for board & slot (first) and termination setting (second). More...
 

Public Member Functions

AntennaIFgetAntennaIF (enum AntennaIFType ifType)
 Retrieve a reference to underlying AntennaIF CAN device. More...
 
carma::antenna::common::CMReceiver & getCMReceiver ()
 Retrieve a reference to underlying CM Receiver module. More...
 
CryoCompressorgetCryoCompressor ()
 Retrieve pointer to underlying CryoCompressor CAN device. More...
 
CryoTemperaturesgetCryoTemperatures ()
 Retrieve pointer to underlying CryoTemperatures CAN device (dewar). More...
 
DriveEnginegetDriveEngine ()
 Get a reference to the drive engine. More...
 
EnvironmentalMonitorgetEnvironmentalMonitor ()
 Retrieve a pointer to the underlying EnvironmentalMonitor CAN device. More...
 
GunnPllgetGunn (enum GunnType gunn)
 Retrieve a reference to the specified Bias Tuned Gunn CAN device. More...
 
carma::antenna::common::LOReferenceMonitorgetLOReferenceMonitor ()
 Retrieve a reference to the underlying LO Reference CAN device. More...
 
OpticsgetOptics ()
 Retrieve a pointer to the underlying Optics CAN device. More...
 
RxTemperatures & getRxTemperatureController ()
 Retrieve a reference to the underlying Rx Electronics Temperature Controller device. More...
 
SecondaryMirrorgetSecondary ()
 Retrieve a pointer to the underlying SecondaryMirror CAN device. More...
 
carma::antenna::common::SisReceivergetSisReceiver (enum SisRxType rx, enum SisRxPolType pol)
 Retrieve a reference to underlying Sis Receiver module. More...
 
TiltmetergetTiltmeter ()
 Retrieve pointer to underlying Tiltmeter CAN device. More...
 
carma::antenna::common::VaractorgetVaractor ()
 Retrieve a reference to the varactor module. More...
 
YigPllgetYigPll ()
 Retrieve reference to the underlying YigPll CAN device. More...
 
 OvroMaster (unsigned short antNo, bool simOfflineNodes, carma::monitor::OvroSubsystem &ovroSubsystem)
 Constructor for emulation only. More...
 
 OvroMaster (int board, unsigned short antNo, bool simOfflineNodes, bool reset, bool terminate, carma::monitor::OvroSubsystem &ovroSubsystem)
 OvroMaster constructor. More...
 
 OvroMaster (int board, int bus, unsigned short antNo, bool simOfflineNodes, bool reset, bool terminate, carma::monitor::OvroSubsystem &ovroSubsystem)
 OvroMaster single bus constructor. More...
 
void reset ()
 Reset ALL modules on CAN via DIO. More...
 
void setInitialization (bool state)
 Set state of antenna initialization. More...
 
void start ()
 Start the CAN Master This routine does not block! It is responsible for kicking off a new thread which in turn runs the main Master::run() routine. More...
 
void stop ()
 Stop the CAN Master This routine terminates the main run thread in the CAN Master. More...
 
virtual ~OvroMaster ()
 Destructor. More...
 
- Public Member Functions inherited from carma::canbus::Master
 Master (bool simOfflineNodes=true)
 Default constructor for emulation. More...
 
 Master (int boardId, bool simOfflineNodes=false, bool reset=false, bool terminate=true)
 Master constructor. More...
 
 Master (int boardId, int modulbusId, bool simOfflineNodes=false, bool reset=false, bool terminate=true)
 Master constructor. More...
 
 Master (const ::std::vector< DevTermPair > &devTermPairs, bool simOfflineNodes=false, bool reset=false)
 Constructor for arbitrary number of CanDio ports. More...
 
void run ()
 Run the Master. More...
 
void stop ()
 Stop running internal Master threads. More...
 
virtual ~Master ()
 Master destructor. More...
 
- Public Member Functions inherited from carma::canbus::CanDio
 CanDio ()
 Default constructor. More...
 
 CanDio (int boardId, bool reset=true, bool terminate=true)
 Constructor to control both CAN busses on a single board. More...
 
 CanDio (int boardId, int slotId, bool reset=true, bool terminate=true)
 Constructor to control a single CAN bus. More...
 
 CanDio (const std::vector< DevTermPair > &devTermPairs, bool reset=true)
 Constructor to control arbitrary number of CAN busses. More...
 
void echoAll (bool enable)
 Enable or disable echoing sent messages back through the read interface. More...
 
std::map< busIdType,
carma::canbus::busStatusType
getBusStatus ()
 
carma::canbus::Message getMessage ()
 Retrieve a CAN message. More...
 
bool isTerminated ()
 Return termination state. More...
 
void postMessage (const carma::canbus::Message &msg, carma::canbus::txPriorityType prio=carma::canbus::NORMAL)
 Post a CAN message. More...
 
void reset ()
 Reset. More...
 
- Public Member Functions inherited from carma::canbus::CanIo
virtual BusStatusMap getBusStatus () const
 Retrieve bus statistics. More...
 
virtual ~CanIo ()
 Virtual destructor. More...
 

Protected Member Functions

carma::canbus::MsgBriefMap getControls () const
 Get a map of controls provided by the OvroMaster Master controls correspond to global CAN Message Ids. More...
 
void softReset ()
 Reset ALL modules on CAN via RESET CAN msg. More...
 
void updateStatus ()
 Update the status of the Antenna CAN Master. More...
 
- Protected Member Functions inherited from carma::canbus::Master
void addDevice (Device *device)
 Add a device to the master. More...
 
DevicegetDevice (apiType api, nodeType node)
 Get pointer to a device. More...
 
int getDonglelessPacketCount () const
 Get 'Dongleless node' packet count This routine returns the number of Dongleless node packets detected by Master. More...
 
unsigned int getLatePacketCount ()
 Get combined late packet count from all devices. More...
 
int getOfflineNodeCount () const
 Get number of offline nodes. More...
 
int getOnlineNodeCount () const
 Get number of online nodes. More...
 
int getUnknownPacketCount () const
 Get number of unknown packets This method returns the number of CAN packets that canbus::Master does not recognize. More...
 
 Master (const Master &)
 
Masteroperator= (const Master &)
 
void removeDevice (apiType api, nodeType node)
 Remove a device. More...
 
virtual void runReadThread ()
 Thread to read and process incoming CAN messages. More...
 
void runTimerThread ()
 Timer thread. More...
 
virtual void setTime ()
 Send a time sync message. More...
 
void softwareReset ()
 Send a software reset command to all modules. More...
 
void updateDevicesStates ()
 Update the devices states. More...
 
- Protected Member Functions inherited from carma::canbus::CanDio
void clearReadQueue ()
 Clear any underlying read buffers. More...
 
void queueMessage (const Message &msg)
 Queue CAN message to be read for simulation purposes. More...
 
void setTimestampEchoLatency (int tsLatency, busIdType busId)
 Set timestamp echo latency. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from carma::canbus::Master
static void * readThreadEntry (void *arg)
 Entry point for main thread. More...
 
static void * timerThreadEntry (void *arg)
 Entry point for timer thread. More...
 
- Protected Attributes inherited from carma::canbus::Master
pthread_mutex_t deviceMutex_
 
std::map< keyType, Device * > devices_
 
int nDonglelessPackets_
 
int nOfflineNodes_
 
int nOnlineNodes_
 
int nUnknownPackets_
 
pthread_t readThreadId_
 
bool running_
 
carma::util::PthreadMutex runningMutex_
 
const int simOfflineNodes_
 
pthread_t timerThreadId_
 
- Protected Attributes inherited from carma::canbus::CanDio
std::auto_ptr
< carma::canbus::CanIo
cio_
 
std::auto_ptr< carma::canbus::Diodio_
 
const long pulseWidth_
 Reset pulsewidth. More...
 
const bool terminate_
 

Detailed Description

Ovro Antenna canbus Master class.

This class is responsible for declaring and maintaining all ovro antenna CAN devices.

Definition at line 59 of file OvroMaster.h.

Member Enumeration Documentation

Gunn types.

Definition at line 250 of file OvroMaster.h.

Sis Receiver types.

Definition at line 223 of file OvroMaster.h.

Constructor & Destructor Documentation

carma::antenna::ovro::OvroMaster::OvroMaster ( unsigned short  antNo,
bool  simOfflineNodes,
carma::monitor::OvroSubsystem &  ovroSubsystem 
)
explicit

Constructor for emulation only.

Parameters
antNoAntenna number this process is running on.
simOfflineNodesSimulate offline nodes if set true.
ovroSubsystemReference to instance of Ovro Monitor Subsystem.
carma::antenna::ovro::OvroMaster::OvroMaster ( int  board,
unsigned short  antNo,
bool  simOfflineNodes,
bool  reset,
bool  terminate,
carma::monitor::OvroSubsystem &  ovroSubsystem 
)
explicit

OvroMaster constructor.

This constructor is for use when controlling both CANbusses on the Janz cPCI carrier board.

Parameters
boardBoard number of Janz cPCI carrier board (0-15). The carrier board is the cPCI board which contains four separate mezzanine modules (2 - CAN, 1 - DIO and 1 - RJ45 Breakout Board), each on a separate 'modulbus'. The boardId is set via a hex switch near the back of the cPCI board. On older models, it is determined via a clearly labeled PLD chip near the back of the board. The chip will be labeled "mbus X" - do not confuse this with the mobulbus numbers on the front panel.
antNoAntenna number this process is running on.
simOfflineNodesSimulate offline nodes if set true.
resetIf true, perform a hard reset upon construction.
terminateTerminate both CAN busses if true.
Exceptions
carma::util::ErrorExceptionderivatives on a variety of failures.
See Also
carma::canbus::CanDio::reset
carma::canbus::CanDio::isTerminated
Parameters
ovroSubsystemReference to instance of Ovro Monitor Subsystem.
carma::antenna::ovro::OvroMaster::OvroMaster ( int  board,
int  bus,
unsigned short  antNo,
bool  simOfflineNodes,
bool  reset,
bool  terminate,
carma::monitor::OvroSubsystem &  ovroSubsystem 
)
explicit

OvroMaster single bus constructor.

This constructor should be used when it is desireable to control only a single CANbus on the Janz cPCI carrier board.

Parameters
boardBoard number of Janz cPCI carrier board (0-15). The carrier board is the cPCI board which contains four separate mezzanine modules (2 - CAN, 1 - DIO and 1 - RJ45 Breakout Board), each on a separate 'modulbus'. The boardId is set via a hex switch near the back of the cPCI board. On older models, it is determined via a clearly labeled PLD chip near the back of the board. The chip will be labeled "mbus X" - do not confuse this with the mobulbus numbers on the front panel.
busCanbus to use [0..1].
antNoAntenna number this process is running on.
simOfflineNodesSimulate offline nodes if set true.
resetIf true, perform a hard reset upon construction.
terminateTerminate both CAN busses if true.
ovroSubsystemReference to instance of Ovro Monitor Subsystem.
Exceptions
carma::util::ErrorExceptionderivatives on a variety of failures.
See Also
carma::canbus::CanDio::reset
carma::canbus::CanDio::isTerminated
virtual carma::antenna::ovro::OvroMaster::~OvroMaster ( )
virtual

Destructor.

Member Function Documentation

AntennaIF& carma::antenna::ovro::OvroMaster::getAntennaIF ( enum AntennaIFType  ifType)

Retrieve a reference to underlying AntennaIF CAN device.

Returns
AntennaIF reference.
carma::antenna::common::CMReceiver& carma::antenna::ovro::OvroMaster::getCMReceiver ( )

Retrieve a reference to underlying CM Receiver module.

carma::canbus::MsgBriefMap carma::antenna::ovro::OvroMaster::getControls ( ) const
protectedvirtual

Get a map of controls provided by the OvroMaster Master controls correspond to global CAN Message Ids.

For the most part this routine won't be used since control commands are hard coded into the below routines and our Antenna API has no mechanism to return values via corba.

Reimplemented from carma::canbus::Master.

CryoCompressor& carma::antenna::ovro::OvroMaster::getCryoCompressor ( )

Retrieve pointer to underlying CryoCompressor CAN device.

Returns
CryoCompressor pointer.
CryoTemperatures& carma::antenna::ovro::OvroMaster::getCryoTemperatures ( )

Retrieve pointer to underlying CryoTemperatures CAN device (dewar).

Returns
CryoTemperatures pointer.
DriveEngine& carma::antenna::ovro::OvroMaster::getDriveEngine ( )

Get a reference to the drive engine.

EnvironmentalMonitor& carma::antenna::ovro::OvroMaster::getEnvironmentalMonitor ( )

Retrieve a pointer to the underlying EnvironmentalMonitor CAN device.

Returns
EnvironmentalMonitor pointer.
GunnPll& carma::antenna::ovro::OvroMaster::getGunn ( enum GunnType  gunn)

Retrieve a reference to the specified Bias Tuned Gunn CAN device.

Returns
GunnPll reference.
carma::antenna::common::LOReferenceMonitor& carma::antenna::ovro::OvroMaster::getLOReferenceMonitor ( )

Retrieve a reference to the underlying LO Reference CAN device.

Returns
carma::antenna::common::LOReferenceMonitor reference.
Optics& carma::antenna::ovro::OvroMaster::getOptics ( )

Retrieve a pointer to the underlying Optics CAN device.

Returns
Optics pointer.
RxTemperatures& carma::antenna::ovro::OvroMaster::getRxTemperatureController ( )

Retrieve a reference to the underlying Rx Electronics Temperature Controller device.

Returns
RxTemperatures reference.
SecondaryMirror& carma::antenna::ovro::OvroMaster::getSecondary ( )

Retrieve a pointer to the underlying SecondaryMirror CAN device.

Returns
SecondaryMirror pointer.
carma::antenna::common::SisReceiver& carma::antenna::ovro::OvroMaster::getSisReceiver ( enum SisRxType  rx,
enum SisRxPolType  pol 
)

Retrieve a reference to underlying Sis Receiver module.

Tiltmeter& carma::antenna::ovro::OvroMaster::getTiltmeter ( )

Retrieve pointer to underlying Tiltmeter CAN device.

Returns
Tiltmeter pointer.
carma::antenna::common::Varactor& carma::antenna::ovro::OvroMaster::getVaractor ( )

Retrieve a reference to the varactor module.

Returns
Varactor reference.
YigPll& carma::antenna::ovro::OvroMaster::getYigPll ( )

Retrieve reference to the underlying YigPll CAN device.

Returns
YigPll reference.
void carma::antenna::ovro::OvroMaster::reset ( )

Reset ALL modules on CAN via DIO.

This routine performs what is commonly known as a hard reset.

void carma::antenna::ovro::OvroMaster::setInitialization ( bool  state)

Set state of antenna initialization.

void carma::antenna::ovro::OvroMaster::softReset ( )
protected

Reset ALL modules on CAN via RESET CAN msg.

This routine triggers a software reset in XAC modules.

void carma::antenna::ovro::OvroMaster::start ( )

Start the CAN Master This routine does not block! It is responsible for kicking off a new thread which in turn runs the main Master::run() routine.

See Also
carma::antenna::ovro::OvroMaster::stop
void carma::antenna::ovro::OvroMaster::stop ( )

Stop the CAN Master This routine terminates the main run thread in the CAN Master.

It is safe to call this routine even if start() has not yet been called (i.e. when handling an exception).

void carma::antenna::ovro::OvroMaster::updateStatus ( )
protectedvirtual

Update the status of the Antenna CAN Master.

This routine retrieves values specific to the CANbus(ses) for the antenna and places them into the monitor stream. It is called automatically by the Master class every frame (1/2 second) as described in carma::canbus::Master.

See Also
carma::canbus::Master::updateStatus

Implements carma::canbus::Master.


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