Trigger

Struct Trigger 

Source
pub struct Trigger { /* private fields */ }
Expand description

一次触发采集的设置。用链式方法构造,Device::start_trigger 启动。

默认值:没有目标、没有 CONV 通道(启动前两者都必须设置),全带宽滤波,每点带时间戳,8 KB 数据包。

Implementations§

Source§

impl Trigger

Source

pub fn new() -> Trigger

默认设置。

Source

pub fn target( self, channels: impl Into<ChannelMask>, points_per_channel: u32, ) -> Result<Trigger>

触发目标:在 channels 的每个通道上各采 points_per_channel 点(≥ 1)。

Source

pub fn conv_channel( self, channel: Channel, edge: Edge, threshold: i16, ) -> Result<Trigger>

只用这一路 CONV 通道(替换已设置的全部),迟滞 200 码。

Source

pub fn add_conv_channel(self, conv: ConvChannel) -> Result<Trigger>

增加一路 CONV 通道(最多 4 路,各路的边沿按时刻合并成一个事件序列)。该输入已在列表里时就地修改。

Source

pub fn remove_conv_channel(self, channel: Channel) -> Trigger

去掉一路 CONV 通道(不在列表里时什么也不做)。

Source

pub fn clear_conv_channels(self) -> Trigger

去掉全部 CONV 通道。

Source

pub fn bandwidth(self, bandwidth_hz: f64) -> Result<Trigger>

按信号带宽选抽取和滤波核(Kernel::for_bandwidth,最高 20 MHz,即默认值)。

Source

pub fn raw(self) -> Trigger

不滤波:每个点是 CONV 时刻之前最近的一个原始采样(Kernel::identity,r = 0)。

Source

pub fn kernel(self, decimation_log2: u8, kernel: Kernel) -> Trigger

指定抽取指数 r(0..=4)和滤波核。

Source

pub fn timestamps(self, on: bool) -> Trigger

每个点是否带时间戳(默认带,每点多 4 字节)。

Source

pub fn standard_mtu_packets(self) -> Trigger

使用标准 MTU(1500)能通过的数据包。默认 8 KB 包,需要巨帧。

Source

pub fn packet_beats(self, beats: u16) -> Trigger

每个数据包的载荷拍数(8..=1020)。

Source

pub fn time_calibration(self, ticks: i16) -> Trigger

时间校准(T/64,有符号),见 AcqConfig::time_calibration。

Source

pub fn target_spec(&self) -> Option<(ChannelMask, u32)>

目标通道和每通道点数;未设置时为 None。

Source

pub fn conv_channels(&self) -> &[ConvChannel]

已设置的 CONV 通道。

Source

pub fn to_config(&self) -> Result<AcqConfig>

生成对应的底层配置(同时做完整检查)。

Trait Implementations§

Source§

impl Clone for Trigger

Source§

fn clone(&self) -> Trigger

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Trigger

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Trigger

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

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<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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.