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

SctApi::SctApi Class Reference

SctApi class. More...

#include <SctApi.h>

Inheritance diagram for SctApi::SctApi:

SctApiServer

Public Member Functions

 SctApi ()
 Default to local xmlConfig.

 SctApi (boost::shared_ptr< SctConfiguration::Configuration > newConf)
 Specify configuration.

 SctApi (int initDebug)
 Specify initial debug level.

 ~SctApi ()
void setMrsStream (MRSStream *stream)
 C++ only method to tell a MRS aware program where to write to.

void initialiseAll (int run)
 Initialise the crates and create the Rod/Vme objects.

void shutdownAll ()
 Leave everything in a suitable state and delete all the objects.

void setRunNumber (UINT32 newRun)
 IPC: Don't do during a scan.

void setScanNumber (UINT32 newScan)
 IPC: Don't do during a scan.

void configureAllModules ()
 DDC: Check modules in configurable state.

void loadConfiguration ()
 IPC: Don't do during a scan Conf: Definite interaction!

void loadConfiguration (std::string filename)
 IPC: Don't do during a scan Conf: Definite interaction!

void storeModuleConfigurations ()
 IPC: Don't do during a scan Conf: Definite interaction!

void configureBOC (unsigned int partition, unsigned int crate, unsigned int rod)
 IPC: Don't do during a scan Conf: Definite interaction!

void awaitResponse (unsigned int partition, unsigned int crate, unsigned int rod, int timeout)
 IPC: Allow during a scan (only expert mode) Conf: no interaction!

void awaitResponseAll (unsigned int partition, unsigned int crate, int timeout)
 IPC: Allow during a scan (only expert mode) Conf: no interaction!

unsigned long * getResponse (unsigned int partition, unsigned int crate, unsigned int rod, unsigned long &length)
 (No interaction with VME) IPC: Allow during a scan (only expert mode) Conf: No interaction!

bool getRodMessage (unsigned int partition, unsigned int crate, unsigned int rod, char *buffer, int &length)
 Get a message in the text buffer.

void flashLED (unsigned int partition, unsigned int crate, unsigned int rod, unsigned long slaveNumber, long period=1000, long flashes=10)
 This creates its own primitive list and sends it to a slave DSP on the ROD.

void echo (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int length, const long *data)
 IPC: Possible during a scan? Conf: No interaction.

int dspBlockDump (unsigned int partition, unsigned int crate, unsigned int rod, long dspStart, long numWords, long dspNumber)
 Dump contents of a block of DSP memory to cout.

int dspBlockDumpFile (unsigned int partition, unsigned int crate, unsigned int rod, long dspStart, long numWords, long dspNumber, string filename)
void standardRegisterDump (unsigned int partition, unsigned int crate, unsigned int rod)
 Dump registers to files.

unsigned long * dspBlockRead (unsigned int partition, unsigned int crate, unsigned int rod, long dspStart, long numWords, long dspNumber, long &length)
 Use dspNumber -1 to refer to the master DSP.

int dspBlockWrite (unsigned int partition, unsigned int crate, unsigned int rod, unsigned long *buffer, unsigned long dspAddress, long numWords, long dspNumber)
 Use dspNumber -1 to refer to the master DSP.

unsigned long * readSlaveDsp (unsigned int partition, unsigned int crate, unsigned int rod, int s, int add, int words)
 Don't use if important to preserve primitive state!

unsigned long readRodStatusReg (unsigned int partition, unsigned int crate, unsigned int rod, long regNumber)
 IPC: Immediate response Conf: No interaction.

unsigned long readRodCommandReg (unsigned int partition, unsigned int crate, unsigned int rod, long regNumber)
 IPC: Immediate response Conf: No interaction.

unsigned long dspSingleRead (unsigned int partition, unsigned int crate, unsigned int rod, const unsigned long dspAddr, long dspNumber)
 IPC: Immediate response Conf: No interaction.

void dspSingleWrite (unsigned int partition, unsigned int crate, unsigned int rod, unsigned long dspAddr, unsigned long buffer, long dspNumber)
 IPC: Immediate response (expert only) Conf: No interaction.

ABCDModuleretrieveModule (UINT32 mid)
 Module data as cached from Configuration.

void createDebugPrimList ()
 IPC: Immediate response (expert) Conf: No Interaction.

void addDebugPrimList (unsigned long length, long index, long id, long version, unsigned long *body)
 IPC: Immediate response (expert) Conf: No Interaction.

void sendDebugPrimList (unsigned int partition, unsigned int crate, unsigned int rod)
 IPC: Immediate response (expert) Conf: No Interaction.

void sendDebugSlavePrimList (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int slave, bool await, bool response)
 Send the previously created prim list to a slave dsp.

UINT32 findModule (std::string sn)
std::string convertToString (UINT32 mid)
 IPC: Immediate response Conf: Lookup.

UINT32 findModule (INT32 mur, INT32 module)
 IPC: Immediate response Conf: Lookup.

std::pair< INT32, INT32 > convertToMUR (UINT32 mid)
 IPC: Immediate response Conf: Lookup.

UINT32 findBarrelModule (INT32 barrel, INT32 row, INT32 number)
 IPC: Immediate response Conf: Lookup.

void convertToBarrelModule (UINT32 mid, UINT32 &barrel, UINT32 &row, int &number)
 IPC: Immediate response Conf: Lookup.

