pub struct Trigger { /* private fields */ }Expand description
一次触发采集的设置。用链式方法构造,Device::start_trigger 启动。
默认值:没有目标、没有 CONV 通道(启动前两者都必须设置),全带宽滤波,每点带时间戳,8 KB 数据包。
Implementations§
Source§impl Trigger
impl Trigger
Sourcepub fn target(
self,
channels: impl Into<ChannelMask>,
points_per_channel: u32,
) -> Result<Trigger>
pub fn target( self, channels: impl Into<ChannelMask>, points_per_channel: u32, ) -> Result<Trigger>
触发目标:在 channels 的每个通道上各采 points_per_channel 点(≥ 1)。
Sourcepub fn conv_channel(
self,
channel: Channel,
edge: Edge,
threshold: i16,
) -> Result<Trigger>
pub fn conv_channel( self, channel: Channel, edge: Edge, threshold: i16, ) -> Result<Trigger>
只用这一路 CONV 通道(替换已设置的全部),迟滞 200 码。
Sourcepub fn add_conv_channel(self, conv: ConvChannel) -> Result<Trigger>
pub fn add_conv_channel(self, conv: ConvChannel) -> Result<Trigger>
增加一路 CONV 通道(最多 4 路,各路的边沿按时刻合并成一个事件序列)。该输入已在列表里时就地修改。
Sourcepub fn remove_conv_channel(self, channel: Channel) -> Trigger
pub fn remove_conv_channel(self, channel: Channel) -> Trigger
去掉一路 CONV 通道(不在列表里时什么也不做)。
Sourcepub fn clear_conv_channels(self) -> Trigger
pub fn clear_conv_channels(self) -> Trigger
去掉全部 CONV 通道。
Sourcepub fn bandwidth(self, bandwidth_hz: f64) -> Result<Trigger>
pub fn bandwidth(self, bandwidth_hz: f64) -> Result<Trigger>
按信号带宽选抽取和滤波核(Kernel::for_bandwidth,最高 20 MHz,即默认值)。
Sourcepub fn raw(self) -> Trigger
pub fn raw(self) -> Trigger
不滤波:每个点是 CONV 时刻之前最近的一个原始采样(Kernel::identity,r = 0)。
Sourcepub fn timestamps(self, on: bool) -> Trigger
pub fn timestamps(self, on: bool) -> Trigger
每个点是否带时间戳(默认带,每点多 4 字节)。
Sourcepub fn standard_mtu_packets(self) -> Trigger
pub fn standard_mtu_packets(self) -> Trigger
使用标准 MTU(1500)能通过的数据包。默认 8 KB 包,需要巨帧。
Sourcepub fn packet_beats(self, beats: u16) -> Trigger
pub fn packet_beats(self, beats: u16) -> Trigger
每个数据包的载荷拍数(8..=1020)。
Sourcepub fn time_calibration(self, ticks: i16) -> Trigger
pub fn time_calibration(self, ticks: i16) -> Trigger
时间校准(T/64,有符号),见 AcqConfig::time_calibration。
Sourcepub fn target_spec(&self) -> Option<(ChannelMask, u32)>
pub fn target_spec(&self) -> Option<(ChannelMask, u32)>
目标通道和每通道点数;未设置时为 None。
Sourcepub fn conv_channels(&self) -> &[ConvChannel]
pub fn conv_channels(&self) -> &[ConvChannel]
已设置的 CONV 通道。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trigger
impl RefUnwindSafe for Trigger
impl Send for Trigger
impl Sync for Trigger
impl Unpin for Trigger
impl UnwindSafe for Trigger
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