Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

SctApi::Crate Class Reference

A representation of the crate controller. More...

#include <crate.h>


Public Types

enum  PLControl { C_PL_STOP, C_PL_PAUSE, C_PL_RESUME, C_PL_CANCEL }
 C_PL_STOP Abort the current primitiveList C_PL_PAUSE Pause the current primitiveList C_PL_RESUME Resume the current primitiveList C_PL_CANCEL Cancel the recently sent primitiveList (only if not started execution). More...


Public Member Functions

 Crate (unsigned int partition, unsigned int crate, boost::shared_ptr< SctConfiguration::Configuration > newConf=boost::shared_ptr< SctConfiguration::Configuration >())
 Tell this crate which partition it belongs to.

 ~Crate ()
 Delete all the RodModules and VmeInterface.

int initialiseTim ()
 Return 0 for success.

int initialiseRod (unsigned int rod)
 Store object in local map.

int initialiseBOC (unsigned int rod)
 Return 0 for success.

int configureBOC (unsigned int rod)
 Return 0 for success.

int sendPrimList (unsigned int rod, shared_ptr< PrimListWrapper > prim)
 Return 0 for success.

int sendPrimListAll (shared_ptr< PrimListWrapper > prim)
 Return 0 for success.

int awaitResponse (unsigned int rod, int timeout)
 Await response from a ROD within this crate.

int awaitResponseAll (int timeout)
 Handle text messages sent by the RODs (print to stdout).

shared_ptr< SctPixelRod::RodOutListgetResponse (unsigned int rod)
 Return the response to the last primlist (a wrapped copy).

void setMrsStream (MRSStream *stream)
bool getRodMessage (unsigned int rod, char *buffer, int &length)
int mdspBlockRead (unsigned int rod, long dspStart, unsigned long *buffer, long numWords)
 Proxy for RodModule method.

int slvBlockRead (unsigned int rod, long dspStart, unsigned long *buffer, long numWords, long slaveNumber)
 Proxy for RodModule method.

int slvBlockWrite (unsigned int rod, long dspStart, unsigned long *buffer, long numWords, long dspNumber)
 Proxy for RodModule method.

int mdspBlockWrite (const unsigned int rod, const long dspStart, unsigned long *buffer, const long numWords)
 Proxy for RodModule method.

unsigned long readRodStatusReg (unsigned int rod, long regNumber)
 Proxy for RodModule method.

unsigned long readRodCommandReg (unsigned int rod, long regNumber)
 Proxy for RodModule method.

unsigned long dspSingleRead (unsigned int rod, const unsigned long dspAddr, long dspNumber)
 Proxy for RodModule method.

int dspSingleWrite (unsigned int rod, unsigned long dspAddr, unsigned long buffer, long dspNumber)
 Proxy for RodModule method.

void status ()
 Print status of rods on crate.

void primListControl (unsigned int rod, PLControl function)
 Control the primitive list running on a rod (Untested).

void printBOCSetup (unsigned int rod)
 Print all BOC paramters as set up.

void printBOCRegisters (unsigned int rod)
 Print all BOC registers.

bool checkBOCLasersOn (unsigned int rod)
 Check BOC laser interlock.

void enterBOCClockBy2Mode (unsigned int rod)
 Setup BOC to sample at 20MHz.

void leaveBOCClockBy2Mode (unsigned int rod)
 Restore BOC to 40MHz mode.

void modifyBOCParam (unsigned int rod, unsigned int channel, unsigned int type, unsigned int val)
 Modify parameters on BOC (type undefined).

void lasersOff ()
 Turn all BOC laser currents to 0.

void freeTriggers (SctPixelRod::TimMaskFrequency freq=SctPixelRod::TIM_MASK_TRIG_10_0KHZ)
 Start the TIM generating regular triggers.

void stopTriggers ()
 Stop the TIM generating regular triggers.

void timL1A ()
 Tell the TIM to send an L1A.

void timCalL1A (int delay)
 Tell TIM to send Cal + L1A.

bool slavePresent (int rod, int index) const
 Check if a slave has been started.

bool RODPresent (int rod) const
 Check if a ROD has been configured.


Private Types

typedef std::map< unsigned
int, std::pair< RodStatus *,
SctPixelRod::RodModule * > > 
RodMap
 Shortcut for rod map.