UINT32 findEndcapModule (INT32 disk, INT32 quadrant, INT32 number)
 IPC: Immediate response Conf: Lookup.

void convertToEndcapModule (UINT32 mid, UINT32 &disk, UINT32 &quadrant, UINT32 &number)
 IPC: Immediate response Conf: Lookup.

void getABCDModule (UINT32 bank)
 IPC: Immediate response Conf: Lookup.

void getABCDModule (UINT32 mid, UINT32 bank)
 IPC: Immediate response Conf: Lookup.

void setABCDModule (UINT32 mid, UINT32 bank)
 IPC: Don't do during scan Conf: Possible cache.

void sendAllABCDModules (UINT32 bank, UINT32 type=2)
void sendABCDModule (UINT32 mid, UINT32 bank, UINT32 type=2)
void modifyABCDMask (UINT32 mid, UINT32 *mask)
 Set the channel mask of all chips in a module.

void modifyABCDTrims (UINT32 mid, UINT8 *trims)
 Modify a module's trim configuration.

void modifyABCDVar (UINT32 typ, FLOAT32 var)
 IPC: Not during scan Conf: No communication.

void modifyABCDVar (UINT32 mid, UINT32 typ, FLOAT32 var)
 IPC: Not during scan Conf: No communication.

void modifyABCDVar (UINT32 mid, UINT32 chip, UINT32 typ, FLOAT32 var)
 IPC: Not during scan Conf: No communication.

void modifyABCDRC (UINT32 mid, UINT32 chip, UINT16 function, FLOAT32 p0, FLOAT32 p1, FLOAT32 p2)
 IPC: Not during scan Conf: No communication.

void modifyBOCParam (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int channel, unsigned int type, unsigned int val)
 IPC: Not during scan Conf: No communication.

void printBOCSetup (unsigned int partition, unsigned int crate, unsigned int rod)
 IPC: Immediate response (Needs results by IPC?) Conf: No communication.

void printBOCRegisters (unsigned int partition, unsigned int crate, unsigned int rod)
 IPC: Immediate response (Needs results by IPC?) Conf: No communication.

void lasersOff ()
 IPC: Immediate response Conf: No communication.

void freeTriggers (unsigned int partition, unsigned int crate, float freq)
 Freq is rounded to the nearest power of 10 between .01 and 100k Hz.

void stopTriggers (unsigned int partition, unsigned int crate)
 IPC: Not during scan Conf: No communication.

void timL1A (unsigned int partition, unsigned int crate)
 IPC: Not during scan Conf: No communication.

void timCalL1A (unsigned int partition, unsigned int crate, int delay)
 IPC: Not during scan Conf: No communication.

void status ()
 IPC: Immediate response (sane in all eventualities!) Conf: No communication.

void defaultScan (int type)
 IPC: Not during any other scan Conf: No communication.

void doScan (Scan &scan)
 DDC: Check modules configured...

void abortScan ()
 Abort any long term activity.

void doRawScan (Scan &scan, int delay, bool configure=false, bool clkBy2=false)
 IPC: Not during any other scan Conf: Lookup.

void sendTriggerAll (const Trigger *trig)
 IPC: Not during any other scan Conf: No communication.

void sendTrigger (unsigned int partition, unsigned int crate, unsigned int rod, const Trigger *trig)
 IPC: Not during any other scan Conf: No communication.

void printABCDModule (int mid)
 Uses the sctConf method.

void printABCDRodModule (int mid, int bank)
 First retrieve the configuration from the ROD Uses the sctConf method.

void decodeEvent (unsigned int partition, unsigned int crate, unsigned int rod, int sl, int index, bool extFlag=false, bool errorType=false)
 IPC: Needs feedback, immediate response Conf: No Communication.

void printHex (UINT32 num, int width)
void rawData (unsigned int partition, unsigned int crate, unsigned int rod, int delay, int units, bool setMask=true, const Trigger *trig=0)
 IPC: Needs feedback, immediate response Conf: No Communication.

void sendL1A (unsigned int partition, unsigned int crate, unsigned int rod, bool capture=false)
 The mask is unchanged in this function and it is set up to go to all modules.

vector< char > probe (unsigned int partition, unsigned int crate, unsigned int rod, signed int harness=-1)
 Do quick scan of channels Recognises all the same, clock by 2 and an event header Return a char for each link examined 0 All zero's 1 All one's 2 Clock by 2 L L1A E Event Header S Soft Reset B BC Reset J Junk (ie anything else).

vector< char > probeWithTrigger (unsigned int partition, unsigned int crate, unsigned int rod, const Trigger *trigger, signed int harness=-1)
 Do quick scan of channels Recognises all the same, clock by 2 and an event header Return a char for each link examined 0 All zero's 1 All one's 2 Clock by 2 L L1A E Event Header S Soft Reset B BC Reset J Junk (ie anything else).

void bocHistogram (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int samples, unsigned int numLoops)
 Do a "BOC histogram".

void requestHardResetAll ()
 Request hard reset on all modules.

void requestHardReset (UINT32 mid)
 Request hard reset of module mid.

void requestIVCurve (UINT32 mid, FLOAT32 start, FLOAT32 stop, FLOAT32 step, UINT16 delay, FLOAT32 currentLim)
 Request initialisation of an IV scan.

void requestIVCurveAll (FLOAT32 start, FLOAT32 stop, FLOAT32 step, UINT16 delay, FLOAT32 currentLim)
 Request initialisation of an IV scan on all modules.

