Skip to main content

ChannelGroup

Struct ChannelGroup 

Source
pub struct ChannelGroup {
    pub id: usize,
    pub index: usize,
    pub data_group_index: usize,
    pub acquisition_name: String,
    pub sample_count: u64,
    pub channels: Vec<Channel>,
    pub source: Option<SourceInfo>,
    pub comment: String,
    /* private fields */
}
Expand description

A channel group containing channels sampled together.

All channels in a channel group share the same time axis and have the same number of samples.

Fields§

§id: usize

Unique identifier for this channel group.

§index: usize

Index of this channel group within its data group.

§data_group_index: usize

Data group index this channel group belongs to.

§acquisition_name: String

Acquisition name.

§sample_count: u64

Number of samples (cycles).

§channels: Vec<Channel>

Channels in this group.

§source: Option<SourceInfo>

Source information.

§comment: String

Comment/description.

Implementations§

Source§

impl ChannelGroup

Source

pub fn channel_count(&self) -> usize

Returns the number of channels in this group.

Source

pub fn master_channel(&self) -> Option<&Channel>

Finds the master (time) channel in this group.

Source

pub fn find_channel(&self, name: &str) -> Option<&Channel>

Finds a channel by name.

Source

pub fn record_size(&self, rec_id_size: u8) -> usize

Returns the total record size including record ID and invalidation bytes.

Source

pub fn data_bytes_len(&self) -> usize

Returns the number of channel-data bytes per record, excluding both the record ID and the invalidation bytes.

Source

pub fn inval_bytes_len(&self) -> usize

Returns the number of invalidation bytes per record.

Source

pub fn sample_reductions(&self) -> &[SampleReduction]

Returns the sample-reduction levels attached to this group.

Each describes a condensed view of the group’s data. The reduced values themselves cannot be read — see SampleReduction.

Source

pub fn record_id(&self) -> u64

Returns the record ID identifying this group within an unsorted stream.

Source

pub fn is_vlsd(&self) -> bool

Returns true if this group stores variable-length signal data rather than channel records.

Source

pub fn is_bus_event(&self) -> bool

Returns true if this group holds logged bus traffic rather than measurements.

The frames themselves are read with crate::Mf4File::can_frames when the traffic is CAN.

Source

pub fn is_plain_bus_event(&self) -> bool

Returns true if this group holds nothing but bus events.

The flag says no decoded signal channels share the group with the raw frames; it does not mean the frame fields themselves are stored in some reduced form. Every CANedge log in the test corpus sets it while carrying the full set of composition channels, so it is no obstacle to crate::Mf4File::can_frames and should not be used to decide whether a group is readable.

Source

pub fn matches_offset(&self, offset: u64) -> bool

Returns true if this group’s block sits at offset in the file, which is how a variable-length channel names the group holding its payloads.

Source

pub fn block_offset(&self) -> u64

Returns the file offset of this group’s CG block.

See DataGroup::block_offset for why an address is what is offered.

Source

pub fn payload_size(&self) -> usize

Returns the size of a record’s own bytes, excluding any record ID.

This is the stride that applies once records have been separated from an interleaved stream, where the record ID is no longer present.

Trait Implementations§

Source§

impl Clone for ChannelGroup

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChannelGroup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.