...
More info hereThe core online monitoring can be specialized by supplying a plug-in module containing user code. The steps are:
Code Block |
---|
cp -rf /reg/g/pcds/package/amiuser ~/.
|
Code Block |
---|
cd ~/amiuser; gedit ExampleAnalysis.cc
|
Code Block |
---|
make
|
Code Block |
---|
cp libamiuser.so ~amoopr/.
|
The plug-in module will be picked up the next time the DAQ system is restarted. The new plots will appear in the "User" selection.
These instructions also appear in the amiuser/README file.
The ExampleAnalysis class contains several member functions that must be implemented:
The 'detectorid' arguments are of the form Pds::Src and may be cast for comparison against detector identities such as Pds::DetInfo or BLD identities such as Pds::BldInfo (Pds:: classes from pdsdata/xtc package). The 'datatype' arguments are of the form Pds::TypeId which is a class denoting the data format (image, waveform, etc., and version, also from pdsdata/xtc package). The 'data*' arguments are pointers to the configuration or event data (from pdsdata/<type> package). For the 'configure' callbacks with relevant data, the data should be copied. For the 'event' callbacks, the pointers may simply be copied and referenced when the 'analyze' function is called.
Six types of plots may be displayed { Strip chart, 1D histogram, 1D profile histogram, waveform, 2D image, 2D scatter plot } by instanciating the ami/data classes { EntryScalar, EntryTH1F, EntryProf, EntryWaveform, EntryImage, EntryScan }, respectively. The interfaces for these classes are found in the corresponding release/ami/data/Entry*.hh files. For example, a 1D histogram is created by generating its description
Code Block |
---|
DescTH1F(const char* name, const char* xtitle, const char* ytitle, unsigned nbins, float xlow, float xhigh)
|
as found in release/ami/data/DescTH1F.hh and passing it to the EntryTH1F constructor. For example,
Code Block |
---|
DescTH1F desc("My Plot","My X title","My Y title",100, 0., 1.);
EntryTH1F* plot = new EntryTH1F( desc );
|
The plot may be filled by calling its function
Code Block |
---|
plot->addcontent(weight, x_value);
|
and validated for display by calling
Code Block |
---|
plot->valid();
|
See the examples {ExampleAnalysis., AcqirisAnalysis., CamAnalysis.*}.
The new plots will appear in the 'User' section of the online monitoring with a separate tab for each added plot. This should allow users to add a few additional plots using operations not supported by the generic monitoring.
...