OksImpl Class Reference

Interface to XML configuration file. More...

#include <oksImpl.h>

Inheritance diagram for OksImpl:

Inheritance graph
[legend]
Collaboration diagram for OksImpl:

Collaboration graph
[legend]

Public Member Functions

 OksImpl (bool readOnly=true)
 Initialise system.
 ~OksImpl ()
 Free resources.
std::list< unsigned int > listPartitions ()
 List partition ids Lookup the partitions defined in the configuration and return a list of integer ID's.
std::list< unsigned int > listCratesInPartition (unsigned int partition)
 List crate ids with reference to the given partition Lookup the crates defined in the specified partition and return a list of integer ID's.
std::list< unsigned int > listRodsInCrate (unsigned int partition, unsigned int crate)
 List the rods present in a crate Lookup the RODs defined in the specified crate and return a list of integer ID's.
std::list< unsigned int > listMURSInRod (unsigned int partition, unsigned int crate, unsigned int rod)
 List the MURs associated with a ROD Return integer id's of the MURs in the specified rod.
std::list< std::string > listModulesInMUR (unsigned int partition, unsigned int MUR)
 List the modules in the given MUR Return a list of serial numbers associated with the specified MUR.
std::list< std::string > listRModulesInMUR (unsigned int partition, unsigned int MUR)
 List the modules in the given MUR Return a list of serial numbers associated with the redundancy links of the specified MUR.
std::list< std::string > listAllModules ()
 Return a list of serial numbers of all modules that have configuration.
std::list< std::string > listUnusedModules ()
 Return a list of serial numbers of modules that have configuration but are not attached to an MUR.
ABCDModule getModuleConfig (const std::string module)
 Return the configuration for the module.
SctConfiguration::RodConfig getRodConfig (unsigned int partition, unsigned int crate, unsigned int rod)
 Return the Rod configuration Find the configuration associated with the specified ROD.
SctConfiguration::BOCChannelConfig getBOCConfig (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int channel)
 Get the BOC configuration of one of 48 channels.
char * getFibreMappings (unsigned int partition, unsigned int crate, unsigned int rod)
 Get the BOC fibre mappings.
SctConfiguration::TimConfig getTimConfig (unsigned int partition, unsigned int crate)
 Return the TIM configuration Find the configuration associated with the specified TIM.
void setFibreMapping (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int channel, unsigned int tx, unsigned int rx0, unsigned int rx1)
 Set fibre mappings for one channel.
void printModuleConfig (const ABCDModule &conf)
 Print module configuration to cout.
SctConfiguration::MURType getMURType (unsigned int MUR)
void translateToROD (unsigned int MUR, unsigned int module, unsigned int &partition, unsigned int &crate, unsigned int &rod, unsigned int &channel)
 Translate from MUR / module(1-6) number to p/k/r/c.
void translateToRROD (unsigned int MUR, unsigned int module, unsigned int &partition, unsigned int &crate, unsigned int &rod, unsigned int &channel)
 Translate from MUR / redundant module(1-6) number to p/k/r/c.
void translateToSN (unsigned int MUR, unsigned int module, std::string &sn)
 Translate from MUR / module(1-6) number to serial number.
void translateToBarrel (unsigned int MUR, unsigned int module, unsigned int &barrel, unsigned int &row, int &number)
 Translate from MUR / module(1-6) number to geographical barrel system.
void translateToEndcap (unsigned int MUR, unsigned int module, unsigned int &disk, unsigned int &ring, unsigned int &number)
 Translate from MUR / module(1-6) number to geographical endcap system.
void translateToPowerSupply (unsigned int MUR, unsigned int module, unsigned int &partition, unsigned int &crate, unsigned int &channel)
 Translate from MUR / module(1-6) number to power supply channel address.
void translateFromROD (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int channel, unsigned int &MUR, unsigned int &module)
 Translate to MUR / module(1-6) number from p/k/r/c.
void translateFromRROD (unsigned int partition, unsigned int crate, unsigned int rod, unsigned int channel, unsigned int &MUR, unsigned int &module)
 Translate to MUR / module(1-6) number from address of redundant module.
void translateFromSN (const std::string sn, unsigned int &MUR, unsigned int &module)
 Translate to MUR / module(1-6) number from serial number.
