namespace RIZO.Admin.WebApi.PLC.Model { public class PlcConfig { public string PlcName { get; set; } public string Ip { get; set; } public short Rack { get; set; } = 0; public short Slot { get; set; } = 1; } public class GlobalPlcConfig { public int ConnectTimeout { get; set; } = 2000; public int ReadWriteTimeout { get; set; } = 2000; } // PLC测试结果实体 public class PlcTestResult { public string PlcName { get; set; } public string Ip { get; set; } public bool ConnectSuccess { get; set; } public string ConnectMessage { get; set; } public bool ReadSuccess { get; set; } public string ReadValue { get; set; } public string ReadMessage { get; set; } public bool WriteSuccess { get; set; } public string WriteMessage { get; set; } //设备运行状态 public string RunStatus { get; set; } //设备模式 public string MachineModel { get; set; } //设备在线模式 public string OnLineStatus { get; set; } //设备生产模式 public string ProduceModel { get; set; } } /// /// PLC轮询配置 /// public class PlcPollingSettings { /// /// 单PLC最大并发数 /// public int MaxConcurrentPerPlc { get; set; } = 1; /// /// 有数据请求时轮询间隔(秒) /// public double ActivePollInterval { get; set; } = 0.2; /// /// 无数据请求时轮询间隔(秒) /// public double IdlePollInterval { get; set; } = 2.0; /// /// 有数据后保持高频轮询的时长(秒) /// public int ActiveDuration { get; set; } = 10; /// /// 最大重试次数 /// public int MaxRetryTimes { get; set; } = 3; /// /// 初始重试间隔(秒) /// public int InitialRetryInterval { get; set; } = 1; /// /// 配置刷新间隔(秒) /// public int ConfigRefreshInterval { get; set; } = 30; /// /// 全局最大并行度 /// public int GlobalParallelDegree { get; set; } = 15; /// /// 连接超时时间(秒) /// public int ConnectTimeoutSeconds { get; set; } = 1; } }