DABC (Data Acquisition Backbone Core)
2.9.9
|
Parameter class More...
#include <dabc/Parameter.h>
Public Member Functions | |
bool | Dflt (const RecordField &v) |
Set default parameter value. More... | |
Parameter & | DisableAverage () |
Disables averaging functionality. More... | |
Parameter & | DisableRatemeter () |
Disable ratemeter functionality. More... | |
void | FireModified () |
Can be called by user to signal framework that parameter was modified. More... | |
const std::string | GetActualUnits () const |
Return actual units of parameter value, taking into account rate (1/s) unit when enabled. More... | |
int | GetDebugLevel () const |
double | GetLowerLimit () const |
const std::string | GetUnits () const |
Return units of parameter value. More... | |
double | GetUpperLimit () const |
Reference | GetWorker () const |
Returns reference on the worker. More... | |
bool | IsAverage () const |
Returns true if average calculation is active. More... | |
bool | IsMonitored () |
Returns true when parameter event should be delivered to the worker. More... | |
bool | IsRatemeter () const |
Returns true if rate measurement is activated. More... | |
const std::string | Kind () const |
bool | NeedTimeout () |
Returns true if parameter object requires timeout processing. More... | |
void | ScanParamFields (RecordFieldsMap *cont) |
Parameter & | SetAverage (bool synchron=false, double interval=1.0) |
Converts parameter in statistic variable. More... | |
Parameter & | SetDebugLevel (int level=1) |
Parameter & | SetDebugOutput (bool on=true, int level=1) |
Enable/disable debug output when parameter value is changed. More... | |
Parameter & | SetFld (const std::string &name, const RecordField &v) |
Parameter & | SetLimits (double low, double up) |
void | SetLowerLimit (double low) |
Parameter & | SetMonitored (bool on=true) |
Specify if parameter event should be delivered to the worker. More... | |
Parameter & | SetRatemeter (bool synchron=false, double interval=1.0) |
Converts parameter in ratemeter - all values will be summed up and divided on specified interval. More... | |
Parameter & | SetSynchron (bool on, double interval=1., bool everyevnt=false) |
Indicate if parameter is should generate events synchron with code which modified it. More... | |
Parameter & | SetUnits (const std::string &unit) |
Set units field of parameter. More... | |
void | SetUpperLimit (double up) |
bool | SetValue (const RecordField &v) |
Set parameter value. More... | |
Parameter & | SetWidthPrecision (unsigned width, unsigned prec) |
Set parameter to convert double values to the string - used for ratemeter. More... | |
bool | SubmitSetValue (const RecordField &v) |
RecordField | Value () const |
Returns parameter value. More... | |
Public Member Functions inherited from dabc::Reference | |
bool | AddChild (Object *obj) |
Add child to list of object children. More... | |
const char * | ClassName () const |
Return class name of referenced object, if object not assigned, returns "---". More... | |
void | Destroy () throw () |
Release reference and starts destroyment of referenced object. More... | |
Reference | FindChild (const char *name) const |
Searches for child in referenced object. More... | |
bool | GetAllChildRef (ReferencesVector *vect) const |
Return references for all childs. More... | |
Reference | GetChild (unsigned n) const |
Return reference on child n. More... | |
Reference | GetFolder (const std::string &name, bool force=false) throw () |
Return folder of specified name, no special symbols are allowed. More... | |
const char * | GetName () const |
Return name of referenced object, if object not assigned, returns "---". More... | |
Object * | GetObject () const |
Return pointer on the object. More... | |
Object * | GetParent () const |
Returns pointer on parent object. More... | |
Reference | GetParentRef () const |
Returns reference on parent object. More... | |
bool | IsName (const char *name) const |
Returns true if object name is the same as specified one. More... | |
std::string | ItemName (bool compact=true) const |
Produce string, which can be used as name argument in dabc::mgr.FindItem(name) call. More... | |
bool | null () const |
Returns true if reference contains nullptr. More... | |
unsigned | NumChilds () const |
Return number of childs in referenced object. More... | |
unsigned | NumReferences () const |
Returns number of references on the object. More... | |
bool | operator! () const |
Returns true if reference contains nullptr. More... | |
bool | operator!= (const Reference &src) const |
Compare operator - return true if references refer to different object. More... | |
bool | operator!= (Object *obj) const |
Compare operator - return true if reference refer to different objects. More... | |
Object * | operator() () const |
Return pointer on the object. More... | |
Reference & | operator<< (Reference &src) throw () |
Move operator - reference moved from source to target. More... | |
Reference & | operator= (const Reference &src) throw () |
Assignment operator - copy reference. More... | |
Reference & | operator= (Object *obj) throw () |
Assignment operator - copy reference. More... | |
bool | operator== (const Reference &src) const |
Compare operator - return true if references refer to same object. More... | |
bool | operator== (Object *obj) const |
Compare operator - return true if reference refer to same object. More... | |
void | Print (int lvl=0, const char *from=0) const |
Show on debug output content of reference. More... | |
Reference (const Reference &src) throw () | |
Copy constructor, if source is transient than source reference will be emptied. More... | |
Reference (Object *obj=nullptr) | |
Constructor, creates reference on the object. More... | |
std::string | RelativeName (const dabc::Reference &topitem) |
Produce name, which can be used to find item, calling topitem.FindChild(). More... | |
void | Release () throw () |
Releases reference on the object. More... | |
bool | RemoveChild (const char *name, bool cleanup=true) |
Remove child with given name and return reference on that child. More... | |
bool | RemoveChilds (bool cleanup=true) |
Remove all childs in referenced object If cleanup true (default) and object is owner, all objects will be destroyed. More... | |
void | SetAutoDestroy (bool on=true) |
Set autodestroy flag for the object Once enabled, object will be destroyed when last reference will be cleared. More... | |
void | SetObject (Object *obj, bool withmutex=true) |
Direct set of object to reference. More... | |
Reference | Take () |
Copy reference to output object. More... | |
virtual | ~Reference () |
Destructor, releases reference on the object. More... | |
Protected Member Functions | |
int | ExecuteChange (Command cmd) |
Specifies that parameter produce 'modified' events synchronous with changes of parameter. More... | |
void | FireConfigured () |
Fire parConfigured event for parameter. More... | |
virtual const char * | ParReferenceKind () |
bool | TakeAttrModified () |
Returns true if any parameter attribute was modified since last call to this method. More... | |
template<class T > | |
bool | verify_object (Object *src, T *&tgt) |
Method used in reference constructor/assignments to verify is object is suitable. More... | |
Protected Member Functions inherited from dabc::Reference | |
bool | AcquireRefWithoutMutex (Reference &ref) |
Special method, which allows to generate new reference when object mutex is locked. More... | |
void | Assign (const Reference &src) |
Method used in copy constructor and assigned operations. More... | |
Mutex * | ObjectMutex () const |
template<class T > | |
bool | verify_object (Object *src, T *&tgt) |
Method used in reference constructor/assignments to verify is object is suitable. More... | |
Friends | |
class | Manager |
class | Worker |
Additional Inherited Members | |
Protected Attributes inherited from dabc::Reference | |
Object * | fObj |
pointer on the object More... | |
Parameter class
Allows to define parameter object in dabc::Worker Can deliver events, which can be monitored by any external instances. Main component for implementing interface to slow-control
Definition at line 163 of file Parameter.h.
|
inlineprotectedvirtual |
Reimplemented in dabc::InfoParameter, and dabc::ConnectionRequest.
Definition at line 170 of file Parameter.h.
|
protected |
Specifies that parameter produce 'modified' events synchronous with changes of parameter.
If on=false (asynchronous), events are produced by timeout from manager (with granularity of 1 sec). Interval specifies how often event should be produced - if 0 specified every parameter change will call parameter modified event.
Definition at line 508 of file Parameter.cxx.
|
protected |
Returns true if any parameter attribute was modified since last call to this method.
Definition at line 346 of file Parameter.cxx.
|
protected |
Fire parConfigured event for parameter.
Definition at line 550 of file Parameter.cxx.
|
inlineprotected |
Method used in reference constructor/assignments to verify is object is suitable.
Definition at line 187 of file Parameter.h.
|
inline |
Returns parameter value.
Definition at line 202 of file Parameter.h.
|
inline |
Set parameter value.
Definition at line 205 of file Parameter.h.
|
inline |
Set default parameter value.
Only applied in parameter if parameter value was not specified before
Definition at line 209 of file Parameter.h.
bool dabc::Parameter::NeedTimeout | ( | ) |
Returns true if parameter object requires timeout processing.
Definition at line 339 of file Parameter.cxx.
bool dabc::Parameter::IsMonitored | ( | ) |
Returns true when parameter event should be delivered to the worker.
Definition at line 515 of file Parameter.cxx.
dabc::Reference dabc::Parameter::GetWorker | ( | ) | const |
Returns reference on the worker.
Definition at line 502 of file Parameter.cxx.
dabc::Parameter & dabc::Parameter::SetSynchron | ( | bool | on, |
double | interval = 1. , |
||
bool | everyevnt = false |
||
) |
Indicate if parameter is should generate events synchron with code which modified it.
Definition at line 491 of file Parameter.cxx.
dabc::Parameter & dabc::Parameter::SetRatemeter | ( | bool | synchron = false , |
double | interval = 1.0 |
||
) |
Converts parameter in ratemeter - all values will be summed up and divided on specified interval.
Result value will have units/second dimension
Definition at line 365 of file Parameter.cxx.
bool dabc::Parameter::IsRatemeter | ( | ) | const |
Returns true if rate measurement is activated.
Definition at line 411 of file Parameter.cxx.
dabc::Parameter & dabc::Parameter::DisableRatemeter | ( | ) |
Disable ratemeter functionality.
Definition at line 394 of file Parameter.cxx.
dabc::Parameter & dabc::Parameter::SetAverage | ( | bool | synchron = false , |
double | interval = 1.0 |
||
) |
Converts parameter in statistic variable.
All values will be summed up and average over interval will be calculated. Result will have units of original variable
Definition at line 434 of file Parameter.cxx.
dabc::Parameter & dabc::Parameter::DisableAverage | ( | ) |
Disables averaging functionality.
Definition at line 462 of file Parameter.cxx.
bool dabc::Parameter::IsAverage | ( | ) | const |
Returns true if average calculation is active.
Definition at line 481 of file Parameter.cxx.
dabc::Parameter & dabc::Parameter::SetMonitored | ( | bool | on = true | ) |
Specify if parameter event should be delivered to the worker.
Definition at line 524 of file Parameter.cxx.
|
inline |
Enable/disable debug output when parameter value is changed.
Definition at line 248 of file Parameter.h.
|
inline |
Definition at line 249 of file Parameter.h.
int dabc::Parameter::GetDebugLevel | ( | ) | const |
Definition at line 360 of file Parameter.cxx.
dabc::Parameter & dabc::Parameter::SetWidthPrecision | ( | unsigned | width, |
unsigned | prec | ||
) |
Set parameter to convert double values to the string - used for ratemeter.
Definition at line 420 of file Parameter.cxx.
|
inline |
Set units field of parameter.
Definition at line 256 of file Parameter.h.
|
inline |
Return units of parameter value.
Definition at line 259 of file Parameter.h.
const std::string dabc::Parameter::GetActualUnits | ( | ) | const |
Return actual units of parameter value, taking into account rate (1/s) unit when enabled.
Definition at line 543 of file Parameter.cxx.
|
inline |
Definition at line 264 of file Parameter.h.
|
inline |
Definition at line 265 of file Parameter.h.
|
inline |
Definition at line 267 of file Parameter.h.
|
inline |
Definition at line 268 of file Parameter.h.
|
inline |
Definition at line 270 of file Parameter.h.
|
inline |
Definition at line 272 of file Parameter.h.
const std::string dabc::Parameter::Kind | ( | ) | const |
Definition at line 536 of file Parameter.cxx.
void dabc::Parameter::FireModified | ( | ) |
Can be called by user to signal framework that parameter was modified.
Normally happens automatically or by time interval, but with synchronous parameter last update may be lost.
Definition at line 555 of file Parameter.cxx.
|
inline |
Definition at line 281 of file Parameter.h.
bool dabc::Parameter::SubmitSetValue | ( | const RecordField & | v | ) |
Definition at line 561 of file Parameter.cxx.
|
friend |
Definition at line 165 of file Parameter.h.
|
friend |
Definition at line 166 of file Parameter.h.