void translateFromBarrel (unsigned int barrel, unsigned int row, int number, unsigned int &MUR, unsigned int &module)
 Translate to MUR / module(1-6) number from geographical barrel system.
void translateFromEndcap (unsigned int disk, unsigned int ring, unsigned int number, unsigned int &MUR, unsigned int &module)
 Translate to MUR / module(1-6) number from geographical endcap system.
void translateFromPowerSupply (unsigned int partition, unsigned int crate, unsigned int channel, unsigned int &MUR, unsigned int &module)
 Translate from power supply channel address to MUR / module(1-6) number.
void configureModuleFromStructure (const std::string module, const ABCDModule conf)
 Update or add the configuration of a module stored in memory Replace the configuration for the given module with the data stored in the given configuration.
void configureModuleFromFile (const std::string filename)
 Update or add the configuration of a module stored in memory Replace the configuration for the given module with the data stored in the given file (the serial number is read from the file).
void configureROD (unsigned int partition, unsigned int crate, unsigned int rod, SctConfiguration::RodConfig conf)
 Configure a ROD.
void configureTIM (unsigned int partition, unsigned int crate, SctConfiguration::TimConfig conf)
 Configure a TIM.
void clearAll ()
 Remove all configuration.
void namePartition (int partition, const std::string name)
 Name a partition (for information, any use?).
void createPartition (int partition)
 Create a partition.
void createCrate (int partition, int crate)
 Create a crate.
void createROD (int partition, int crate, int rod, SctConfiguration::RodConfig conf)
 Create a ROD.
void createMUR (int partition, int crate, int rod, int order, int number)
 Create an MUR.
void createModule (int MUR, int order, int RMUR, int rorder, string number, const ABCDModule &mConf)
 Create a module.
void configureBOCChannel (int MUR, int position, const SctConfiguration::BOCChannelConfig &bConf)
 Set a BOC configuration.
void mapModuleMUR (int MUR, int order, int RMUR, int rorder, std::string number)
 Map a module (by serial number) onto a position in an MUR.
void mapRODMUR (int partition, int crate, int rod, int order, int number)
 Map an MUR.
void mapBarrelMUR (int MUR, int barrel, int row, int position)
 Map Barrel MUR.
void swapMURNames (int MUR1, int MUR2)
 Swap two MUR names around.
void mapEndcapMUR (int MUR, int disk, int quadrant, int position)
 Map Endcap MUR.
void mapPowerChannel (int MUR, int number, unsigned int partition, unsigned int crate, unsigned int channel)
 Map Power channel.
void modifyPowerParam (int MUR, int number, std::string name, float value)
 Set power supply parameter.
void modifyDefaultPowerParam (std::string name, float value)
 Set default power supply parameter.
float getPowerParam (int MUR, int number, std::string name)
 Get power supply parameter.
void loadConfiguration (const std::string &filename)
 Load configuration from named file.
void saveConfiguration (std::string filename="")
 Save the current configuration.
void saveModuleConfiguration (const std::string modsn, const std::string filename)
 Save the current configuration for a module.
std::string getModuleConfigurationString (const std::string modsn, const ABCDModule config)
 Construct the XML for a module configuration and return as a string.
void writePowerSupplyConfiguration (std::string filename)
 Dump power supply configuration to a file.

Private Member Functions

 OksImpl (const OksImpl &)
OksImploperator= (const OksImpl &)
OksObject * getPartition (unsigned int p)
OksObject * getCrate (unsigned int p, unsigned int c)
OksObject * getRod (unsigned int p, unsigned int c, unsigned int r)
OksObject * getMUR (unsigned int m)
OksObject * getModule (unsigned short mur, unsigned char position)
OksObject * getObjectFromRelationship (const OksObject *obj, const std::string rel)
unsigned long getULongData (const OksObject *obj, const std::string attr)
unsigned short getUShortData (const OksObject *obj, const std::string attr)
unsigned char getUCharData (const OksObject *obj, const std::string attr)
std::string getStringData (const OksObject *obj, const std::string attr)

Private Attributes

OksClass * partClass
OksClass * crateClass
OksClass * rodClass
OksClass * murClass
OksClass * moduleClass
OksKernel kernel

