pub struct AttrPlotProcessor { /* private fields */ }Expand description
Processor that tracks attribute values over time in circular buffers.
Implementations§
Source§impl AttrPlotProcessor
impl AttrPlotProcessor
Sourcepub fn new(n_attributes: usize, cache_size: usize, n_data_blocks: usize) -> Self
pub fn new(n_attributes: usize, cache_size: usize, n_data_blocks: usize) -> Self
Create a processor.
n_attributes— maximum tracked attributes.cache_size— per-buffer cache size (0= unlimited).n_data_blocks— number of waveform output blocks.
Sourcepub fn attributes(&self) -> &[String]
pub fn attributes(&self) -> &[String]
Get the list of tracked attribute names.
Sourcepub fn buffer(&self, index: usize) -> Option<&VecDeque<f64>>
pub fn buffer(&self, index: usize) -> Option<&VecDeque<f64>>
Get the circular buffer for a specific attribute index.
Sourcepub fn uid_buffer(&self) -> &VecDeque<f64>
pub fn uid_buffer(&self) -> &VecDeque<f64>
Get the unique_id buffer.
Sourcepub fn num_attributes(&self) -> usize
pub fn num_attributes(&self) -> usize
Get the number of tracked attributes.
Sourcepub fn num_data_blocks(&self) -> usize
pub fn num_data_blocks(&self) -> usize
Get the number of waveform output blocks.
Sourcepub fn find_attribute(&self, name: &str) -> Option<usize>
pub fn find_attribute(&self, name: &str) -> Option<usize>
Find the index of a named attribute. Returns None if not tracked.
Sourcepub fn data_select(&self, block: usize) -> Option<i32>
pub fn data_select(&self, block: usize) -> Option<i32>
Current DataSelect value for a block.
Sourcepub fn set_data_select(
&mut self,
block: usize,
value: i32,
) -> Result<(), &'static str>
pub fn set_data_select( &mut self, block: usize, value: i32, ) -> Result<(), &'static str>
Bind a data block to an attribute index (or a UID/NONE sentinel).
Mirrors C++ writeInt32(NDAttrPlotDataSelect): rejects out-of-range
blocks and selections that point past the tracked attributes.
Sourcepub fn data_label(&self, block: usize) -> String
pub fn data_label(&self, block: usize) -> String
The DataLabel text for a block, derived from its DataSelect.
Trait Implementations§
Source§impl NDPluginProcess for AttrPlotProcessor
impl NDPluginProcess for AttrPlotProcessor
Source§fn process_array(
&mut self,
array: &NDArray,
_pool: &NDArrayPool,
) -> ProcessResult
fn process_array( &mut self, array: &NDArray, _pool: &NDArrayPool, ) -> ProcessResult
Process one array. Return output arrays and param updates.
Source§fn plugin_type(&self) -> &str
fn plugin_type(&self) -> &str
Plugin type name for PLUGIN_TYPE param.
Source§fn register_params(&mut self, base: &mut PortDriverBase) -> AsynResult<()>
fn register_params(&mut self, base: &mut PortDriverBase) -> AsynResult<()>
Register plugin-specific params on the base. Called once during construction.
Source§fn on_param_change(
&mut self,
reason: usize,
params: &PluginParamSnapshot,
) -> ParamChangeResult
fn on_param_change( &mut self, reason: usize, params: &PluginParamSnapshot, ) -> ParamChangeResult
Called when a param changes. Reason is the param index.
Return param updates to be written back to the port driver.
Source§fn compression_aware(&self) -> bool
fn compression_aware(&self) -> bool
Whether this plugin can process compressed (
codec != None) arrays
(C++ compressionAware_, G3). Defaults to false: a plugin that
operates on raw pixels must not be handed compressed bytes — the
runtime drops compressed input and counts it into DroppedArrays.
A codec/file plugin that understands compressed data overrides this.Auto Trait Implementations§
impl Freeze for AttrPlotProcessor
impl RefUnwindSafe for AttrPlotProcessor
impl Send for AttrPlotProcessor
impl Sync for AttrPlotProcessor
impl Unpin for AttrPlotProcessor
impl UnsafeUnpin for AttrPlotProcessor
impl UnwindSafe for AttrPlotProcessor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more