CFEL - ASG Software Suite  2.5.0
CASS
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
cass::ACQIRIS::Converter Class Reference

Acqiris Converter. More...

#include <acqiris_converter.h>

+ Inheritance diagram for cass::ACQIRIS::Converter:
+ Collaboration diagram for cass::ACQIRIS::Converter:

Public Member Functions

void operator() (const Pds::Xtc *, CASSEvent *)
 takes the xtc and copies the data to cassevent More...
 
- Public Member Functions inherited from cass::ConversionBackend
virtual ~ConversionBackend ()
 virtual destructor to make clear this is a base class More...
 
virtual void prepare (cass::CASSEvent *)
 prepare the cassevent More...
 
virtual void finalize (cass::CASSEvent *)
 finalize the event More...
 
const pdstypelist_tpdsTypeList () 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 Public Member Functions inherited from cass::ConversionBackend
static shared_pointer instance (const std::string &type)
 return the requested converter type More...
 

Private Types

typedef std::map< lclsid::Key, Device::instruments_t::key_type > idmap_t
 define the map for lcls key to cass id More...
 
typedef std::map< Device::instruments_t::key_type, size_t > configStore_t
 define the store of the config information More...
 

Private Member Functions

 Converter ()
 constructor More...
 
 Converter (const Converter &)
 prevent copy construction More...
 
Converteroperator= (const Converter &)
 prevent assignment More...
 

Private Attributes

idmap_t _LCLSToCASSId
 map lcls id to cass id More...
 
configStore_t _configStore
 Number of Channels for a device. 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

- Public Types inherited from cass::ConversionBackend
typedef std::tr1::shared_ptr< ConversionBackendshared_pointer
 typedef More...
 
typedef std::list< Pds::TypeId::Type > pdstypelist_t
 typedef More...
 
- Protected Attributes inherited from cass::ConversionBackend
pdstypelist_t _pdsTypeList
 the list of pds types that the converter is responsible for More...
 

Detailed Description

Acqiris Converter.

this class takes a xtc of type Id_AcqWaveform or Id_AcqConfig and extracts the acqiris channels for all instruments

User definable Parameters:

Converter/LCLSAcqirisDevices/Detector/{size}
Number of user defined detectors to be pulled out of the xtc

Converter/LCLSPixelDetectors/Detector/%id%/{TypeName}
The type of the detector. Only the following types are supported:

  • Id_AcqConfig : config for Acqiris device
  • Id_AcqWaveform : data of the Acqiris device

Converter/LCLSAcqirisDevices/%id%/{DetectorName}
Name of the detector. Default is invalid

Converter/LCLSAcqirisDevices/%id%/{DetectorID}
the id of the detector. Default is 0.

Converter/LCLSAcqirisDevices/%id%/{DeviceName}
Name of the detector device

Converter/LCLSAcqirisDevices/%id%/{DeviceID}
Id of the detector device

Converter/LCLSAcqirisDevices/%id%/{CASSID}
the Id the Acqiris should get in the CASSEvent. One needs this number for further processing. Note that the config and the data part must have the same CASSID.

Author
Lutz Foucar

Definition at line 56 of file acqiris_converter.h.

Member Typedef Documentation

typedef std::map<Device::instruments_t::key_type,size_t> cass::ACQIRIS::Converter::configStore_t
private

define the store of the config information

Definition at line 70 of file acqiris_converter.h.

typedef std::map<lclsid::Key,Device::instruments_t::key_type> cass::ACQIRIS::Converter::idmap_t
private

define the map for lcls key to cass id

Definition at line 67 of file acqiris_converter.h.

Constructor & Destructor Documentation

Converter::Converter ( )
private

constructor

sets up the pds type ids it is responsible for

skip if the either name has not been set or not correctly set

Definition at line 46 of file acqiris_converter.cpp.

References QSettings::beginGroup(), QSettings::beginReadArray(), Detector, QSettings::endArray(), QSettings::setArrayIndex(), size, and QSettings::value().

cass::ACQIRIS::Converter::Converter ( const Converter )
private

prevent copy construction

Member Function Documentation

ConversionBackend::shared_pointer Converter::instance ( )
static

create singleton if doesnt exist already

Definition at line 35 of file acqiris_converter.cpp.

void Converter::operator() ( const Pds::Xtc *  xtc,
CASSEvent evt 
)
virtual

takes the xtc and copies the data to cassevent

skip if there is no corresponding cass key for that xtc

check whether xtc is a configuration or a event

use the right version to extract the info

get the config

if it is a event then extract all information from the event

extract the datadescriptor (waveform etc) from the xtc

retrieve reference to the right acqiris instrument

write the event id of the data to the instrument

retrieve a reference to the channel container of the instrument

resize the channel vector to how many channels are in the device

copy the channel values from the datadescriptor

get a reference instead of a pointer for easier writing

retrieve a reference to the channel we are working on

extract the infos from the datadesc

get pointer to waveform in the datadescriptor

need to shift the pointer so that it looks at the first real point of the waveform

retrieve a reference to waveform within the cassevent channel

resize cassevent waveform container to the correct size

copy the datapoints of the waveform the byte order has to be swapped for some reason that still has to be determined

iterate to next channel

Reimplemented from cass::ConversionBackend.

Definition at line 99 of file acqiris_converter.cpp.

References cass::CASSEvent::Acqiris, cass::Log::add(), cass::ACQIRIS::Channel::channelNbr(), cass::Log::DEBUG0, cass::CASSEvent::devices(), cass::ACQIRIS::Channel::gain(), cass::ACQIRIS::Channel::horpos(), cass::CASSEvent::id(), cass::ACQIRIS::Instrument::id(), cass::Log::INFO, cass::ACQIRIS::Channel::offset(), cass::ACQIRIS::Channel::sampleInterval(), cass::toString(), and cass::ACQIRIS::Channel::waveform().

Converter& cass::ACQIRIS::Converter::operator= ( const Converter )
private

prevent assignment

Member Data Documentation

configStore_t cass::ACQIRIS::Converter::_configStore
private

Number of Channels for a device.

the number of channels for the device is only send with a configure transition we store them in a map for each instrument

Definition at line 98 of file acqiris_converter.h.

ConversionBackend::shared_pointer Converter::_instance
staticprivate

the singleton container

Definition at line 85 of file acqiris_converter.h.

idmap_t cass::ACQIRIS::Converter::_LCLSToCASSId
private

map lcls id to cass id

Definition at line 91 of file acqiris_converter.h.

QMutex Converter::_mutex
staticprivate

singleton locker for mutithreaded requests

Definition at line 88 of file acqiris_converter.h.


The documentation for this class was generated from the following files: