using System; namespace IvfTl.AutoFocus.Layout { /// /// 对焦层配置缺失专用异常(§2.5:层间距等关键配置两级皆空时抛出,不用魔法数兜底)。 /// 调用方(M2-03/M2-05)据此弹"请先配置"告警并跳过本轮,而不是用硬编码值继续。 /// 携带设备 tl_sn / 仓室 / well 信息供告警与定位。 /// public sealed class FocusConfigMissingException : Exception { /// 设备 tl_sn。 public string TlSn { get; } /// 仓室编号。 public int HouseSn { get; } /// well 编号。 public int WellSn { get; } /// /// 默认消息:层间距未配置。消息形如"设备{tlSn}对焦层间距未配置,请先初始化"(§2.5)。 /// public FocusConfigMissingException(string tlSn, int houseSn, int wellSn) : this(tlSn, houseSn, wellSn, $"设备{tlSn}对焦层间距未配置,请先初始化") { } /// 自定义消息(用于层数/下移等其它缺失场景)。 public FocusConfigMissingException(string tlSn, int houseSn, int wellSn, string message) : base(message) { TlSn = tlSn; HouseSn = houseSn; WellSn = wellSn; } } }