Files
2026-11-19 16:42:26 +08:00

62 lines
2.7 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace HardwareControl.Core.Spectrometer
{
/// <summary>
/// aris 光谱仪配置,对应 appsettings.json 的 "ArisSpectrometer" 节。
/// 所有属性都有默认值,配置文件可只写需要覆盖的项。
/// </summary>
public sealed class ArisSpectrometerOptions
{
public const string SectionName = "ArisSpectrometer";
/// <summary>
/// 默认使用的设备索引(0 起)。多台设备时由 <see cref="PreferredSerialNumber"/> 优先。
/// </summary>
public int DeviceIndex { get; set; }
/// <summary>
/// 优先匹配的序列号;非空且能匹配到设备时覆盖 <see cref="DeviceIndex"/>。
/// </summary>
public string? PreferredSerialNumber { get; set; }
/// <summary>单帧采集默认曝光时间,单位微秒,必须大于 0。</summary>
public int ExposureUs { get; set; } = 1000;
/// <summary>单帧采集默认平均次数,必须大于等于 1。</summary>
public int Averaging { get; set; } = 1;
/// <summary>单帧采集默认触发延迟,单位微秒,必须大于等于 0。</summary>
public int DelayUs { get; set; }
/// <summary>
/// 单帧采集默认超时,单位毫秒;小于等于 0 时按
/// <c>max(3000, 曝光/1000 + 2000)</c> 计算。
/// </summary>
public int TimeoutMs { get; set; }
/// <summary>
/// 多台同步采集的默认曝光时间,单位微秒。
/// 参数在连接时预配置,采集时三台设备只发启动命令(间隔约 1 ms),
/// 因此 100 ms 曝光即可覆盖全部设备,不再需要覆盖“逐台武装”的长曝光窗口。
/// </summary>
public int SynchronizedExposureUs { get; set; } = 100_000;
/// <summary>
/// 多台同步采集时,启动后等待所有设备出帧的默认最长时间(毫秒)。
/// </summary>
public int SynchronizedWaitTimeoutMs { get; set; } = 8000;
/// <summary>
/// 连接成功后设置的触发模式;为 null 时保持设备当前配置。
/// 默认 <see cref="SpectrometerTriggerMode.Software"/>:自由运行。
/// 由第三台设备触发激光、其余设备自由收光的场景使用 Software;
/// 有外部 AD/TTL 触发源时改为 External;FreeRunEdge 对应自由运行的开始触发脉冲。
/// </summary>
public SpectrometerTriggerMode? TriggerMode { get; set; } = SpectrometerTriggerMode.Software;
/// <summary>
/// 连接成功后设置的增益(0=低增益,1=高增益);为 null 时保持设备当前配置。
/// </summary>
public int? Gain { get; set; }
}
}