Private Member Functions

 Crate (const Crate &)
Crate & operator= (const Crate &)
SctPixelRod::RodModulegetRod (unsigned int rod) const
 Return 0 if not found.

const RodStatusgetRodData (unsigned int rod) const
RodStatusgetRodData (unsigned int rod)
void doTextBuffer (SctPixelRod::RodModule &rod0)
 Get a text buffer from a ROD.


Private Attributes

RodMap rodMap
 Map to lookup RodModule objects.

SctPixelRod::TimModuletim
 TIM module.

boost::shared_ptr< SctConfiguration::Configurationconfig
 The configuration.

SctPixelRod::VmeInterfacevme
 The vmeinterface that is used by all rods and tims.

const unsigned int partition
 Which partition this crate is in.

const unsigned int crate
 The id of this crate.

MRSStream * mrs
bool stopPolling


Detailed Description

A representation of the crate controller.

This is used by SCTAPI to send commands to RodModule objects. These are stored in crate memory.

Module configuration will eventually be stored here also?

Definition at line 52 of file crate.h.


Member Typedef Documentation

typedef std::map<unsigned int, std::pair<RodStatus *, SctPixelRod::RodModule *> > SctApi::Crate::RodMap [private]
 

Shortcut for rod map.

Definition at line 277 of file crate.h.


Member Enumeration Documentation

enum SctApi::Crate::PLControl
 

C_PL_STOP Abort the current primitiveList C_PL_PAUSE Pause the current primitiveList C_PL_RESUME Resume the current primitiveList C_PL_CANCEL Cancel the recently sent primitiveList (only if not started execution).

Enumeration values:
C_PL_STOP 
C_PL_PAUSE 
C_PL_RESUME 
C_PL_CANCEL 

Definition at line 209 of file crate.h.


Constructor & Destructor Documentation

SctApi::Crate::Crate const Crate &    [private]
 

SctApi::Crate::Crate unsigned int    partition,
unsigned int    crate,
boost::shared_ptr< SctConfiguration::Configuration   newConf = boost::shared_ptr< SctConfiguration::Configuration >()
 

Tell this crate which partition it belongs to.

This creates a VmeInterface.

SctApi::Crate::~Crate  
 

Delete all the RodModules and VmeInterface.


Member Function Documentation

int SctApi::Crate::awaitResponse unsigned int    rod,
int    timeout
 

Await response from a ROD within this crate.

Handle text messages sent by the ROD (print to stdout)

If waiting longer than timeout seconds then return anyway

int SctApi::Crate::awaitResponseAll int    timeout
 

Handle text messages sent by the RODs (print to stdout).

If waiting longer than timeout seconds then return anyway

bool SctApi::Crate::checkBOCLasersOn unsigned int    rod
 

Check BOC laser interlock.

int SctApi::Crate::configureBOC unsigned int    rod
 

Return 0 for success.

void SctApi::Crate::doTextBuffer SctPixelRod::RodModule   rod0 [private]
 

Get a text buffer from a ROD.

unsigned long SctApi::Crate::dspSingleRead unsigned int    rod,
const unsigned long    dspAddr,
long    dspNumber
 

Proxy for RodModule method.

int SctApi::Crate::dspSingleWrite unsigned int    rod,
unsigned long    dspAddr,
unsigned long    buffer,
long    dspNumber
 

Proxy for RodModule method.

void SctApi::Crate::enterBOCClockBy2Mode unsigned int    rod
 

Setup BOC to sample at 20MHz.

void SctApi::Crate::freeTriggers SctPixelRod::TimMaskFrequency    freq = SctPixelRod::TIM_MASK_TRIG_10_0KHZ
 

Start the TIM generating regular triggers.

shared_ptr<SctPixelRod::RodOutList> SctApi::Crate::getResponse unsigned int    rod
 

Return the response to the last primlist (a wrapped copy).

SctPixelRod::RodModule* SctApi::Crate::getRod unsigned int    rod const [private]
 

Return 0 if not found.

RodStatus& SctApi::Crate::getRodData unsigned int    rod [private]
 

const RodStatus& SctApi::Crate::getRodData unsigned int    rod const [private]
 

bool SctApi::Crate::getRodMessage unsigned int    rod,
char *    buffer,
int &    length
 

