Skip to main content

Module attr_plot

Module attr_plot 

Source
Expand description

NDPluginAttrPlot: caches numeric NDArray attribute values over an acquisition and exposes selected ones as waveform records.

Port of ADCore NDPluginAttrPlot. The C++ model separates two counts:

  • n_attributes — the maximum number of tracked numeric attributes. Attribute names are discovered from the first frame of an acquisition (and re-discovered after a reset), sorted, and capped to n_attributes. One circular buffer per tracked attribute.
  • n_data_blocks — the number of waveform outputs (asyn addresses). Each data block has an independent DataSelect value that maps it to a tracked attribute index, or to the special UID buffer (-1), or to nothing (-2).

DataLabel is the human-readable name of the attribute a block is bound to; NPts is the current number of cached points. The waveform emitted for a block is padded out to cache_size with the last valid point to avoid plot artifacts (C++ callback_data).

The two callback paths are separate in C and separate here. AP_NPts and the attribute/label/selection metadata are posted from the frame path (C++ processCallbacks, NDPluginAttrPlot.cpp:126-146); AP_Data is posted only from callback_data (:96-124), which C++ drives from ExposeDataTask::run once per ND_ATTRPLOT_DATA_EXPOSURE_PERIOD (1 s, NDPluginAttrPlot.h:39) and once per DataSelect write (:283-289). Posting the waveform per frame would make a camonitor on AP_Data fire at the detector frame rate.

Structs§

AttrPlotProcessor
Processor that tracks attribute values over time in circular buffers.

Constants§

ATTRPLOT_NONE_INDEX
DataSelect value meaning “this block plots nothing”.
ATTRPLOT_NONE_LABEL
DataLabel text for an unbound block.
ATTRPLOT_UID_INDEX
DataSelect value meaning “this block plots the UID buffer”.
ATTRPLOT_UID_LABEL
DataLabel text for the UID buffer.