Detailed Description

Interface to XML configuration file.

This will be replaced by an interface to the DAQ confDB system.

The primary function of this class is the readout of configuration data from the database.

Translation functions:

Barrel barrel, row, number 3 to 6 0 to 55 -1 to -6 and 1 to 6

Internals: position on row given as -1 for -ve numbers and 1 for +ve numbers

Endcap disc quadrant number 0 to 17 0 to 3 0 to 33

Internals: position of MUR in quadrant number is left to right top to bottom 00000012222223 4444455555 1111133333

Definition at line 122 of file oksImpl.h.


Constructor & Destructor Documentation

OksImpl::OksImpl bool  readOnly = true  ) 
 

Initialise system.

OksImpl::~OksImpl  ) 
 

Free resources.


Member Function Documentation

void OksImpl::clearAll  )  [virtual]
 

Remove all configuration.

Very dangerous!!

Implements SctConfiguration::Configuration.

void OksImpl::configureBOCChannel int  MUR,
int  position,
const SctConfiguration::BOCChannelConfig bConf
 

Set a BOC configuration.

void OksImpl::configureModuleFromFile const std::string  filename  )  [virtual]
 

Update or add the configuration of a module stored in memory Replace the configuration for the given module with the data stored in the given file (the serial number is read from the file).

Implements SctConfiguration::Configuration.

void OksImpl::configureModuleFromStructure const std::string  module,
const ABCDModule  conf
[virtual]
 

Update or add the configuration of a module stored in memory Replace the configuration for the given module with the data stored in the given configuration.

Implements SctConfiguration::Configuration.

void OksImpl::configureROD unsigned int  partition,
unsigned int  crate,
unsigned int  rod,
SctConfiguration::RodConfig  conf
[virtual]
 

Configure a ROD.

Replace the in memory configuration for the given ROD with the configuration provided.

If no configuration then construct it

Implements SctConfiguration::Configuration.

void OksImpl::configureTIM unsigned int  partition,
unsigned int  crate,
SctConfiguration::TimConfig  conf
[virtual]
 

Configure a TIM.

Replace the in memory configuration for the given TIM with the configuration provided.

If no configuration then construct it

Implements SctConfiguration::Configuration.

void OksImpl::createCrate int  partition,
int  crate
 

Create a crate.

void OksImpl::createModule int  MUR,
int  order,
int  RMUR,
int  rorder,
string  number,
const ABCDModule &  mConf
 

Create a module.

void OksImpl::createMUR int  partition,
int  crate,
int  rod,
int  order,
int  number
 

Create an MUR.

void OksImpl::createPartition int  partition  ) 
 

Create a partition.

void OksImpl::createROD int  partition,
int  crate,
int  rod,
SctConfiguration::RodConfig  conf
 

Create a ROD.

SctConfiguration::BOCChannelConfig OksImpl::getBOCConfig unsigned int  partition,
unsigned int  crate,
unsigned int  rod,
unsigned int  channel
[virtual]
 

Get the BOC configuration of one of 48 channels.

Input channels are paired as one.

Implements SctConfiguration::Configuration.

char* OksImpl::getFibreMappings unsigned int  partition,
unsigned int  crate,
unsigned int  rod
[virtual]
 

Get the BOC fibre mappings.

An array of 48*3 chars (out, in0, in1)

Implements SctConfiguration::Configuration.

ABCDModule OksImpl::getModuleConfig const std::string  module  )  [virtual]
 

Return the configuration for the module.

Deprecated: Should take MUR argument

Implements SctConfiguration::Configuration.

std::string OksImpl::getModuleConfigurationString const std::string  modsn,
const ABCDModule  config
[virtual]
 

Construct the XML for a module configuration and return as a string.

Implements SctConfiguration::Configuration.

float OksImpl::getPowerParam int  MUR,
int  number,
std::string  name
 

Get power supply parameter.

SctConfiguration::RodConfig OksImpl::getRodConfig unsigned int  partition,
unsigned int  crate,
unsigned int  rod
[virtual]
 

Return the Rod configuration Find the configuration associated with the specified ROD.

Return a RodConfig structure.

Implements SctConfiguration::Configuration.

