领胜LDS 键盘AOI检测项目
wells.liu
2020-07-06 6935238d2b7fdabbe46514b50e154df44af862f8
src/Bro.Common.Model/Model/IOItem.cs
@@ -22,8 +22,9 @@
        /// IO点的值
        /// </summary>
        [Category("IO配置")]
        [Description("IO数值")]
        public virtual int Value { get; set; }
        [Description("IO状态")]
        [TypeConverter(typeof(EnumDescriptionConverter<IOValue>))]
        public virtual IOValue Value { get; set; }
        /// <summary>
        /// IO点是in还是out
@@ -42,9 +43,9 @@
            return false;
        }
        public string GetDisplayText()
        public virtual string GetDisplayText()
        {
            return $"{IOType.GetEnumDescription()}-{IONum}-{Value}";
            return $"{IOType.GetEnumDescription()}-{IONum}-{Value.GetEnumDescription()}";
        }
        public int GetHashCode(object obj)
@@ -56,6 +57,11 @@
    public class IODefinition : IOItem
    {
        [Category("IO配置")]
        [Description("IO预定义")]
        [TypeConverter(typeof(EnumDescriptionConverter<IOPrestatement>))]
        public IOPrestatement IOPreStatement { get; set; } = IOPrestatement.Customized;
        [Category("IO配置")]
        [Description("IO用途描述")]
        public string IODesc { get; set; }
@@ -65,11 +71,11 @@
        [Browsable(false)]
        [JsonIgnore]
        public override int Value { get; set; }
        public override IOValue Value { get; set; }
        public new string GetDisplayText()
        public override string GetDisplayText()
        {
            return $"{IODesc} {IOType.GetEnumDescription()} {IONum}";
            return $"{(IOPreStatement == IOPrestatement.Customized ? IODesc : IOPreStatement.GetEnumDescription())} {IOType.GetEnumDescription()} {IONum}";
        }
    }
@@ -81,8 +87,8 @@
        public IODefinition IOItem { get; set; } = new IODefinition();
        [Category("IO操作配置")]
        [Description("需要操作的IO的数值")]
        public int CheckValue
        [Description("需要操作的IO的状态")]
        public IOValue CheckValue
        {
            get => IOItem.Value;
            set => IOItem.Value = value;
@@ -94,7 +100,7 @@
        public string GetDisplayText()
        {
            return IOItem.IODesc + "-" + CheckValue;
            return IOItem.IODesc + "-" + CheckValue.GetEnumDescription();
        }
    }