From 8527a31907a30c1b9f15dae1e0bdcf76e7e1f123 Mon Sep 17 00:00:00 2001 From: wells.liu <wells.liu@broconcentric.com> Date: 星期四, 02 七月 2020 17:29:09 +0800 Subject: [PATCH] Merge branch 'master' of http://gitblit.broconcentric.com:8088/r/M071 --- src/Bro.Common.Model/Model/IOItem.cs | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/Bro.Common.Model/Model/IOItem.cs b/src/Bro.Common.Model/Model/IOItem.cs index 64a2bca..11283eb 100644 --- a/src/Bro.Common.Model/Model/IOItem.cs +++ b/src/Bro.Common.Model/Model/IOItem.cs @@ -1,6 +1,8 @@ 锘縰sing 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 @@ -10,21 +12,62 @@ /// <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}锛孖O鐐圭殑鍊納Value}"; + return $"{IOType.GetEnumDescription()},缂栧彿{IONum}锛孖O鐐圭殑鍊納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>(); + } } -- Gitblit v1.8.0