using Bro.Common.Helper;
|
using Bro.Common.Interface;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace Bro.Common.Model
|
{
|
/// <summary>
|
/// PLC监听设置
|
/// </summary>
|
public class MonitorSet : IComplexDisplay
|
{
|
[Category("监听配置")]
|
[Description("监听设备")]
|
[TypeConverter(typeof(MonitorDeviceConverter))]
|
public string MonitorDevice { get; set; }
|
|
[Category("监听配置")]
|
[Description("调用方法")]
|
[TypeConverter(typeof(MonitorCodeConverter))]
|
public string MethodCode { get; set; }
|
|
[Category("监听配置")]
|
[Description("方法操作配置")]
|
[TypeConverter(typeof(ComplexObjectConvert))]
|
public IOperationConfig OpConfig { get; set; }
|
|
/// <summary>
|
/// 监听地址索引 按照PLC监听地址从0开始的索引
|
/// </summary>
|
[Category("监听设置")]
|
[Description("监听地址索引 按照PLC监听地址从0开始的索引")]
|
public int TriggerIndex { get; set; } = -1;
|
|
/// <summary>
|
/// 触发值
|
/// </summary>
|
[Category("监听设置")]
|
[Description("触发值,设置为-999时变化即触发")]
|
public int TriggerValue { get; set; } = -1;
|
|
/// <summary>
|
/// 传入数据地址的索引 按照PLC监听地址从0开始的索引集合
|
/// </summary>
|
[Category("监听设置")]
|
[Description("传入数据地址的索引 按照PLC监听地址从0开始的索引")]
|
[TypeConverter(typeof(SimpleCollectionConvert<int>))]
|
public List<int> InputDataIndex { get; set; } = new List<int>();
|
|
/// <summary>
|
/// 数据地址 实际PLC寄存器的地址,例如 40012
|
/// </summary>
|
[Category("回传设置")]
|
[Description("回传数据地址 实际PLC寄存器的地址,10进制,例如 40012")]
|
public int ReplyDataAddress { get; set; } = -1;
|
|
/// <summary>
|
/// 通知地址 实际PLC寄存器的地址,例如 40012
|
/// </summary>
|
[Category("回传设置")]
|
[Description("通知地址 实际PLC寄存器的地址,10进制,例如 40012")]
|
public int NoticeAddress { get; set; } = -1;
|
|
public MonitorSet() { }
|
|
public MonitorSet(int triggerIndex, int triggerValue, List<int> inputDataIndex, int dataIndex, int noticeIndex)
|
{
|
TriggerIndex = triggerIndex;
|
TriggerValue = triggerValue;
|
InputDataIndex = inputDataIndex;
|
ReplyDataAddress = dataIndex;
|
NoticeAddress = noticeIndex;
|
}
|
|
public string GetDisplayText()
|
{
|
return "";
|
}
|
}
|
|
public class MonitorCodeConverter : ComboBoxItemTypeConvert
|
{
|
public override void GetConvertHash()
|
{
|
throw new NotImplementedException();
|
}
|
}
|
|
public class MonitorDeviceConverter : ComboBoxItemTypeConvert
|
{
|
public override void GetConvertHash()
|
{
|
throw new NotImplementedException();
|
}
|
}
|
}
|