void ddcGetChannelParameter (int crate, int channel, std::string dpeName, int &dpeValue, int timeout)
 Get a channel parameter from DDC.

void setSelect (UINT32 mid, bool value)
 Set the select value for module mid.

void changeRunState (int state)
 Change run state of all power modules.

void tidyHistogramming ()
 Stop all tasks to do with histogramming.

void setDebugLevel (unsigned int level)
 Set the current debug level.

unsigned int getDebugLevel ()
 Get the current debug level.

void debugStepHistogram ()
void debugContinueHistogram ()
void debugAbortHistogram ()
void rodMode (unsigned int partition, unsigned int crate, unsigned int rod, int mode, int flag, int fifoSetup, int nBins, int delay, int message)
 Direct write of ROD mode!

void setupModuleMask (unsigned int partition, unsigned int crate, unsigned int rod, int port, int slvs)
 Set module masks.

void setupModuleMask (int port, int slvs, boost::shared_ptr< PrimListWrapper > list)
 Add set module masks command to primitive list.

void sendData (unsigned int partition, unsigned int crate, unsigned int rod)

Static Public Attributes

const unsigned int BAD_MODULE
 The constant returned as an unknown module.


Private Member Functions

 SctApi (const SctApi &)
SctApi & operator= (const SctApi &)
void setup ()
 This sets the unexpected handler to interpret all sorts of exceptions.

int initialiseRod (unsigned int partition, unsigned int crate, unsigned int rod)
 Proxy for Crate.

int initialiseTim (unsigned int partition, unsigned int crate)
 Proxy for Crate.

int initialiseBOC (unsigned int partition, unsigned int crate, unsigned int rod)
 Proxy for Crate.

void writeSlaveBlock (unsigned int partition, unsigned int crate, unsigned int rod, int s, long sAdd, int words, long *block)
 Write block of memory to a slave (using RW_SLAVE_MEMORY).

void setSlaveBlock (unsigned int partition, unsigned int crate, unsigned int rod, int s, long sAdd, int words, long value=0)
 Set block of slave memory to value (using RW_SLAVE_MEMORY).

void writeRODRegister (unsigned int partition, unsigned int crate, unsigned int rod, int reg, int off, int width, int value)
 Write to a ROD register.

void writeRODRegister (int reg, int off, int width, int value, boost::shared_ptr< PrimListWrapper > list)
 Add write rod register command to primitive list.

unsigned int readRODRegister (unsigned int partition, unsigned int crate, unsigned int rod, int r)
 Read a register from the ROD.

int pollRegister (unsigned int partition, unsigned int crate, unsigned int rod, int r, int off, int width, int val, int timeout=1000000)
 Poll a register.

unsigned long * readFifo (unsigned int partition, unsigned int crate, unsigned int rod, int id, int bank, int elems)
int initialiseModule (std::string module)
 Load module configuration from database Send module configuration to ROD.

void sendSlavePrimList (unsigned int partition, unsigned int crate, unsigned int rod, boost::shared_ptr< PrimListWrapper > prim, unsigned int slave, bool await, bool response)
 Send a RodPrimList to the Master DSP which contains the RodPrimList which is passed as an argument.

void buildSlavePrimList (boost::shared_ptr< PrimListWrapper > primList, boost::shared_ptr< PrimListWrapper > prim, unsigned int slaveNumber, bool await, bool response)
 Put a send slave list primitive into a primitive list Follow it by a start list primitive.

void sendPrimList (unsigned int partition, unsigned int crate, unsigned int rod, boost::shared_ptr< PrimListWrapper > prim)
 A helper function for other methods in this class, to be used only internally to this class as it exposes the RodPrimList class.

void sendPrimListAll (unsigned int partition, unsigned int crate, boost::shared_ptr< PrimListWrapper > prim)
 A helper function for other methods in this class, to be used only internally to this class as it exposes the RodPrimList class.

void startHistogramTask (const Scan &scan, const ScanEx &ex, boost::shared_ptr< PrimListWrapper > list)
 Create histogram task primitive.

void setupEventTrapping (const Scan &scan, const ScanEx &ex, boost::shared_ptr< PrimListWrapper > list)
 Setup event trapping according to scan and ex.

void startEventTrapping (const Scan &scan, const ScanEx &ex, boost::shared_ptr< PrimListWrapper > primList)
 Start event trapping according to scan and ex.

void setupHistogramming (const Scan &scan, const ScanEx &ex, boost::shared_ptr< PrimListWrapper > list)
 Setup histogramming according to scan and ex.

void stopHistogramming (ScanEx &ex)
 Stop the histogramming and event trapping tasks.

void calib_init ()
 Setup ROD for calibration.

void print_calib (unsigned int partition, unsigned int crate, unsigned int rod)
 Print ROD calibration registers.

void pollHistogramming (ScanEx &ex, int slave, int bins, int events, int timeout=5)
 Wait for the number of bins to equal (bins - 1) on the master.

scan_result_ptrs readHistogramData (const Scan &scan, const ScanEx &ex, UINT32 mid, int index)
 Read histogram data.

void readHistogramsToFile (const Scan &scan, const ScanEx &ex)
 Read the histogram data in to a file.

void saveHistogramToFile (scan_result_ptrs histo, std::string filename)
 Write a histogram to a file.

void readRawData (unsigned int partition, unsigned int crate, unsigned int rod, int delay, bool setMask)
 Read raw data from all links into one "histogram".

