pub struct AcqConfig { /* private fields */ }Expand description
一次采集的完整配置。用链式方法构造,Device::configure 或
AcqConfig::apply 写入设备。
默认值:不抽取(r = 0),不改设备里已有的滤波核,4 个检测器全关,两组都没有来源和通道, 点数不限,8 KB 数据包(需要巨帧)。
Implementations§
Source§impl AcqConfig
impl AcqConfig
Sourcepub fn decimation_log2(self, r: u8) -> AcqConfig
pub fn decimation_log2(self, r: u8) -> AcqConfig
抽取指数 r(0..=4),重采样之前先做 R = 2^r 倍抽取。
Sourcepub fn bandwidth(self, bandwidth_hz: f64) -> Result<AcqConfig>
pub fn bandwidth(self, bandwidth_hz: f64) -> Result<AcqConfig>
按信号带宽同时设置抽取指数和滤波核,见 Kernel::for_bandwidth。
Sourcepub fn time_calibration(self, ticks: i16) -> AcqConfig
pub fn time_calibration(self, ticks: i16) -> AcqConfig
时间校准(单位 T/64,有符号):补偿 CONV 输入到 ADC 采样时刻的固定延迟,加到所有检测器的边沿时刻上。
Sourcepub fn detector(self, d: usize, det: EdgeDetector) -> AcqConfig
pub fn detector(self, d: usize, det: EdgeDetector) -> AcqConfig
设置边沿检测器 d(0..=3)。检测器还需要在某一组的来源里选中才起作用。
Sourcepub fn detector_off(self, d: usize) -> AcqConfig
pub fn detector_off(self, d: usize) -> AcqConfig
关闭边沿检测器 d(默认即关闭)。
Sourcepub fn generator_period(self, samples: f64) -> AcqConfig
pub fn generator_period(self, samples: f64) -> AcqConfig
内部发生器的周期,单位为采样周期,可以是小数(分辨率 1/16384)。
整数周期时每个点落在同一个插值相位上;配合 Kernel::identity 和 r = 0 即“每 N 个采样取一个“。
Sourcepub fn generator_rate(self, points_per_second: f64) -> AcqConfig
pub fn generator_rate(self, points_per_second: f64) -> AcqConfig
内部发生器的速率(点/秒),按标称采样率 100 MSPS 换算成周期。
Sourcepub fn group(self, g: usize, f: impl FnOnce(Group) -> Group) -> AcqConfig
pub fn group(self, g: usize, f: impl FnOnce(Group) -> Group) -> AcqConfig
设置组 g(0 或 1)。闭包拿到该组当前的设置,返回修改后的设置。
Sourcepub fn merge_delay(self, samples: u16) -> AcqConfig
pub fn merge_delay(self, samples: u16) -> AcqConfig
合并延迟(采样周期数,≥ 16):多个来源的事件按时刻排序时等待的时间。 用作 CONV 的边沿很慢(从阈值走到迟滞电平超过这个时间)时需要加大。
Sourcepub fn jumbo_packets(self) -> AcqConfig
pub fn jumbo_packets(self) -> AcqConfig
使用 8 KB 数据包(默认)。主机网卡和交换机的 MTU 需 ≥ 8100。
Sourcepub fn standard_mtu_packets(self) -> AcqConfig
pub fn standard_mtu_packets(self) -> AcqConfig
使用标准 MTU(1500)能通过的数据包(1472 字节)。包数约为巨帧的 5.6 倍。
Sourcepub fn packet_beats(self, beats: u16) -> AcqConfig
pub fn packet_beats(self, beats: u16) -> AcqConfig
每个数据包的载荷拍数(8..=1020,每拍 8 字节,数据报 = 32 + 8 × 拍数 字节)。
Sourcepub fn flush_timeout(self, t: Duration) -> AcqConfig
pub fn flush_timeout(self, t: Duration) -> AcqConfig
未装满的数据包最长等待多久就发出(默认 1 ms)。点速率很低时决定数据到达主机的延迟。
Sourcepub fn total_points(&self) -> u32
pub fn total_points(&self) -> u32
配置的点数(0 = 不限)。
Sourcepub fn decimation(&self) -> u8
pub fn decimation(&self) -> u8
配置的抽取指数 r。
Sourcepub fn generator_period_samples(&self) -> Option<f64>
pub fn generator_period_samples(&self) -> Option<f64>
内部发生器的周期(采样周期数);未设置时为 None。
Sourcepub fn detectors(&self) -> &[Option<EdgeDetector>; 4]
pub fn detectors(&self) -> &[Option<EdgeDetector>; 4]
4 个边沿检测器的设置(None = 关闭)。