SctConfiguration::TimConfig OksImpl::getTimConfig unsigned int  partition,
unsigned int  crate
[virtual]
 

Return the TIM configuration Find the configuration associated with the specified TIM.

Return a TimConfig structure.

Implements SctConfiguration::Configuration.

std::list<std::string> OksImpl::listAllModules  )  [virtual]
 

Return a list of serial numbers of all modules that have configuration.

This includes those that are not attached to a ROD or MUR

Implements SctConfiguration::Configuration.

std::list<unsigned int> OksImpl::listCratesInPartition unsigned int  partition  )  [virtual]
 

List crate ids with reference to the given partition Lookup the crates defined in the specified partition and return a list of integer ID's.

Implements SctConfiguration::Configuration.

std::list<std::string> OksImpl::listModulesInMUR unsigned int  partition,
unsigned int  MUR
[virtual]
 

List the modules in the given MUR Return a list of serial numbers associated with the specified MUR.

FIXME: Should be in numbered order

Implements SctConfiguration::Configuration.

std::list<unsigned int> OksImpl::listMURSInRod unsigned int  partition,
unsigned int  crate,
unsigned int  rod
[virtual]
 

List the MURs associated with a ROD Return integer id's of the MURs in the specified rod.

FIXME: Should be in numbered order

Implements SctConfiguration::Configuration.

std::list<unsigned int> OksImpl::listPartitions  )  [virtual]
 

List partition ids Lookup the partitions defined in the configuration and return a list of integer ID's.

Implements SctConfiguration::Configuration.

std::list<std::string> OksImpl::listRModulesInMUR unsigned int  partition,
unsigned int  MUR
[virtual]
 

List the modules in the given MUR Return a list of serial numbers associated with the redundancy links of the specified MUR.

FIXME: Should be in numbered order (array?)

Implements SctConfiguration::Configuration.

std::list<unsigned int> OksImpl::listRodsInCrate unsigned int  partition,
unsigned int  crate
[virtual]
 

List the rods present in a crate Lookup the RODs defined in the specified crate and return a list of integer ID's.

Implements SctConfiguration::Configuration.

std::list<std::string> OksImpl::listUnusedModules  )  [virtual]
 

Return a list of serial numbers of modules that have configuration but are not attached to an MUR.

Implements SctConfiguration::Configuration.

void OksImpl::loadConfiguration const std::string &  filename  )  [virtual]
 

Load configuration from named file.

Implements SctConfiguration::Configuration.

void OksImpl::mapBarrelMUR int  MUR,
int  barrel,
int  row,
int  position
 

Map Barrel MUR.

void OksImpl::mapEndcapMUR int  MUR,
int  disk,
int  quadrant,
int  position
 

Map Endcap MUR.

void OksImpl::mapModuleMUR int  MUR,
int  order,
int  RMUR,
int  rorder,
std::string  number
 

Map a module (by serial number) onto a position in an MUR.

void OksImpl::mapPowerChannel int  MUR,
int  number,
unsigned int  partition,
unsigned int  crate,
unsigned int  channel
 

Map Power channel.

void OksImpl::mapRODMUR int  partition,
int  crate,
int  rod,
int  order,
int  number
 

Map an MUR.

void OksImpl::modifyDefaultPowerParam std::string  name,
float  value
 

Set default power supply parameter.

void OksImpl::modifyPowerParam int  MUR,
int  number,
std::string  name,
float  value
 

Set power supply parameter.

void OksImpl::namePartition int  partition,
const std::string  name
 

Name a partition (for information, any use?).

void OksImpl::printModuleConfig const ABCDModule &  conf  )  [virtual]
 

Print module configuration to cout.

Implements SctConfiguration::Configuration.

void OksImpl::saveConfiguration std::string  filename = ""  )  [virtual]
 

Save the current configuration.

Write configuration to disc. This creates a unique filename based on the date and time and saves the current configuration to it.

Filename eg Conf_dump_20021210142311.xml.gz (in current directory)

Implements SctConfiguration::Configuration.

void OksImpl::saveModuleConfiguration const std::string  modsn,
const std::string  filename
[virtual]
 

Save the current configuration for a module.

Write the configuration for the module modsn to disc.

Implements SctConfiguration::Configuration.

