namespace WIDESEAWCS_S7Simulator.Application.Protocol;
|
|
/// <summary>
|
/// 协议监控配置。
|
/// 在这里配置轮询频率、模板与处理器的绑定关系,避免把设备逻辑写死在代码里。
|
/// </summary>
|
public class ProtocolMonitoringOptions
|
{
|
public int PollingIntervalMs { get; set; } = 200;
|
public List<TemplateProtocolBinding> TemplateBindings { get; set; } = new();
|
public List<MirrorAckRuleOptions> MirrorAckRules { get; set; } = new();
|
|
/// <summary>
|
/// 输送线多段规则集合。
|
/// 一段线体对应一个 RuleId,按顺序执行。
|
/// </summary>
|
public List<string> WcsLineRuleIds { get; set; } = new();
|
|
/// <summary>
|
/// PlcLink 堆垛机规则集合。
|
/// </summary>
|
public List<string> PlcLinkStackerRuleIds { get; set; } = new();
|
|
/// <summary>
|
/// 堆垛机交互规则集合。
|
/// 通过 RuleId 绑定具体的位交互映射逻辑。
|
/// </summary>
|
public List<string> StackerInteractionRuleIds { get; set; } = new();
|
}
|
|
/// <summary>
|
/// 协议模板与设备协议处理器的绑定关系。
|
/// </summary>
|
public class TemplateProtocolBinding
|
{
|
public string TemplateId { get; set; } = string.Empty;
|
public string ProtocolName { get; set; } = string.Empty;
|
}
|
|
/// <summary>
|
/// 通用 ACK 镜像规则。
|
/// 字段键全部由配置驱动,不同设备可使用不同映射。
|
/// </summary>
|
public class MirrorAckRuleOptions
|
{
|
public string RuleId { get; set; } = string.Empty;
|
public string WcsAckFieldKey { get; set; } = "WCS_ACK";
|
public string PlcStbFieldKey { get; set; } = "PLC_STB";
|
public string? WcsTaskIdFieldKey { get; set; } = "WCS_TASK_ID";
|
public string? PlcTaskIdFieldKey { get; set; } = "PLC_TASK_ID";
|
public string? WcsTargetIdFieldKey { get; set; } = "WCS_TARGET_ID";
|
public string? PlcTargetIdFieldKey { get; set; } = "PLC_TARGET_ID";
|
public List<string> ClearFieldKeysOnAck0 { get; set; } = new();
|
public List<string> ClearFieldKeysOnAck2 { get; set; } = new();
|
}
|