| | |
| | | using Bro.Common.Helper; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using static Bro.Common.Helper.EnumHelper; |
| | | |
| | | namespace Bro.Common.Model |
| | |
| | | /// <summary> |
| | | /// IO点编号 |
| | | /// </summary> |
| | | public int IONum { get; set; } |
| | | [Category("IO配置")] |
| | | [Description("IO点编号")] |
| | | public virtual int IONum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// IO点的值 |
| | | /// </summary> |
| | | public int Value { get; set; } |
| | | [Category("IO配置")] |
| | | [Description("IO数值")] |
| | | public virtual int Value { get; set; } |
| | | |
| | | /// <summary> |
| | | /// IO点是in还是out |
| | | /// </summary> |
| | | public IOModel Model { get; set; } |
| | | [Category("IO配置")] |
| | | [Description("IO类型")] |
| | | public virtual IOType IOType { get; set; } |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | | return $"{Model.GetEnumDescription()},编号{IONum},IO点的值{Value}"; |
| | | return $"{IOType.GetEnumDescription()},编号{IONum},IO点的值{Value}"; |
| | | } |
| | | } |
| | | |
| | | public class IODefinition : IOItem |
| | | { |
| | | [Category("IO配置")] |
| | | [Description("IO用途描述")] |
| | | public string IODesc { get; set; } |
| | | |
| | | [Category("IO配置")] |
| | | [Description("备注说明")] |
| | | public string Remark { get; set; } |
| | | |
| | | [Browsable(false)] |
| | | [JsonIgnore] |
| | | public override int Value { get; set; } |
| | | |
| | | public new string GetDisplayText() |
| | | { |
| | | return $"{IODesc} {IOType.GetEnumDescription()} {IONum}"; |
| | | } |
| | | } |
| | | |
| | | public class IORefrenceItem |
| | | { |
| | | [Category("IO操作配置")] |
| | | [Description("需要操作的IO")] |
| | | public IOItem IOItem { get; set; } = new IOItem(); |
| | | |
| | | [Category("IO操作配置")] |
| | | [Description("需要操作的IO的数值")] |
| | | public int CheckValue { get => IOItem.Value; set => IOItem.Value = value; } |
| | | |
| | | [Browsable(false)] |
| | | [JsonIgnore] |
| | | public List<IODefinition> IOItemSource { get; set; } = new List<IODefinition>(); |
| | | } |
| | | } |