using System.Collections.Generic; using Newtonsoft.Json; namespace ivf_tl_Operate.Debug { /// /// operate 端标定进度反序列化 DTO,对齐 control 端 CalibProgress(Task3.1/3.2a)的 JSON。 /// control 端 CalibProgress/WellCalibProgress 是公有字段、用 JsonConvert.SerializeObject 默认序列化, /// 故属性名为 PascalCase(Total/Wells/WellSn...);WellCalibState 枚举无 StringEnumConverter, /// 默认序列化为【数字】(Pending=0 Running=1 Qualified=2 FakePeak=3 Failed=4),故 State 用 int 接。 /// 取法:轮询 /debug/calibrate/progress 返回 DebugCommandResult{ok,result=CalibProgress}, /// 本 DTO 对应 result 内嵌对象,由 CalibrationClient 经 envelope 取出。 /// public sealed class CalibProgressDto { [JsonProperty("Total")] public int Total { get; set; } [JsonProperty("Completed")] public int Completed { get; set; } [JsonProperty("CurrentWell")] public int? CurrentWell { get; set; } [JsonProperty("IsRunning")] public bool IsRunning { get; set; } [JsonProperty("Wells")] public List Wells { get; set; } = new List(); } /// 单 well 进度(对齐 control 端 WellCalibProgress);State 接数字枚举值。 public sealed class WellCalibProgressDto { [JsonProperty("WellSn")] public int WellSn { get; set; } [JsonProperty("State")] public int State { get; set; } // WellCalibState:0待标定/1标定中/2合格/3伪峰/4失败 [JsonProperty("FocusZ")] public int FocusZ { get; set; } [JsonProperty("Exposure")] public int Exposure { get; set; } [JsonProperty("PeakRatio")] public double PeakRatio { get; set; } [JsonProperty("CenterOffsetPct")] public double CenterOffsetPct { get; set; } [JsonProperty("CircleFound")] public bool CircleFound { get; set; } [JsonProperty("Note")] public string Note { get; set; } = ""; } }