| | |
| | | using Bro.Common.Interface; |
| | | using 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; |
| | |
| | | /// </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(); |
| | | } |
| | | } |
| | | } |