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.Common/Base/DeviceConfigBase.cs | 67 ++++++++++++++++++++++++++++++++- 1 files changed, 65 insertions(+), 2 deletions(-) diff --git a/src/Bro.Device.Common/Base/DeviceConfigBase.cs b/src/Bro.Device.Common/Base/DeviceConfigBase.cs index 1150d4e..e708e99 100644 --- a/src/Bro.Device.Common/Base/DeviceConfigBase.cs +++ b/src/Bro.Device.Common/Base/DeviceConfigBase.cs @@ -1,7 +1,11 @@ -锘縰sing Bro.Common.Interface; +锘縰sing Bro.Common.Helper; +using Bro.Common.Interface; +using Bro.Common.Model; +using Bro.Common.Model.Interface; using System; using System.Collections.Generic; using System.ComponentModel; +using System.Drawing.Design; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -28,6 +32,65 @@ /// </summary> [Category("閫氱敤閰嶇疆")] [Description("璁惧鏄惁鍚敤")] - public bool IsEnabled { get; set; } = false; + public bool IsEnabled { get; set; } = false; + + [Browsable(false)] + public virtual string DriverType { get; set; } = ""; + + [Category("鏃ュ織閰嶇疆")] + [Description("鏃ュ織璁板綍鐩綍")] + [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] + public string LogPath { get; set; } + + [Category("鏃ュ織閰嶇疆")] + [Description("true锛氬惎鐢ㄦ棩蹇楄褰� false锛氫笉鍚敤鏃ュ織璁板綍")] + public bool IsEnableLog { get; set; } = false; + + public virtual List<string> GetHalconToolPathList() + { + return new List<string>(); + } + } + + public class InitialMonitorConfigBase : InitialConfigBase, IMonitorInitialConfig, IHalconToolPath + { + [Category("鐩戝惉璁剧疆")] + [Description("true:鍚敤鐩戝惉 false锛氫笉鍚敤鐩戝惉")] + public bool IsEnableMonitor { get; set; } = true; + + [Category("鐩戝惉璁剧疆")] + [Description("鎵弿闂撮殧鏃堕棿锛屽崟浣嶏細ms")] + public int ScanInterval { get; set; } = 100; + + [Category("鐩戝惉璁剧疆")] + [Description("瓒呮椂璁剧疆锛屽崟浣嶏細ms")] + public int Timeout { get; set; } = 500; + + [Category("鐩戝惉璁剧疆")] + [Description("璀︽姤閰嶇疆鍒楄〃")] + [TypeConverter(typeof(CollectionCountConvert))] + [Editor(typeof(ComplexCollectionEditor<WarningSet>), typeof(UITypeEditor))] + public List<WarningSet> WarningSetCollection { get; set; } = new List<WarningSet>(); + + [Category("鐩戝惉璁剧疆")] + [Description("鐩戝惉鎿嶄綔閰嶇疆闆嗗悎")] + [TypeConverter(typeof(CollectionCountConvert))] + [Editor(typeof(ComplexCollectionEditor<MonitorSet>), typeof(UITypeEditor))] + public List<MonitorSet> MonitorSetCollection { get; set; } = new List<MonitorSet>(); + + public new virtual List<string> GetHalconToolPathList() + { + return MonitorSetCollection.SelectMany(u => + { + if (u.OpConfig is IHalconToolPath) + { + return (u.OpConfig as IHalconToolPath).GetHalconToolPathList(); + } + else + { + return new List<string>(); + } + }).ToList(); + } } } -- Gitblit v1.8.0