pub struct MultiChannelSensorLog {
pub channel_names: Vec<String>,
pub rows: Vec<Vec<f64>>,
}Expand description
A generic multi-channel sensor log, suitable for storing any mix of floating-point channel data alongside a common timestamp.
Fields§
§channel_names: Vec<String>Channel names, one per column.
rows: Vec<Vec<f64>>Rows, each containing a timestamp followed by one value per channel.
Implementations§
Source§impl MultiChannelSensorLog
impl MultiChannelSensorLog
Sourcepub fn new(channel_names: Vec<String>) -> Self
pub fn new(channel_names: Vec<String>) -> Self
Create an empty log with the given channel names.
Sourcepub fn num_channels(&self) -> usize
pub fn num_channels(&self) -> usize
Number of channels (excluding the timestamp column).
Sourcepub fn push_row(&mut self, timestamp: f64, values: &[f64]) -> bool
pub fn push_row(&mut self, timestamp: f64, values: &[f64]) -> bool
Append a row. timestamp is prepended; values must have exactly
num_channels elements. Returns false when the length is wrong.
Sourcepub fn channel_values(&self, idx: usize) -> Vec<f64>
pub fn channel_values(&self, idx: usize) -> Vec<f64>
Extract all values for channel idx (0-based, excludes timestamp).
Sourcepub fn channel_stats(&self, idx: usize) -> ChannelStats
pub fn channel_stats(&self, idx: usize) -> ChannelStats
Compute per-channel statistics.
Sourcepub fn to_csv_lines(&self) -> Vec<String>
pub fn to_csv_lines(&self) -> Vec<String>
Export to CSV lines (header + data rows).
Trait Implementations§
Source§impl Clone for MultiChannelSensorLog
impl Clone for MultiChannelSensorLog
Source§fn clone(&self) -> MultiChannelSensorLog
fn clone(&self) -> MultiChannelSensorLog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MultiChannelSensorLog
impl RefUnwindSafe for MultiChannelSensorLog
impl Send for MultiChannelSensorLog
impl Sync for MultiChannelSensorLog
impl Unpin for MultiChannelSensorLog
impl UnsafeUnpin for MultiChannelSensorLog
impl UnwindSafe for MultiChannelSensorLog
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.