RcuConf::Configurator Class Reference
[Steering classes]

#include <Configurator.h>


Detailed Description

Class to call Rcuxx::Rcu API to do configuration. The actual values is obtained from the database connection.

Definition at line 67 of file Configurator.h.

Public Member Functions

 Configurator (RcuDb::Server &server, Rcu &rcu, Bc &bc, Altro &altro)
virtual ~Configurator ()
virtual int Write (int tag, int x, int y, int z)
const std::string & ErrorString () const
RcuRCU ()
BcBC ()
AltroALTRO ()
void SetDebug (bool use=true)

Protected Member Functions

virtual bool GetCurrent (int tag, int x, int y, int z)
virtual bool GetOrder ()
virtual bool GetParams ()
virtual bool Write (Component &c, Parameter &p)
virtual bool CheckWrite (int ret, const std::string &name, int addr)

Protected Attributes

RcuDb::Server & fServer
RcufRcu
BcfBc
AltrofAltro
std::string fErrorString
ConfigfCurrent
PriorityfOrder
Parameter::List fParams
bool fDebug


Constructor & Destructor Documentation

RcuConf::Configurator::Configurator RcuDb::Server &  server,
Rcu rcu,
Bc bc,
Altro altro
 

Constructor.

Parameters:
rcu Connection to RCU
bc Connection to BC
altro Connection to ALTRO
server Connection to database

Definition at line 43 of file Configurator.cxx.

virtual RcuConf::Configurator::~Configurator  )  [inline, virtual]
 

Destructor.

Definition at line 80 of file Configurator.h.


Member Function Documentation

Altro& RcuConf::Configurator::ALTRO  )  [inline]
 

Returns:
Reference to the ALTRO component

Definition at line 102 of file Configurator.h.

References fAltro.

Bc& RcuConf::Configurator::BC  )  [inline]
 

Returns:
Reference to the BC component

Definition at line 100 of file Configurator.h.

References fBc.

bool RcuConf::Configurator::CheckWrite int  ret,
const std::string &  name,
int  addr
[protected, virtual]
 

Check that write worked.

Parameters:
ret Return value from write
name Name of parameter
addr Address used
Returns:
true on success, false otherwise

Definition at line 223 of file Configurator.cxx.

References RcuConf::Rcu::ErrorString(), fDebug, fErrorString, and fRcu.

Referenced by Write().

const std::string& RcuConf::Configurator::ErrorString  )  const [inline]
 

Get the last error string.

Returns:
The last error string

Definition at line 96 of file Configurator.h.

References fErrorString.

Referenced by RcuConf::CommandCoder::createDataBlock().

bool RcuConf::Configurator::GetCurrent int  tag,
int  x,
int  y,
int  z
[protected, virtual]
 

Get the configuration.

Definition at line 99 of file Configurator.cxx.

References fCurrent, fDebug, fErrorString, fServer, RcuConf::Config::List, and RcuConf::Config::Print().

Referenced by Write().

bool RcuConf::Configurator::GetOrder  )  [protected, virtual]
 

Get the order.

Definition at line 151 of file Configurator.cxx.

References fCurrent, fDebug, fErrorString, fOrder, fServer, RcuConf::Table::Id(), RcuConf::Priority::List, and RcuConf::Priority::Print().

Referenced by Write().

bool RcuConf::Configurator::GetParams  )  [protected, virtual]
 

Get the params.

Definition at line 196 of file Configurator.cxx.

References fErrorString, fOrder, fParams, fServer, and RcuConf::Priority::Params().

Referenced by Write().

Rcu& RcuConf::Configurator::RCU  )  [inline]
 

Returns:
Reference to the RCU component

Definition at line 98 of file Configurator.h.

References fRcu.

Referenced by RcuConf::CommandCoder::getDataBlock().

void RcuConf::Configurator::SetDebug bool  use = true  )  [inline]
 

Set debug mode.

Parameters:
use If true, output debug messages

Definition at line 105 of file Configurator.h.

References fDebug.

Referenced by RcuConf::CommandCoder::init().

bool RcuConf::Configurator::Write Component c,
Parameter p
[protected, virtual]
 

Write a parameter.

Definition at line 260 of file Configurator.cxx.

References CheckWrite(), fCurrent, fErrorString, fServer, RcuConf::Table::Id(), RcuConf::Parameter::IsBlob(), RcuConf::Address::List, RcuConf::Value::List, RcuConf::Parameter::Name(), RcuConf::Address::RawValue(), and RcuConf::Component::Write().

int RcuConf::Configurator::Write int  tag,
int  x,
int  y,
int  z
[virtual]
 

Write to the hardware via the RCU interface.

Parameters:
tag Configuration tag
x X coordinate
y Y coordinate
z Z coordinate
Returns:
number of words written to block, or 0. Negative values indicate errors.

Definition at line 59 of file Configurator.cxx.

References RcuConf::Rcu::EndBlock(), fAltro, fBc, fDebug, fErrorString, fParams, fRcu, GetCurrent(), GetOrder(), GetParams(), and RcuConf::Rcu::StartBlock().

Referenced by RcuConf::CommandCoder::createDataBlock().


Field Documentation

Altro& RcuConf::Configurator::fAltro [protected]
 

Connection to ALTRO.

Definition at line 129 of file Configurator.h.

Referenced by ALTRO(), and Write().

Bc& RcuConf::Configurator::fBc [protected]
 

Connection to BC.

Definition at line 127 of file Configurator.h.

Referenced by BC(), and Write().

Config* RcuConf::Configurator::fCurrent [protected]
 

The current configuration.

Definition at line 133 of file Configurator.h.

Referenced by GetCurrent(), GetOrder(), and Write().

bool RcuConf::Configurator::fDebug [protected]
 

Debug flag.

Definition at line 139 of file Configurator.h.

Referenced by CheckWrite(), GetCurrent(), GetOrder(), SetDebug(), and Write().

std::string RcuConf::Configurator::fErrorString [protected]
 

Last error message.

Definition at line 131 of file Configurator.h.

Referenced by CheckWrite(), ErrorString(), GetCurrent(), GetOrder(), GetParams(), and Write().

Priority* RcuConf::Configurator::fOrder [protected]
 

The current order of parameters.

Definition at line 135 of file Configurator.h.

Referenced by GetOrder(), and GetParams().

Parameter::List RcuConf::Configurator::fParams [protected]
 

The current list of parameters.

Definition at line 137 of file Configurator.h.

Referenced by GetParams(), and Write().

Rcu& RcuConf::Configurator::fRcu [protected]
 

Connection to RCU.

Definition at line 125 of file Configurator.h.

Referenced by CheckWrite(), RCU(), and Write().

RcuDb::Server& RcuConf::Configurator::fServer [protected]
 

Connection to database.

Definition at line 123 of file Configurator.h.

Referenced by GetCurrent(), GetOrder(), GetParams(), and Write().


The documentation for this class was generated from the following files:
Top of page Last update Fri Apr 27 01:54:16 2007
Copyright © 2004 Christian Holm Created by DoxyGen 1.3.5