CFEL - ASG Software Suite  2.5.0
CASS
acqiris_converter.h
Go to the documentation of this file.
1 //Copyright (C) 2009, 2010, 2011 Lutz Foucar
2 
3 /**
4  * @file acqiris_converter.h file contains the declaration of the converter
5  * for the xtc containing acqiris data.
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef _ACQIRIS_CONVERTER_H
11 #define _ACQIRIS_CONVERTER_H
12 
13 #include <iostream>
14 #include <map>
15 
16 #include <QtCore/QMutex>
17 
18 #include "conversion_backend.h"
19 #include "acqiris_device.hpp"
20 
21 
22 namespace cass
23 {
24 namespace lclsid
25 {
26 class Key;
27 }
28 namespace ACQIRIS
29 {
30 /** Acqiris Converter
31  *
32  * this class takes a xtc of type Id_AcqWaveform or Id_AcqConfig and
33  * extracts the acqiris channels for all instruments
34  *
35  * @cassttng Converter/LCLSAcqirisDevices/Detector/{size} \n
36  * Number of user defined detectors to be pulled out of the xtc
37  * @cassttng Converter/LCLSPixelDetectors/Detector/\%id\%/{TypeName} \n
38  * The type of the detector. Only the following types are supported:
39  * - Id_AcqConfig : config for Acqiris device
40  * - Id_AcqWaveform : data of the Acqiris device
41  * @cassttng Converter/LCLSAcqirisDevices/\%id\%/{DetectorName} \n
42  * Name of the detector. Default is invalid
43  * @cassttng Converter/LCLSAcqirisDevices/\%id\%/{DetectorID} \n
44  * the id of the detector. Default is 0.
45  * @cassttng Converter/LCLSAcqirisDevices/\%id\%/{DeviceName} \n
46  * Name of the detector device
47  * @cassttng Converter/LCLSAcqirisDevices/\%id\%/{DeviceID} \n
48  * Id of the detector device
49  * @cassttng Converter/LCLSAcqirisDevices/\%id\%/{CASSID} \n
50  * the Id the Acqiris should get in the CASSEvent. One needs this
51  * number for further processing. Note that the config and the data
52  * part must have the same CASSID.
53  *
54  * @author Lutz Foucar
55  */
57 {
58 public:
59  /** create singleton if doesnt exist already */
61 
62  /** takes the xtc and copies the data to cassevent */
63  void operator()(const Pds::Xtc*, CASSEvent*);
64 
65 private:
66  /** define the map for lcls key to cass id */
67  typedef std::map<lclsid::Key,Device::instruments_t::key_type> idmap_t;
68 
69  /** define the store of the config information */
70  typedef std::map<Device::instruments_t::key_type,size_t> configStore_t;
71 
72  /** constructor
73  *
74  * sets up the pds type ids it is responsible for
75  */
76  Converter();
77 
78  /** prevent copy construction */
79  Converter(const Converter&);
80 
81  /** prevent assignment */
82  Converter& operator=(const Converter&);
83 
84  /** the singleton container */
86 
87  /** singleton locker for mutithreaded requests */
88  static QMutex _mutex;
89 
90  /** map lcls id to cass id */
91  idmap_t _LCLSToCASSId;
92 
93  /** Number of Channels for a device
94  *
95  * the number of channels for the device is only send with a configure
96  * transition we store them in a map for each instrument
97  */
98  configStore_t _configStore;
99 };
100 }//end namespace acqiris
101 }//end namespace cass
102 
103 #endif
Event to store all LCLS Data.
Definition: cass_event.h:32
static QMutex _mutex
singleton locker for mutithreaded requests
std::map< Device::instruments_t::key_type, size_t > configStore_t
define the store of the config information
std::map< lclsid::Key, Device::instruments_t::key_type > idmap_t
define the map for lcls key to cass id
file contains base class for all format converters
idmap_t _LCLSToCASSId
map lcls id to cass id
configStore_t _configStore
Number of Channels for a device.
file contains the declaration of the acqiris part of the CASSEvent
Converter & operator=(const Converter &)
prevent assignment
std::tr1::shared_ptr< ConversionBackend > shared_pointer
typedef
Key for IdConversion Map.
Definition: lcls_key.hpp:29
void operator()(const Pds::Xtc *, CASSEvent *)
takes the xtc and copies the data to cassevent
Base class for Converters.
Acqiris Converter.
static ConversionBackend::shared_pointer _instance
the singleton container
static ConversionBackend::shared_pointer instance()
create singleton if doesnt exist already