int setupRawData (unsigned int partition, unsigned int crate, unsigned int rod, int delay, int units, bool setMask, const Trigger *trig=0)
 Put raw data into FIFOs ready to read out.

void printOutList (unsigned long *outlist, unsigned long length, bool in=false, int level=0)
CrategetCrate (unsigned int partition, unsigned int crate) const
 Lookup the Crate object to send instructions to.

ABCDModulelookupConfig (UINT32 mid)
 Lookup module configuration in the cache.

void cacheModuleConfig (UINT32 mid)
 Put module mid into the cache (if present in the configuration).

void getrpcrc (UINT32 mid, unsigned int &rpartition, unsigned int &rcrate, unsigned int &rrod, unsigned &rchannel)
 XXX What does it do on failure!!!

void initDDC ()
 I think I have to do this after ILU is running (otherwise SCTDCSCommand can't do the stuff it needs to initialise.


Private Attributes

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

MRSStream * mrs
IPCPartition * ddcPartition
string * ddcCtrls [2]
SCTDCSCommand * ddcCmd
boost::shared_ptr< PrimListWrapperdebugPrimList
 The current debug primitive list.

std::map< std::pair< unsigned
int, unsigned int >, Crate * > 
crateMap
 Map to retrieve crate objects.

std::map< UINT32, ABCDModulemoduleMap
 Cache of module configurations.

Log log
 Log everything that is called.

int debugLevel
 What debug information is printed.

ScanlastDebugScan
 For debug only, save the scan information.

ScanEx lastDebugScanEx
int responseCode
 Response code from awaitResponse.

UINT32 scanNumber
 Current scan number.

UINT32 runNumber
 Current run number.

boost::mutex logMutex

Detailed Description

SctApi class.

This is the API used by the rest of the world to interact with SCT Modules using RODs.

Functionality that should be included in this class includes.

DAQ run level transitions: Boot Load and run the crate controller (Done automatically in DAQ-1 from configuration) Load Load config? Config Send config to Modules Start Mode for execution of scans

Configuration: loading from file loading to modules fine grained control on modules recovering module configuration from the ROD Save configuration

Reconfiguring from new configuration file

Scanning: perform scans over configuration variable(s)

DCS: minimal DCS communication

ROD diagnostics: Flash LEDs Text buffer retrieval Memory dumps Send arbitrary primitives to a single ROD

Indexing: There are several ways of addressing a ROD or module the canonical method is partition, crate, rod, module

Other methods include: Geographical: barrel/disc MUR, number MUR: Partition, MUR, number

Definition at line 215 of file SctApi.h.


Constructor & Destructor Documentation

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

SctApi::SctApi::SctApi  
 

Default to local xmlConfig.

SctApi::SctApi::SctApi boost::shared_ptr< SctConfiguration::Configuration   newConf
 

Specify configuration.

SctApi::SctApi::SctApi int    initDebug
 

Specify initial debug level.

SctApi::SctApi::~SctApi  
 


Member Function Documentation

void SctApi::SctApi::abortScan  
 

Abort any long term activity.

DDC: No action IPC: Immediate response Conf: No communication

void SctApi::SctApi::addDebugPrimList unsigned long    length,
long    index,
long    id,
long    version,
unsigned long *    body
 

IPC: Immediate response (expert) Conf: No Interaction.

void SctApi::SctApi::awaitResponse unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    timeout
 

IPC: Allow during a scan (only expert mode) Conf: no interaction!

void SctApi::SctApi::awaitResponseAll unsigned int    partition,
unsigned int    crate,
int    timeout
 

IPC: Allow during a scan (only expert mode) Conf: no interaction!

void SctApi::SctApi::bocHistogram unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned int    samples,
unsigned int    numLoops
 

Do a "BOC histogram".

void SctApi::SctApi::buildSlavePrimList boost::shared_ptr< PrimListWrapper   primList,
boost::shared_ptr< PrimListWrapper   prim,
unsigned int    slaveNumber,
bool    await,
bool    response
[private]
 

Put a send slave list primitive into a primitive list Follow it by a start list primitive.

void SctApi::SctApi::cacheModuleConfig UINT32    mid [private]
 

Put module mid into the cache (if present in the configuration).

void SctApi::SctApi::calib_init   [private]
 

Setup ROD for calibration.

void SctApi::SctApi::changeRunState int    state
 

Change run state of all power modules.

One of Off, Standby, On

DDC: Primary purpose IPC: Not during scan Conf: No communication

void SctApi::SctApi::configureAllModules  
 

DDC: Check modules in configurable state.

Correct run state and no warnings

IPC: Don't do during a scan Conf: Maybe interaction

void SctApi::SctApi::configureBOC unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

IPC: Don't do during a scan Conf: Definite interaction!

void SctApi::SctApi::convertToBarrelModule UINT32    mid,
UINT32 &    barrel,
UINT32 &    row,
int &    number
 

IPC: Immediate response Conf: Lookup.

void SctApi::SctApi::convertToEndcapModule UINT32    mid,
UINT32 &    disk,
UINT32 &    quadrant,
UINT32 &    number
 

IPC: Immediate response Conf: Lookup.

std::pair<INT32, INT32> SctApi::SctApi::convertToMUR UINT32    mid
 

IPC: Immediate response Conf: Lookup.

std::string SctApi::SctApi::convertToString UINT32    mid
 

IPC: Immediate response Conf: Lookup.

void SctApi::SctApi::createDebugPrimList  
 

IPC: Immediate response (expert) Conf: No Interaction.

void SctApi::SctApi::ddcGetChannelParameter int    crate,
int    channel,
std::string    dpeName,
int &    dpeValue,
int    timeout
 

Get a channel parameter from DDC.

void SctApi::SctApi::debugAbortHistogram  
 

void SctApi::SctApi::debugContinueHistogram  
 

void SctApi::SctApi::debugStepHistogram  
 

void SctApi::SctApi::decodeEvent unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    sl,
int    index,
bool    extFlag = false,
bool    errorType = false
 

IPC: Needs feedback, immediate response Conf: No Communication.

void SctApi::SctApi::defaultScan int    type
 

IPC: Not during any other scan Conf: No communication.

void SctApi::SctApi::doRawScan Scan   scan,
int    delay,
bool    configure = false,
bool    clkBy2 = false
 

IPC: Not during any other scan Conf: Lookup.

void SctApi::SctApi::doScan Scan   scan
 

DDC: Check modules configured...

Check select IPC: Not during any other scan Conf: Lookup

int SctApi::SctApi::dspBlockDump unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    dspStart,
long    numWords,
long    dspNumber
 

Dump contents of a block of DSP memory to cout.

Use dspNumber -1 to refer to the master DSP.

IPC: Possible during a scan Conf: No interaction

int SctApi::SctApi::dspBlockDumpFile unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    dspStart,
long    numWords,
long    dspNumber,
string    filename
 

unsigned long* SctApi::SctApi::dspBlockRead unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    dspStart,
long    numWords,
long    dspNumber,
long &    length
 

Use dspNumber -1 to refer to the master DSP.

IPC: Possible during a scan Conf: No interaction

int SctApi::SctApi::dspBlockWrite unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned long *    buffer,
unsigned long    dspAddress,
long    numWords,
long    dspNumber
 

Use dspNumber -1 to refer to the master DSP.

IPC: Possible during a scan Conf: No interaction

unsigned long SctApi::SctApi::dspSingleRead unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
const unsigned long    dspAddr,
long    dspNumber
 

IPC: Immediate response Conf: No interaction.

void SctApi::SctApi::dspSingleWrite unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned long    dspAddr,
unsigned long    buffer,
long    dspNumber
 

IPC: Immediate response (expert only) Conf: No interaction.

void SctApi::SctApi::echo unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned int    length,
const long *    data
 

IPC: Possible during a scan? Conf: No interaction.

UINT32 SctApi::SctApi::findBarrelModule INT32    barrel,
INT32    row,
INT32    number
 

IPC: Immediate response Conf: Lookup.

UINT32 SctApi::SctApi::findEndcapModule INT32    disk,
INT32    quadrant,
INT32    number
 

IPC: Immediate response Conf: Lookup.

UINT32 SctApi::SctApi::findModule INT32    mur,
INT32    module
 

IPC: Immediate response Conf: Lookup.

UINT32 SctApi::SctApi::findModule std::string    sn
 

Parameters:
sn Module serial number
Returns:
The unique identifier, BAD_MODULE if not found
IPC: Immediate response Conf: Lookup

void SctApi::SctApi::flashLED unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned long    slaveNumber,
long    period = 1000,
long    flashes = 10
 

This creates its own primitive list and sends it to a slave DSP on the ROD.

Period given in ms

IPC: Possible during a scan? Conf: No interaction

void SctApi::SctApi::freeTriggers unsigned int    partition,
unsigned int    crate,
float    freq
 

Freq is rounded to the nearest power of 10 between .01 and 100k Hz.

IPC: Not during scan Conf: No communication

void SctApi::SctApi::getABCDModule UINT32    mid,
UINT32    bank
 

IPC: Immediate response Conf: Lookup.

void SctApi::SctApi::getABCDModule UINT32    bank
 

IPC: Immediate response Conf: Lookup.

Crate* SctApi::SctApi::getCrate unsigned int    partition,
unsigned int    crate
const [private]
 

Lookup the Crate object to send instructions to.

Return 0 if not found.

unsigned int SctApi::SctApi::getDebugLevel  
 

Get the current debug level.

DDC: No action IPC: Class action, immediate response Conf: No communication

unsigned long* SctApi::SctApi::getResponse unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned long &    length
 

(No interaction with VME) IPC: Allow during a scan (only expert mode) Conf: No interaction!

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

Get a message in the text buffer.

Get a message from a ROD text buffer Returns whether the action was completed

void SctApi::SctApi::getrpcrc UINT32    mid,
unsigned int &    rpartition,
unsigned int &    rcrate,
unsigned int &    rrod,
unsigned &    rchannel
[private]
 

XXX What does it do on failure!!!

void SctApi::SctApi::initDDC   [private]
 

I think I have to do this after ILU is running (otherwise SCTDCSCommand can't do the stuff it needs to initialise.

void SctApi::SctApi::initialiseAll int    run
 

Initialise the crates and create the Rod/Vme objects.

Load the system configuration from the database. Create crates and RODs as necessary. Calls initialiseRod and initialiseModule as necessary.

Store the module configuration in the RODs (UNIMPLEMENTED)

Return: 0 for success Possibly error code for failure

IPC: Block everything else!

int SctApi::SctApi::initialiseBOC unsigned int    partition,
unsigned int    crate,
unsigned int    rod
[private]
 

Proxy for Crate.

Return 0 for success

int SctApi::SctApi::initialiseModule std::string    module [private]
 

Load module configuration from database Send module configuration to ROD.

Return 0 for success

int SctApi::SctApi::initialiseRod unsigned int    partition,
unsigned int    crate,
unsigned int    rod
[private]
 

Proxy for Crate.

Return 0 for success

int SctApi::SctApi::initialiseTim unsigned int    partition,
unsigned int    crate
[private]
 

Proxy for Crate.

Return 0 for success

void SctApi::SctApi::lasersOff  
 

IPC: Immediate response Conf: No communication.

void SctApi::SctApi::loadConfiguration std::string    filename
 

IPC: Don't do during a scan Conf: Definite interaction!

void SctApi::SctApi::loadConfiguration  
 

IPC: Don't do during a scan Conf: Definite interaction!

ABCDModule* SctApi::SctApi::lookupConfig UINT32    mid [private]
 

Lookup module configuration in the cache.

void SctApi::SctApi::modifyABCDMask UINT32    mid,
UINT32 *    mask
 

Set the channel mask of all chips in a module.

IPC: Not during scan Conf: No communication

void SctApi::SctApi::modifyABCDRC UINT32    mid,
UINT32    chip,
UINT16    function,
FLOAT32    p0,
FLOAT32    p1,
FLOAT32    p2
 

IPC: Not during scan Conf: No communication.

void SctApi::SctApi::modifyABCDTrims UINT32    mid,
UINT8 *    trims
 

Modify a module's trim configuration.

IPC: Not during scan Conf: No communication

void SctApi::SctApi::modifyABCDVar UINT32    mid,
UINT32    chip,
UINT32    typ,
FLOAT32    var
 

IPC: Not during scan Conf: No communication.

void SctApi::SctApi::modifyABCDVar UINT32    mid,
UINT32    typ,
FLOAT32    var
 

IPC: Not during scan Conf: No communication.

void SctApi::SctApi::modifyABCDVar UINT32    typ,
FLOAT32    var
 

IPC: Not during scan Conf: No communication.

void SctApi::SctApi::modifyBOCParam unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned int    channel,
unsigned int    type,
unsigned int    val
 

IPC: Not during scan Conf: No communication.

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

void SctApi::SctApi::pollHistogramming ScanEx   ex,
int    slave,
int    bins,
int    events,
int    timeout = 5
[private]
 

Wait for the number of bins to equal (bins - 1) on the master.

Then wait for the number of events on the slave to equal to events

Timeout if the bin count doesn't change, and if the number of events doesn't change

int SctApi::SctApi::pollRegister unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    r,
int    off,
int    width,
int    val,
int    timeout = 1000000
[private]
 

Poll a register.

void SctApi::SctApi::print_calib unsigned int    partition,
unsigned int    crate,
unsigned int    rod
[private]
 

Print ROD calibration registers.

void SctApi::SctApi::printABCDModule int    mid
 

Uses the sctConf method.

IPC: Not very useful without feedback Conf: Possible lookup

void SctApi::SctApi::printABCDRodModule int    mid,
int    bank
 

First retrieve the configuration from the ROD Uses the sctConf method.

IPC: Not very useful without feedback Conf: Possible lookup

void SctApi::SctApi::printBOCRegisters unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

IPC: Immediate response (Needs results by IPC?) Conf: No communication.

void SctApi::SctApi::printBOCSetup unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

IPC: Immediate response (Needs results by IPC?) Conf: No communication.

void SctApi::SctApi::printHex UINT32    num,
int    width
 

void SctApi::SctApi::printOutList unsigned long *    outlist,
unsigned long    length,
bool    in = false,
int    level = 0
[private]
 

Parameters:
outlist The list as a block of words
lenth Length of the block of words
in Is this an input list (hence negating the method name!

vector<char> SctApi::SctApi::probe unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
signed int    harness = -1
 

Do quick scan of channels Recognises all the same, clock by 2 and an event header Return a char for each link examined 0 All zero's 1 All one's 2 Clock by 2 L L1A E Event Header S Soft Reset B BC Reset J Junk (ie anything else).

IPC: Needs feedback, some delay to response Conf: Some lookup?!

vector<char> SctApi::SctApi::probeWithTrigger unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
const Trigger   trigger,
signed int    harness = -1
 

Do quick scan of channels Recognises all the same, clock by 2 and an event header Return a char for each link examined 0 All zero's 1 All one's 2 Clock by 2 L L1A E Event Header S Soft Reset B BC Reset J Junk (ie anything else).

IPC: Needs feedback, some delay to response Conf: Some lookup?!

void SctApi::SctApi::rawData unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    delay,
int    units,
bool    setMask = true,
const Trigger   trig = 0
 

IPC: Needs feedback, immediate response Conf: No Communication.

unsigned long* SctApi::SctApi::readFifo unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    id,
int    bank,
int    elems
[private]
 

scan_result_ptrs SctApi::SctApi::readHistogramData const Scan   scan,
const ScanEx   ex,
UINT32    mid,
int    index
[private]
 

Read histogram data.

void SctApi::SctApi::readHistogramsToFile const Scan   scan,
const ScanEx   ex
[private]
 

Read the histogram data in to a file.

void SctApi::SctApi::readRawData unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    delay,
bool    setMask
[private]
 

Read raw data from all links into one "histogram".

unsigned long SctApi::SctApi::readRodCommandReg unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    regNumber
 

IPC: Immediate response Conf: No interaction.

unsigned int SctApi::SctApi::readRODRegister unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    r
[private]
 

Read a register from the ROD.

unsigned long SctApi::SctApi::readRodStatusReg unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
long    regNumber
 

IPC: Immediate response Conf: No interaction.

unsigned long* SctApi::SctApi::readSlaveDsp unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    s,
int    add,
int    words
 

Don't use if important to preserve primitive state!

Returns new[]ed block of memory

IPC: Possible during a scan Conf: No interaction

void SctApi::SctApi::requestHardReset UINT32    mid
 

Request hard reset of module mid.

DDC: Primary purpose IPC: Not during scan Conf: Some lookup?!

void SctApi::SctApi::requestHardResetAll  
 

Request hard reset on all modules.

DDC: Primary purpose IPC: Not during scan Conf: Some lookup?!

void SctApi::SctApi::requestIVCurve UINT32    mid,
FLOAT32    start,
FLOAT32    stop,
FLOAT32    step,
UINT16    delay,
FLOAT32    currentLim
 

Request initialisation of an IV scan.

DDC: Primary purpose IPC: Not during scan, result will be asynchronous Conf: Some lookup?!

void SctApi::SctApi::requestIVCurveAll FLOAT32    start,
FLOAT32    stop,
FLOAT32    step,
UINT16    delay,
FLOAT32    currentLim
 

Request initialisation of an IV scan on all modules.

DDC: Primary purpose IPC: Not during scan, result will be asynchronous Conf: Some lookup?!

ABCDModule* SctApi::SctApi::retrieveModule UINT32    mid
 

Module data as cached from Configuration.

IPC: Immediate response Conf: Interaction

void SctApi::SctApi::rodMode unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    mode,
int    flag,
int    fifoSetup,
int    nBins,
int    delay,
int    message
 

Direct write of ROD mode!

void SctApi::SctApi::saveHistogramToFile scan_result_ptrs    histo,
std::string    filename
[private]
 

Write a histogram to a file.

void SctApi::SctApi::sendABCDModule UINT32    mid,
UINT32    bank,
UINT32    type = 2
 

Parameters:
mid Unique identifier of the module to send
bank Configuration bank in the ROD
type How much configuration to transmit
DDC: Check module state Set select line IPC: Not during scan Conf: No Lookup

void SctApi::SctApi::sendAllABCDModules UINT32    bank,
UINT32    type = 2
 

Parameters:
bank Configuration bank in the ROD
type How much configuration to transmit
DDC: Check module state Set select line IPC: Not during scan Conf: No Lookup

void SctApi::SctApi::sendData unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

void SctApi::SctApi::sendDebugPrimList unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

IPC: Immediate response (expert) Conf: No Interaction.

void SctApi::SctApi::sendDebugSlavePrimList unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
unsigned int    slave,
bool    await,
bool    response
 

Send the previously created prim list to a slave dsp.

Parameters:
await Master prim list waits for slave list to complete
response Expect a reply
IPC: Immediate response (expert) Conf: No Interaction

void SctApi::SctApi::sendL1A unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
bool    capture = false
 

The mask is unchanged in this function and it is set up to go to all modules.

IPC: Not during scan Conf: No Communication

void SctApi::SctApi::sendPrimList unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
boost::shared_ptr< PrimListWrapper   prim
[private]
 

A helper function for other methods in this class, to be used only internally to this class as it exposes the RodPrimList class.

void SctApi::SctApi::sendPrimListAll unsigned int    partition,
unsigned int    crate,
boost::shared_ptr< PrimListWrapper   prim
[private]
 

A helper function for other methods in this class, to be used only internally to this class as it exposes the RodPrimList class.

void SctApi::SctApi::sendSlavePrimList unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
boost::shared_ptr< PrimListWrapper   prim,
unsigned int    slave,
bool    await,
bool    response
[private]
 

Send a RodPrimList to the Master DSP which contains the RodPrimList which is passed as an argument.

Parameters:
await If true master waits for completion of slave primlist
response If true master expects reponse from slave

void SctApi::SctApi::sendTrigger unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
const Trigger   trig
 

IPC: Not during any other scan Conf: No communication.

void SctApi::SctApi::sendTriggerAll const Trigger   trig
 

IPC: Not during any other scan Conf: No communication.

void SctApi::SctApi::setABCDModule UINT32    mid,
UINT32    bank
 

IPC: Don't do during scan Conf: Possible cache.

void SctApi::SctApi::setDebugLevel unsigned int    level
 

Set the current debug level.

DDC: No action IPC: Class action Conf: No communication

void SctApi::SctApi::setMrsStream MRSStream *    stream
 

C++ only method to tell a MRS aware program where to write to.

void SctApi::SctApi::setRunNumber UINT32    newRun
 

IPC: Don't do during a scan.

void SctApi::SctApi::setScanNumber UINT32    newScan
 

IPC: Don't do during a scan.

void SctApi::SctApi::setSelect UINT32    mid,
bool    value
 

Set the select value for module mid.

This is a debug method for DCS. Primary route to this functionality is via modifyABCDVar and sendModule!

DDC: Primary purpose IPC: Not during scan Conf: Some lookup?!

void SctApi::SctApi::setSlaveBlock unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    s,
long    sAdd,
int    words,
long    value = 0
[private]
 

Set block of slave memory to value (using RW_SLAVE_MEMORY).

void SctApi::SctApi::setup   [private]
 

This sets the unexpected handler to interpret all sorts of exceptions.

Called by constructor

void SctApi::SctApi::setupEventTrapping const Scan   scan,
const ScanEx   ex,
boost::shared_ptr< PrimListWrapper   list
[private]
 

Setup event trapping according to scan and ex.

void SctApi::SctApi::setupHistogramming const Scan   scan,
const ScanEx   ex,
boost::shared_ptr< PrimListWrapper   list
[private]
 

Setup histogramming according to scan and ex.

void SctApi::SctApi::setupModuleMask int    port,
int    slvs,
boost::shared_ptr< PrimListWrapper   list
 

Add set module masks command to primitive list.

void SctApi::SctApi::setupModuleMask unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    port,
int    slvs
 

Set module masks.

int SctApi::SctApi::setupRawData unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    delay,
int    units,
bool    setMask,
const Trigger   trig = 0
[private]
 

Put raw data into FIFOs ready to read out.

void SctApi::SctApi::shutdownAll  
 

Leave everything in a suitable state and delete all the objects.

Shutdown anything that needs shutting down This is where we should send DCS to standby message??

IPC: Block everything else!

void SctApi::SctApi::standardRegisterDump unsigned int    partition,
unsigned int    crate,
unsigned int    rod
 

Dump registers to files.

void SctApi::SctApi::startEventTrapping const Scan   scan,
const ScanEx   ex,
boost::shared_ptr< PrimListWrapper   primList
[private]
 

Start event trapping according to scan and ex.

void SctApi::SctApi::startHistogramTask const Scan   scan,
const ScanEx   ex,
boost::shared_ptr< PrimListWrapper   list
[private]
 

Create histogram task primitive.

void SctApi::SctApi::status  
 

IPC: Immediate response (sane in all eventualities!) Conf: No communication.

void SctApi::SctApi::stopHistogramming ScanEx   ex [private]
 

Stop the histogramming and event trapping tasks.

void SctApi::SctApi::stopTriggers unsigned int    partition,
unsigned int    crate
 

IPC: Not during scan Conf: No communication.

void SctApi::SctApi::storeModuleConfigurations  
 

IPC: Don't do during a scan Conf: Definite interaction!

void SctApi::SctApi::tidyHistogramming  
 

Stop all tasks to do with histogramming.

This is a lower level function than abort, which returns to a know state

DDC: If changed? IPC: Any time Conf: No communication

void SctApi::SctApi::timCalL1A unsigned int    partition,
unsigned int    crate,
int    delay
 

IPC: Not during scan Conf: No communication.

void SctApi::SctApi::timL1A unsigned int    partition,
unsigned int    crate
 

IPC: Not during scan Conf: No communication.

void SctApi::SctApi::writeRODRegister int    reg,
int    off,
int    width,
int    value,
boost::shared_ptr< PrimListWrapper   list
[private]
 

Add write rod register command to primitive list.

void SctApi::SctApi::writeRODRegister unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    reg,
int    off,
int    width,
int    value
[private]
 

Write to a ROD register.

void SctApi::SctApi::writeSlaveBlock unsigned int    partition,
unsigned int    crate,
unsigned int    rod,
int    s,
long    sAdd,
int    words,
long *    block
[private]
 

Write block of memory to a slave (using RW_SLAVE_MEMORY).


Field Documentation

const unsigned int SctApi::SctApi::BAD_MODULE [static]
 

The constant returned as an unknown module.

Definition at line 221 of file SctApi.h.

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

The configuration database.

Definition at line 1195 of file SctApi.h.

std::map<std::pair<unsigned int, unsigned int>, Crate* > SctApi::SctApi::crateMap [private]
 

Map to retrieve crate objects.

Definition at line 1210 of file SctApi.h.

SCTDCSCommand* SctApi::SctApi::ddcCmd [private]
 

Definition at line 1204 of file SctApi.h.

string* SctApi::SctApi::ddcCtrls[2] [private]
 

Definition at line 1203 of file SctApi.h.

IPCPartition* SctApi::SctApi::ddcPartition [private]
 

Definition at line 1202 of file SctApi.h.

int SctApi::SctApi::debugLevel [private]
 

What debug information is printed.

Definition at line 1219 of file SctApi.h.

boost::shared_ptr<PrimListWrapper> SctApi::SctApi::debugPrimList [private]
 

The current debug primitive list.

Definition at line 1207 of file SctApi.h.

Scan* SctApi::SctApi::lastDebugScan [private]
 

For debug only, save the scan information.

Definition at line 1222 of file SctApi.h.

ScanEx SctApi::SctApi::lastDebugScanEx [private]
 

Definition at line 1223 of file SctApi.h.

Log SctApi::SctApi::log [private]
 

Log everything that is called.

Definition at line 1216 of file SctApi.h.

boost::mutex SctApi::SctApi::logMutex [private]
 

Definition at line 1235 of file SctApi.h.

std::map<UINT32, ABCDModule> SctApi::SctApi::moduleMap [private]
 

Cache of module configurations.

Definition at line 1213 of file SctApi.h.

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

Definition at line 1197 of file SctApi.h.

int SctApi::SctApi::responseCode [private]
 

Response code from awaitResponse.

Definition at line 1226 of file SctApi.h.

UINT32 SctApi::SctApi::runNumber [private]
 

Current run number.

Definition at line 1232 of file SctApi.h.

UINT32 SctApi::SctApi::scanNumber [private]
 

Current scan number.

Definition at line 1229 of file SctApi.h.


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