The FEE Server Control Engine of the ALICE-TRD - Westfälische ...
The FEE Server Control Engine of the ALICE-TRD - Westfälische ...
The FEE Server Control Engine of the ALICE-TRD - Westfälische ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
5 <strong>The</strong> <strong>FEE</strong><strong>Server</strong> <strong>Control</strong> <strong>Engine</strong><br />
a test, string triggerTransition (char * ) calls <strong>the</strong> function ROC<strong>Control</strong>::parseCompleteHeader<br />
(cfdat_header * header) first. This function configures <strong>the</strong> complete control engine. It extracts<br />
<strong>the</strong> <strong>of</strong>fsets to three <strong>of</strong> <strong>the</strong> four sections in <strong>the</strong> configuration and calls <strong>the</strong> functions<br />
which process <strong>the</strong> information in <strong>the</strong>se sections:<br />
• <strong>The</strong> cfdat_error_header is passed to patch_maker. Based on <strong>the</strong>se data <strong>the</strong> patchmaker<br />
creates <strong>the</strong> necessary SCSN commands which cause <strong>the</strong> MCMs to deactivate<br />
<strong>the</strong>ir damaged parts. Fur<strong>the</strong>rmore it creates a list <strong>of</strong> damaged MCMs which <strong>the</strong><br />
class SCSNBus uses to bridge <strong>the</strong> linkpairs if necessary.<br />
• <strong>The</strong> rocinfo_header is passed to class ROCInfo. ROCInfo stores <strong>the</strong> general chamber<br />
informations and provides get-functions to access this information. For example <strong>the</strong><br />
function ROCInfo::getRocType() returns <strong>the</strong> roc type or ROCInfo::getNLinks() returns<br />
<strong>the</strong> number <strong>of</strong> linkpairs.<br />
• <strong>The</strong> cfdat_temp_calib is passed to class Temp<strong>Control</strong>. Since no calibration values are<br />
available yet cfdat_temp_calib is set to zero and <strong>the</strong> data are not processed fur<strong>the</strong>r.<br />
In case <strong>of</strong> any valid transition string CEStateMachine::triggerTransition(char * ) calls void<br />
ROC<strong>Control</strong>::execCommands(cfdat_header * header). <strong>The</strong> function checks if <strong>the</strong> version <strong>of</strong><br />
<strong>the</strong> configuration is compatible with <strong>the</strong> version <strong>of</strong> <strong>the</strong> control engine, writes <strong>the</strong> name<br />
<strong>of</strong> <strong>the</strong> configuration to <strong>the</strong> logging system and extracts <strong>the</strong> list <strong>of</strong> SCSN commands. <strong>The</strong><br />
list <strong>of</strong> commands is passed to void ROCExecutor::execute(cfdat_command * cmds, unsigned<br />
int n_cmd).<br />
<strong>The</strong> class ROCExecutor handles <strong>the</strong> execution <strong>of</strong> all SCSN commands. It is derived from<br />
class SCSNBus. <strong>The</strong> function void ROC<strong>Control</strong>::execute(cfdat_command * cmds, unsigned int<br />
n_cmd) loops over <strong>the</strong> list <strong>of</strong> SCSN commands. Blocks <strong>of</strong> normal SCSN commands 3 are<br />
passed to <strong>the</strong> inherited function void execute(cfdat_command * cmds, unsigned int n_cmd)<br />
<strong>of</strong> class SCSNBus. Extended SCSN commands are handled by private functions <strong>of</strong><br />
ROCExecutor. Table B.1 in <strong>the</strong> appendix gives an overview over all defined extended<br />
SCSN commands. After <strong>the</strong> list <strong>of</strong> SCSN commands is processed successfully <strong>the</strong> control<br />
flow returns to function string CEStateMachine::triggerTransition(char * ). <strong>The</strong> function updates<br />
<strong>the</strong> FSM state and unlocks <strong>the</strong> mutex. Afterwards <strong>the</strong> system is ready to process<br />
<strong>the</strong> next transition request.<br />
In case <strong>of</strong> an extended SCSN command, like <strong>the</strong> command to run tests, it is possible<br />
that <strong>the</strong> function called to handle this command creates a list <strong>of</strong> SCSN commands which<br />
need to be executed. Usually one would create just a new instance <strong>of</strong> class ROCExecutor<br />
and use this new instance to execute <strong>the</strong> commands. But in case <strong>of</strong> <strong>the</strong> control engine this<br />
class and some o<strong>the</strong>r classes store configuration values and cannot be re-created when an<br />
instance <strong>of</strong> <strong>the</strong>se classes is needed. Fur<strong>the</strong>rmore, classes developed for <strong>the</strong> lib<strong>TRD</strong> use<br />
<strong>the</strong> class SCSNBus from lib<strong>TRD</strong> to access <strong>the</strong> SCSN Bus but in <strong>the</strong> control engine <strong>the</strong> SCSN<br />
Bus access is provided by ROCExecutor. All classes from lib<strong>TRD</strong> should automatically use<br />
ROCExecutor when running in <strong>the</strong> control engine.<br />
To meet all <strong>the</strong>se requirements a pair <strong>of</strong> classes was developed by Thomas Dietel:<br />
trd_factory for <strong>the</strong> lib<strong>TRD</strong> and <strong>TRD</strong>CEFactory for <strong>the</strong> libce. Both classes are designed as<br />
singleton classes 4 [GHJV94].<br />
3 Commands with a number less <strong>the</strong>n 16, see table B.1.<br />
4 A singleton class has some properties <strong>of</strong> a global variable. During runtime only one instance <strong>of</strong> <strong>the</strong> class<br />
can exist and this instance is accessible from every part <strong>of</strong> <strong>the</strong> program.<br />
57