void OksImpl::setFibreMapping unsigned int  partition,
unsigned int  crate,
unsigned int  rod,
unsigned int  channel,
unsigned int  tx,
unsigned int  rx0,
unsigned int  rx1
[virtual]
 

Set fibre mappings for one channel.

Any value over 48/96 leaves current value unchanged

Implements SctConfiguration::Configuration.

void OksImpl::swapMURNames int  MUR1,
int  MUR2
 

Swap two MUR names around.

This means in regards to everything about one MUR you can use the other name If either doesn't exist then just one MUR is renamed

void OksImpl::translateFromBarrel unsigned int  barrel,
unsigned int  row,
int  number,
unsigned int &  MUR,
unsigned int &  module
[virtual]
 

Translate to MUR / module(1-6) number from geographical barrel system.

Implements SctConfiguration::Configuration.

void OksImpl::translateFromEndcap unsigned int  disk,
unsigned int  ring,
unsigned int  number,
unsigned int &  MUR,
unsigned int &  module
 

Translate to MUR / module(1-6) number from geographical endcap system.

void OksImpl::translateFromPowerSupply unsigned int  partition,
unsigned int  crate,
unsigned int  channel,
unsigned int &  MUR,
unsigned int &  module
[virtual]
 

Translate from power supply channel address to MUR / module(1-6) number.

Implements SctConfiguration::Configuration.

void OksImpl::translateFromROD unsigned int  partition,
unsigned int  crate,
unsigned int  rod,
unsigned int  channel,
unsigned int &  MUR,
unsigned int &  module
[virtual]
 

Translate to MUR / module(1-6) number from p/k/r/c.

Implements SctConfiguration::Configuration.

void OksImpl::translateFromRROD unsigned int  partition,
unsigned int  crate,
unsigned int  rod,
unsigned int  channel,
unsigned int &  MUR,
unsigned int &  module
[virtual]
 

Translate to MUR / module(1-6) number from address of redundant module.

This returns the MUR/module of the module connected using its redundant link to the p/k/r/c address

Implements SctConfiguration::Configuration.

void OksImpl::translateFromSN const std::string  sn,
unsigned int &  MUR,
unsigned int &  module
[virtual]
 

Translate to MUR / module(1-6) number from serial number.

Implements SctConfiguration::Configuration.

void OksImpl::translateToBarrel unsigned int  MUR,
unsigned int  module,
unsigned int &  barrel,
unsigned int &  row,
int &  number
[virtual]
 

Translate from MUR / module(1-6) number to geographical barrel system.

Implements SctConfiguration::Configuration.

void OksImpl::translateToEndcap unsigned int  MUR,
unsigned int  module,
unsigned int &  disk,
unsigned int &  ring,
unsigned int &  number
 

Translate from MUR / module(1-6) number to geographical endcap system.

void OksImpl::translateToPowerSupply unsigned int  MUR,
unsigned int  module,
unsigned int &  partition,
unsigned int &  crate,
unsigned int &  channel
[virtual]
 

Translate from MUR / module(1-6) number to power supply channel address.

Implements SctConfiguration::Configuration.

void OksImpl::translateToROD unsigned int  MUR,
unsigned int  module,
unsigned int &  partition,
unsigned int &  crate,
unsigned int &  rod,
unsigned int &  channel
[virtual]
 

Translate from MUR / module(1-6) number to p/k/r/c.

Implements SctConfiguration::Configuration.

void OksImpl::translateToRROD unsigned int  MUR,
unsigned int  module,
unsigned int &  partition,
unsigned int &  crate,
unsigned int &  rod,
unsigned int &  channel
[virtual]
 

Translate from MUR / redundant module(1-6) number to p/k/r/c.

Implements SctConfiguration::Configuration.

void OksImpl::translateToSN unsigned int  MUR,
unsigned int  module,
std::string &  sn
[virtual]
 

Translate from MUR / module(1-6) number to serial number.

Implements SctConfiguration::Configuration.

void OksImpl::writePowerSupplyConfiguration std::string  filename  )  [virtual]
 

Dump power supply configuration to a file.

Implements SctConfiguration::Configuration.


The documentation for this class was generated from the following file:
Generated on Mon Feb 6 14:01:57 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6