| 123456789101112131415161718192021222324252627282930313233343536 |
- namespace IvfTl.AutoFocus.Layout
- {
- /// <summary>对焦范围就近优先解析:well级半幅 > 设备级默认 > 引擎硬编码默认。纯逻辑,仿 PhotoLayerCalculator。</summary>
- public class FocusRangeRawConfig
- {
- public int? WellHRange, WellVRange, DeviceHRange, DeviceVRange;
- public int ExposureMin, ExposureMax;
- public int HorizontalCenter, VerticalCenter;
- }
- public class FocusRangeConfig
- {
- public int HHalf, VHalf, ExpLo, ExpHi, HCenter, VCenter;
- }
- public static class FocusRangeResolver
- {
- // 与 CalibrationEngine 现有硬编码默认对齐(HFineRange=2000、FineZHalf=6000)。
- public const int DefaultHHalf = 2000;
- public const int DefaultVHalf = 6000;
- public static FocusRangeConfig Resolve(FocusRangeRawConfig raw)
- {
- if (raw == null) throw new System.ArgumentNullException(nameof(raw));
- return new FocusRangeConfig
- {
- HHalf = raw.WellHRange ?? raw.DeviceHRange ?? DefaultHHalf,
- VHalf = raw.WellVRange ?? raw.DeviceVRange ?? DefaultVHalf,
- ExpLo = raw.ExposureMin,
- ExpHi = raw.ExposureMax,
- HCenter = raw.HorizontalCenter,
- VCenter = raw.VerticalCenter,
- };
- }
- }
- }
|