CARMA C++
carma::downconverter::SldcMaster Class Reference

Spectral Downconverter System CAN Master. More...

#include <carma/downconverter/spectral/SldcMaster.h>

Inheritance diagram for carma::downconverter::SldcMaster:
carma::canbus::Master carma::canbus::CanDio carma::canbus::CanIo carma::canbus::CanOutput

Public Member Functions

void addDevice (carma::canbus::Device *device)
 Add a device to the master. More...
 
BlockDownconvertergetBlockDownconverter (unsigned short inputNo)
 Get a reference to a block downconverter module. More...
 
::carma::switchyard::Switchyard & getDcLoSwitchyard ()
 Retrieve a reference to the downconverter LO switchyard. More...
 
BlockDownconvertergetGlobalBlockDownconverter ()
 Retrieve a reference to the global (node 0) block downconverter. More...
 
QuadratureModulatorgetGlobalQuadMod ()
 Retrieve a reference to the global (node 0) quad mod. More...
 
SpectralDownconvertergetGlobalSldc ()
 Retrieve a reference to the global (node 0) SpectralDownconverter. More...
 
LoControlgetLoControl ()
 Retrieve a reference to the LoControl module. More...
 
LoMonitorgetLoMonitor ()
 Retrieve a reference to the LoMonitor module. More...
 
NoiseSourcegetNoiseSource ()
 Retrieve a reference to the NoiseSource module. More...
 
QuadratureModulatorgetQuadMod (unsigned short inputNo)
 Retrieve a reference to specified QuadMod module. More...
 
SpectralDownconvertergetSldc (unsigned short inputIndex, unsigned short bandIndex)
 Retrieve a reference to a SpectralDownconverter residing on this system. More...
 
::carma::switchyard::Switchyard & getSwitchyard ()
 Retrieve a reference to the switchyard. More...
 
void reset ()
 Reset all modules on all controlled busses via the DIO lines. More...
 
 SldcMaster (::carma::monitor::SldcSubsystem &sldcMon,::carma::monitor::SignalPathSubsystem &signalPathMon)
 Default constructor for emulation. More...
 
 SldcMaster (const ::std::vector< CanDio::DevTermPair > &devTermPairs, bool simOfflineNodes,::carma::monitor::SldcSubsystem &sldcMon,::carma::monitor::SignalPathSubsystem &signalPathMon)
 Constructor for use with an arbitrary number of Carma CAN/DIO cards. More...
 
void softReset ()
 Reset all Xac modules on all controlled busses via the RESET message. More...
 
void start ()
 Start sldc master in a separate thread. More...
 
void stop ()
 Stop the sldc master. More...
 
virtual ~SldcMaster ()
 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

std::map
< carma::canbus::msgType,
std::string > 
getControls () const
 Retrieve a map of CAN controls provided by this class. More...
 
void updateStatus ()
 Update the status of the Sldc 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

- 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...
 
- 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

Spectral Downconverter System CAN Master.

This class is responsible for creating and controlling the Spectral Line Downconverter CAN system.

Definition at line 46 of file SldcMaster.h.

Constructor & Destructor Documentation

carma::downconverter::SldcMaster::SldcMaster ( ::carma::monitor::SldcSubsystem &  sldcMon,
::carma::monitor::SignalPathSubsystem &  signalPathMon 
)

Default constructor for emulation.

This constructor should be used when no Janz hardware is available on the system (during testing for instance). All writes to the CANbus will go to /dev/null instead.

See Also
carma::canbus::Master::Master()
carma::downconverter::SldcMaster::SldcMaster ( const ::std::vector< CanDio::DevTermPair > &  devTermPairs,
bool  simOfflineNodes,
::carma::monitor::SldcSubsystem &  sldcMon,
::carma::monitor::SignalPathSubsystem &  signalPathMon 
)

Constructor for use with an arbitrary number of Carma CAN/DIO cards.

