patrick
2019-12-10 1c4426810c71eead57084be8a18ade8d314dd8c4
src/Bro.Device.AuboRobot/AuboRobotConfig.cs
@@ -1,6 +1,7 @@
using Bro.Common.Base;
using Bro.Common.Helper;
using Bro.Common.Model;
using Bro.Common.Model.Interface;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
@@ -9,7 +10,7 @@
namespace Bro.Device.AuboRobot
{
    [Device("AuboRobot", "奥博机器人", EnumHelper.DeviceAttributeType.InitialConfig)]
    public class AuboRobotInitialConfig : InitialConfigBase
    public class AuboRobotInitialConfig : InitialMonitorConfigBase
    {
        [Category("机器人设置")]
        [Description("机器人通信IP")]
@@ -39,36 +40,27 @@
        [Description("动作超时设置,单位min")]
        public float OperationTimeout { get; set; } = 1;
        [Category("IO监听设置")]
        [Description("IO监听操作配置集合")]
        [Category("通信报警配置")]
        [Description("通信过程中反馈报警代码配置")]
        [TypeConverter(typeof(CollectionCountConvert))]
        [Editor(typeof(ComplexCollectionEditor<MonitorSet>), typeof(UITypeEditor))]
        public List<MonitorSet> MonitorSetCollection { get; set; } = new List<MonitorSet>();
        [Category("IO监听设置")]
        [Description("IO监听间隔,以ms为单位")]
        public int ScanInterval { get; set; } = 9999;
        [Category("IO监听设置")]
        [Description("是否启用IO监听,true:监听 false:不监听")]
        public bool IsEnableMonitor { get; set; } = false;
        [Category("报警配置")]
        [Description("报警代码配置")]
        [TypeConverter(typeof(CollectionCountConvert))]
        [Editor(typeof(ComplexCollectionEditor<RobotWarningCode>), typeof(UITypeEditor))]
        public List<RobotWarningCode> RobotWarnings { get; set; } = new List<RobotWarningCode>();
        [Editor(typeof(ComplexCollectionEditor<RobotReplyWarningCode>), typeof(UITypeEditor))]
        public List<RobotReplyWarningCode> RobotReplyWarnings { get; set; } = new List<RobotReplyWarningCode>();
    }
    public class RobotWarningCode
    public class RobotReplyWarningCode : IComplexDisplay
    {
        [Category("报警配置")]
        [Category("反馈报警配置")]
        [Description("报警代码")]
        public int WarningCode { get; set; }
        [Category("报警配置")]
        [Category("反馈报警配置")]
        [Description("报警代码描述")]
        public string WarningDescription { get; set; }
        public string GetDisplayText()
        {
            return $"{WarningCode}-{WarningDescription}";
        }
    }
    [Device("AuboRobot", "奥博机器人", EnumHelper.DeviceAttributeType.OperationConfig)]