CFEL - ASG Software Suite
2.5.0
CASS
|
Converter for Beamline-, Cavity-, Epics- and EVR Data. More...
#include <machine_converter.h>
Public Member Functions | |
void | operator() (const Pds::Xtc *xtc, cass::CASSEvent *evt) |
called for appropriate xtc part. More... | |
void | prepare (CASSEvent *evt) |
called before the conversion More... | |
void | finalize (CASSEvent *evt) |
called at the end of the conversion More... | |
![]() | |
virtual | ~ConversionBackend () |
virtual destructor to make clear this is a base class More... | |
const pdstypelist_t & | pdsTypeList () const |
return the list of pds type ids the converter is responsible for More... | |
Static Public Member Functions | |
static ConversionBackend::shared_pointer | instance () |
create singleton if doesnt exist already More... | |
![]() | |
static shared_pointer | instance (const std::string &type) |
return the requested converter type More... | |
Private Types | |
typedef std::map< XTCDataKey, std::string > | KeyMap_t |
define the conversion map from keys to strings More... | |
typedef std::tr1::function< void(const Pds::EpicsPvHeader &, Device::epicsDataMap_t::iterator, Device::epicsDataMap_t::iterator)> | epicsType2val_t |
define the function to convert epics to cass More... | |
typedef std::map< int16_t, epicsType2val_t > | epicsType2convFunc_t |
define a map to map epics type to function for retrieval of the value More... | |
Private Member Functions | |
Converter () | |
constructor More... | |
Converter (const Converter &) | |
prevent copy construction More... | |
Converter & | operator= (const Converter &) |
prevent assignment More... | |
Private Attributes | |
KeyMap_t | _index2name |
map Epics Keys to strings More... | |
epicsType2convFunc_t | _epicsType2convFunc |
map containing fucntions that convert epics values to cass values More... | |
Device | _store |
a container for the epics values More... | |
Static Private Attributes | |
static ConversionBackend::shared_pointer | _instance |
the singleton container More... | |
static QMutex | _mutex |
singleton locker for mutithreaded requests More... | |
Additional Inherited Members | |
![]() | |
typedef std::tr1::shared_ptr< ConversionBackend > | shared_pointer |
typedef More... | |
typedef std::list< Pds::TypeId::Type > | pdstypelist_t |
typedef More... | |
![]() | |
pdstypelist_t | _pdsTypeList |
the list of pds types that the converter is responsible for More... | |
Converter for Beamline-, Cavity-, Epics- and EVR Data.
Will convert Beamline data, Cavity data, Epics Data and EVR Data
Definition at line 45 of file machine_converter.h.
|
private |
define a map to map epics type to function for retrieval of the value
Definition at line 103 of file machine_converter.h.
|
private |
define the function to convert epics to cass
Definition at line 100 of file machine_converter.h.
|
private |
define the conversion map from keys to strings
Definition at line 92 of file machine_converter.h.
|
private |
constructor
sets up the pds types that it is responsible for
Definition at line 163 of file machine_converter.cpp.
References cass::MachineData::epicsValToNothing().
|
private |
prevent copy construction
|
virtual |
called at the end of the conversion
evt | pointer to the event that needs to be finalized |
Reimplemented from cass::ConversionBackend.
Definition at line 719 of file machine_converter.cpp.
|
static |
create singleton if doesnt exist already
Definition at line 39 of file machine_converter.cpp.
|
virtual |
called for appropriate xtc part.
xtc | the xtc that contains evr, epics, beamlinedata info |
evt | pointer to the event that we will write the data to. |
BldDataEBeamV7 is the same as BldDataEBeamV6. A sign-error error was discovered in the calculation of the photon energy that goes into the ebeam bld. This is fixed on the accelerator side, but we will increment the ebeam bld version number to V7 so the data is clearly marked as changed.
need to lock this operation as it involves the store used by all
get the epics header and the epics id for this epics variable
cntrl is a configuration type and will only be send with a configure transition
create a key for the epics list and index. If this is an additional list, prepend the detInfo to the epics variable name
now we need to create the map which we will fill later with real values if this epics variable is an array we want an entry in the map for each entry in the array
go through all entries of the array create an entry in the map with the the index in brackets and initialize it with 0
otherwise we just add the name to the map and initialze it with 0
time is the actual data, that will be send down the xtc with 1 Hz
now we need to find the variable name in the map, therefore we look up the name in the indexmap
if it is an array go through all entries of the array create an entry in the map with the the index in brackets and initialize it with 0
try to find the the name in the map this returns an iterator to the first entry we found if it was an array we can then use the iterator to the next values
if the name is not in the map, ouput error message
otherwise extract the epicsData and write it into the map
set the variable that the epics store was filled
clear the status bytes of the event code
get the evr data
how many events have happened between the last event and now
go through all events and extract the eventcode from them
check if the array is big enough to hold the recorded eventcode
add variables to store, cassevent and to log
BPM X values (mm)
BPM Y values (mm)
BPM TMIT values (Nel)
Reimplemented from cass::ConversionBackend.
Definition at line 185 of file machine_converter.cpp.
References cass::Log::add(), cass::MachineData::Device::BeamlineData(), data, detector, cass::CASSEvent::devices(), cass::Log::ERROR, cass::MachineData::Device::EvrData(), cass::Log::INFO, info, cass::CASSEvent::MachineData, offset, cass::toString(), cass::Log::VERBOSEINFO, and cass::Log::WARNING.
|
virtual |
called before the conversion
evt | pointer to the event that needs to be finalized |
clear the beamline data by setting every value to 0 and reset the filled flag
copy values in the store to the event
Reimplemented from cass::ConversionBackend.
Definition at line 686 of file machine_converter.cpp.
References cass::CASSEvent::devices(), cass::MachineData::Device::epicsFilled(), and cass::CASSEvent::MachineData.
|
private |
map containing fucntions that convert epics values to cass values
Definition at line 106 of file machine_converter.h.
|
private |
map Epics Keys to strings
Definition at line 95 of file machine_converter.h.
|
staticprivate |
the singleton container
Definition at line 86 of file machine_converter.h.
|
staticprivate |
singleton locker for mutithreaded requests
Definition at line 89 of file machine_converter.h.
|
private |
a container for the epics values
Definition at line 113 of file machine_converter.h.