Parameters
devTermPairsVector of pairs of board id, bus id pairs and bus termination state. The carrier board identified by a boardId 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 (labeled 'MODULbus[0..3]). The bus id will be either 0 or 1 corresponding to CAN cards in MODULbus slots 0 and 1.
simOfflineNodesSimulate offline nodes.
Exceptions
carma::util::ErrorExceptionderivatives on a variety of failures.
virtual carma::downconverter::SldcMaster::~SldcMaster ( )
virtual

Destructor.

Member Function Documentation

void carma::downconverter::SldcMaster::addDevice ( carma::canbus::Device device)

Add a device to the master.

This is kind of a hack but this method has been redeclared public to allow SldcControlServer to add Devices after SldcMaster creation.

Parameters
devicepointer to base Device class of a device.
See Also
Device::setState
Exceptions
carma::canbus::BadParameterExceptionif device has already been added.
BlockDownconverter& carma::downconverter::SldcMaster::getBlockDownconverter ( unsigned short  inputNo)

Get a reference to a block downconverter module.

Parameters
inputNoInput number (range 1..15).
Returns
Reference to block downconverter for desired input.
std::map<carma::canbus::msgType, std::string> carma::downconverter::SldcMaster::getControls ( ) const
protectedvirtual

Retrieve a map of CAN controls provided by this class.

Reimplemented from carma::canbus::Master.

::carma::switchyard::Switchyard& carma::downconverter::SldcMaster::getDcLoSwitchyard ( )

Retrieve a reference to the downconverter LO switchyard.

Returns
Reference to the downconverter LO switchyard.
BlockDownconverter& carma::downconverter::SldcMaster::getGlobalBlockDownconverter ( )

Retrieve a reference to the global (node 0) block downconverter.

Returns
Reference to global block downconverter.
QuadratureModulator& carma::downconverter::SldcMaster::getGlobalQuadMod ( )

Retrieve a reference to the global (node 0) quad mod.

SpectralDownconverter& carma::downconverter::SldcMaster::getGlobalSldc ( )

Retrieve a reference to the global (node 0) SpectralDownconverter.

Returns
Reference to node 0 (global control) Downconverter.
LoControl& carma::downconverter::SldcMaster::getLoControl ( )

Retrieve a reference to the LoControl module.

LoMonitor& carma::downconverter::SldcMaster::getLoMonitor ( )

Retrieve a reference to the LoMonitor module.

NoiseSource& carma::downconverter::SldcMaster::getNoiseSource ( )

Retrieve a reference to the NoiseSource module.

QuadratureModulator& carma::downconverter::SldcMaster::getQuadMod ( unsigned short  inputNo)

Retrieve a reference to specified QuadMod module.

Parameters
inputNoInput number (range 1..15).
SpectralDownconverter& carma::downconverter::SldcMaster::getSldc ( unsigned short  inputIndex,
unsigned short  bandIndex 
)

Retrieve a reference to a SpectralDownconverter residing on this system.

Parameters
inputIndexInput index [1..15].
bandIndexBand index [1..8].
Returns
Reference to specified Spectral Line Downconverter object.
::carma::switchyard::Switchyard& carma::downconverter::SldcMaster::getSwitchyard ( )

Retrieve a reference to the switchyard.

Returns
Reference to the switchyard.
void carma::downconverter::SldcMaster::reset ( )

Reset all modules on all controlled busses via the DIO lines.

void carma::downconverter::SldcMaster::softReset ( )

Reset all Xac modules on all controlled busses via the RESET message.

void carma::downconverter::SldcMaster::start ( )

Start sldc master in a separate thread.

Calls Master::run() but spawns it in a separate thread.

void carma::downconverter::SldcMaster::stop ( )

Stop the sldc master.

void carma::downconverter::SldcMaster::updateStatus ( )
protectedvirtual

Update the status of the Sldc CAN Master.

This routine retrieves values specific to the CANbus(ses) for the Sldc system 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: