pub struct OsciData {
pub t0: f64,
pub dt: f64,
pub size: i32,
pub data: Vec<f64>,
pub signal_stats: Option<SignalStats>,
pub is_stable: bool,
pub fallback_value: Option<f64>,
}Expand description
Oscilloscope data structure containing timing and measurement information
Fields§
§t0: f64§dt: f64§size: i32§data: Vec<f64>§signal_stats: Option<SignalStats>§is_stable: boolIndicates if this data represents a stable reading (for ReadOsciStable actions)
fallback_value: Option<f64>Fallback single value when stable oscilloscope data couldn’t be obtained
Implementations§
Source§impl OsciData
impl OsciData
pub fn new(t0: f64, dt: f64, size: i32, data: Vec<f64>) -> Self
pub fn new_with_stats( t0: f64, dt: f64, size: i32, data: Vec<f64>, stats: SignalStats, ) -> Self
Sourcepub fn new_stable(t0: f64, dt: f64, size: i32, data: Vec<f64>) -> Self
pub fn new_stable(t0: f64, dt: f64, size: i32, data: Vec<f64>) -> Self
Create OsciData for stable readings
Sourcepub fn new_unstable_with_fallback(
t0: f64,
dt: f64,
size: i32,
data: Vec<f64>,
fallback: f64,
) -> Self
pub fn new_unstable_with_fallback( t0: f64, dt: f64, size: i32, data: Vec<f64>, fallback: f64, ) -> Self
Create OsciData for unstable readings with fallback value
Sourcepub fn time_series(&self) -> Vec<(f64, f64)>
pub fn time_series(&self) -> Vec<(f64, f64)>
Get time series as (time, value) pairs
Sourcepub fn stats(&self) -> Option<&SignalStats>
pub fn stats(&self) -> Option<&SignalStats>
Get signal statistics if available
pub fn duration(&self) -> f64
pub fn sample_rate(&self) -> f64
pub fn time_points(&self) -> Vec<f64>
Trait Implementations§
Source§impl ExpectFromAction<OsciData> for ActionResult
impl ExpectFromAction<OsciData> for ActionResult
fn expect_from_action(self, action: &Action) -> OsciData
Auto Trait Implementations§
impl Freeze for OsciData
impl RefUnwindSafe for OsciData
impl Send for OsciData
impl Sync for OsciData
impl Unpin for OsciData
impl UnwindSafe for OsciData
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