Parameters:
rod Index of ROD
buffer Buffer to write text into
length Length of buffer allocated, on return contains amount of data copied.
Return message from ROD if present

int SctApi::Crate::initialiseBOC unsigned int    rod
 

Return 0 for success.

int SctApi::Crate::initialiseRod unsigned int    rod
 

Store object in local map.

Return 0 for success

int SctApi::Crate::initialiseTim  
 

Return 0 for success.

void SctApi::Crate::lasersOff  
 

Turn all BOC laser currents to 0.

void SctApi::Crate::leaveBOCClockBy2Mode unsigned int    rod
 

Restore BOC to 40MHz mode.

int SctApi::Crate::mdspBlockRead unsigned int    rod,
long    dspStart,
unsigned long *    buffer,
long    numWords
 

Proxy for RodModule method.

int SctApi::Crate::mdspBlockWrite const unsigned int    rod,
const long    dspStart,
unsigned long *    buffer,
const long    numWords
 

Proxy for RodModule method.

void SctApi::Crate::modifyBOCParam unsigned int    rod,
unsigned int    channel,
unsigned int    type,
unsigned int    val
 

Modify parameters on BOC (type undefined).

Crate& SctApi::Crate::operator= const Crate &    [private]
 

void SctApi::Crate::primListControl unsigned int    rod,
PLControl    function
 

Control the primitive list running on a rod (Untested).

void SctApi::Crate::printBOCRegisters unsigned int    rod
 

Print all BOC registers.

void SctApi::Crate::printBOCSetup unsigned int    rod
 

Print all BOC paramters as set up.

unsigned long SctApi::Crate::readRodCommandReg unsigned int    rod,
long    regNumber
 

Proxy for RodModule method.

unsigned long SctApi::Crate::readRodStatusReg unsigned int    rod,
long    regNumber
 

Proxy for RodModule method.

bool SctApi::Crate::RODPresent int    rod const
 

Check if a ROD has been configured.

int SctApi::Crate::sendPrimList unsigned int    rod,
shared_ptr< PrimListWrapper   prim
 

Return 0 for success.

int SctApi::Crate::sendPrimListAll shared_ptr< PrimListWrapper   prim
 

Return 0 for success.

void SctApi::Crate::setMrsStream MRSStream *    stream
 

bool SctApi::Crate::slavePresent int    rod,
int    index
const
 

Check if a slave has been started.

int SctApi::Crate::slvBlockRead unsigned int    rod,
long    dspStart,
unsigned long *    buffer,
long    numWords,
long    slaveNumber
 

Proxy for RodModule method.

int SctApi::Crate::slvBlockWrite unsigned int    rod,
long    dspStart,
unsigned long *    buffer,
long    numWords,
long    dspNumber
 

Proxy for RodModule method.

void SctApi::Crate::status  
 

Print status of rods on crate.

void SctApi::Crate::stopTriggers  
 

Stop the TIM generating regular triggers.

void SctApi::Crate::timCalL1A int    delay
 

Tell TIM to send Cal + L1A.

void SctApi::Crate::timL1A  
 

Tell the TIM to send an L1A.


Field Documentation

boost::shared_ptr<SctConfiguration::Configuration> SctApi::Crate::config [private]
 

The configuration.

Definition at line 286 of file crate.h.

const unsigned int SctApi::Crate::crate [private]
 

The id of this crate.

Definition at line 295 of file crate.h.

MRSStream* SctApi::Crate::mrs [private]
 

Definition at line 297 of file crate.h.

const unsigned int SctApi::Crate::partition [private]
 

Which partition this crate is in.

Definition at line 292 of file crate.h.

RodMap SctApi::Crate::rodMap [private]
 

Map to lookup RodModule objects.

Definition at line 280 of file crate.h.

bool SctApi::Crate::stopPolling [private]
 

Definition at line 300 of file crate.h.

SctPixelRod::TimModule* SctApi::Crate::tim [private]
 

TIM module.

Definition at line 283 of file crate.h.

SctPixelRod::VmeInterface* SctApi::Crate::vme [private]
 

The vmeinterface that is used by all rods and tims.

Definition at line 289 of file crate.h.


The documentation for this class was generated from the following file:
Generated on Mon Dec 15 19:37:29 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3