Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Write a plug-in to our GUI

More info hereThe core online monitoring can be specialized by supplying a plug-in module containing user code.  The steps are:

  1. Copy /reg/g/pcds/package/amiuser to your area
    Code Block
    
     cp -rf /reg/g/pcds/package/amiuser ~/.
    

  2. Edit the ExampleAnalysis.{hh,cc} files
    Code Block
    
     cd ~/amiuser; gedit ExampleAnalysis.cc
    

  3. Build the libamiuser.so library
    Code Block
    
     make
    

  4. Copy the libamiuser.so to your experiment's home area
    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. Image Added
These instructions also appear in the amiuser/README file.

The ExampleAnalysis class contains several member functions that must be implemented:

  • clear() - unregister plots and disable analysis
  • create() - register plots and enable analysis
  • reset() - called prior to a new configuration
  • clock(timestamp) - called once for each event or configuration
  • configure(detectorid, datatype, data*) - called for each detector datum in the configuration
  • event(detectorid, datatype, data*) - called for each detector datum in the event
  • analyze() - called once after all 'event()' callbacks have completed

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.

Write their own application (reads from shared memory)

...