From 1c4426810c71eead57084be8a18ade8d314dd8c4 Mon Sep 17 00:00:00 2001 From: patrick <patrick.xu@broconcentric.com> Date: 星期二, 10 十二月 2019 14:24:31 +0800 Subject: [PATCH] 1. 重构项目 --- src/Bro.Device.AuboRobot/AuboRobotConfig.cs | 36 ++++++++++++++---------------------- 1 files changed, 14 insertions(+), 22 deletions(-) diff --git a/src/Bro.Device.AuboRobot/AuboRobotConfig.cs b/src/Bro.Device.AuboRobot/AuboRobotConfig.cs index 043faec..cfa159d 100644 --- a/src/Bro.Device.AuboRobot/AuboRobotConfig.cs +++ b/src/Bro.Device.AuboRobot/AuboRobotConfig.cs @@ -1,6 +1,7 @@ 锘縰sing 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("鍔ㄤ綔瓒呮椂璁剧疆锛屽崟浣峬in")] 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("鎶ヨ浠g爜閰嶇疆")] - [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("鎶ヨ浠g爜")] public int WarningCode { get; set; } - [Category("鎶ヨ閰嶇疆")] + [Category("鍙嶉鎶ヨ閰嶇疆")] [Description("鎶ヨ浠g爜鎻忚堪")] public string WarningDescription { get; set; } + + public string GetDisplayText() + { + return $"{WarningCode}-{WarningDescription}"; + } } [Device("AuboRobot", "濂ュ崥鏈哄櫒浜�", EnumHelper.DeviceAttributeType.OperationConfig)] -- Gitblit v1.8.0