From b5e7fa2db4ac36fdb7bf9fd330d12a72ade9d483 Mon Sep 17 00:00:00 2001 From: patrick.xu <patrick.xu@broconcentric.com> Date: 星期日, 24 一月 2021 15:07:26 +0800 Subject: [PATCH] 0124 --- src/Bro.M071.Process/M071Config.cs | 101 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 99 insertions(+), 2 deletions(-) diff --git a/src/Bro.M071.Process/M071Config.cs b/src/Bro.M071.Process/M071Config.cs index 08a33a7..e9f1b94 100644 --- a/src/Bro.M071.Process/M071Config.cs +++ b/src/Bro.M071.Process/M071Config.cs @@ -1,5 +1,6 @@ 锘縰sing Bro.Common.Base; using Bro.Common.Helper; +using Bro.Common.Interface; using Bro.Common.Model; using Bro.Process; using System; @@ -91,13 +92,13 @@ //[Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] //public string ResultDataSaveFolder { get; set; } = ""; - [Category("鍥剧墖淇濆瓨閰嶇疆")] + [Category("鍗曢敭鍥剧墖淇濆瓨閰嶇疆")] [Description("鍗曢敭鍥剧墖淇濆瓨閰嶇疆")] [TypeConverter(typeof(ComplexObjectConvert))] [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))] public ImageSaveOption ImageSaveOption { get; set; } = new ImageSaveOption(); - [Category("鍥剧墖淇濆瓨閰嶇疆")] + [Category("鍗曢敭鍥剧墖淇濆瓨閰嶇疆")] [Description("鍗曢敭鍥剧墖淇濆瓨鐩綍璺緞")] [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] public string ImageSaveFolder { get; set; } = ""; @@ -132,7 +133,103 @@ [Category("MES璁剧疆")] [Description("true锛氭暟鎹笂浼犺嚦MES false锛氭暟鎹笉涓婁紶")] + [DisplayName("MES涓婁紶鍚敤")] [ReadOnly(true)] public bool IsEnableMESUpload { get; set; } = false; + + [Category("MES璁剧疆")] + [Description("true锛氭娴嬬敤鎴风櫥褰� false锛氫笉寮哄埗鐢ㄦ埛鐧诲綍")] + [DisplayName("鐢ㄦ埛鐧诲綍妫�娴�")] + [Browsable(false)] + public bool IsUserLoginCheck { get; set; } = false; + + [Category("MES璁剧疆")] + [Description("MES涓婁紶璺緞")] + [DisplayName("MES涓婁紶璺緞")] + public string MESURL { get; set; } = ""; + + [Category("MES璁剧疆")] + [Description("绔欑偣缂栫爜")] + [DisplayName("绔欑偣缂栫爜")] + public string StationCode { get; set; } = ""; + + [Category("MES璁剧疆")] + [Description("Project缂栫爜")] + [DisplayName("Project缂栫爜")] + public string ProjectCode { get; set; } = ""; + + [Category("MES璁剧疆")] + [Description("绾夸綋缂栫爜")] + [DisplayName("绾夸綋缂栫爜")] + public string LineCode { get; set; } = ""; + + [Category("MES璁剧疆")] + [Description("楠岃瘉褰撳墠鍏佽鏂板娆℃暟[FALSE=涓嶉獙璇� TRUE=闄愬埗涓ゆ浠ヤ笅(鍖呭惈涓ゆ)]")] + [DisplayName("澶氭楠岃瘉寮�鍏�")] + public bool IsDisableMultipleCheckTimes { get; set; } + + [Category("MES璁剧疆")] + [Description("閿悕鍜屼笂浼犱唬鐮佹槧灏勫叧绯�")] + [DisplayName("閿悕鏄犲皠")] + [TypeConverter(typeof(CollectionCountConvert))] + [Editor(typeof(ComplexCollectionEditor<KeyCodeMap>), typeof(UITypeEditor))] + public List<KeyCodeMap> KeyCodeMappingCollection { get; set; } = new List<KeyCodeMap>(); + + [Category("MES璁剧疆")] + [Description("MES鏁版嵁璇︾粏璁板綍寮�鍏�")] + [DisplayName("MES鏃ュ織寮�鍏�")] + public bool IsEnableMESLog { get; set; } = false; + + [Category("澶嶄綅璁剧疆")] + [Description("澶у浣嶉渶瑕佷俊鍙锋寔缁椂闂达紝澶嶄綅淇″彿鎸佺画瓒呭嚭璇ユ椂闂存墽琛屽ぇ澶嶄綅锛屽崟浣嶏細s")] + [DisplayName("澶у浣嶆寔缁俊鍙烽暱搴�")] + public int FullResetRequiredDuration { get; set; } = 3; + } + + [Device("Demostration", "Demo鎿嶄綔閰嶇疆", EnumHelper.DeviceAttributeType.OperationConfig)] + public class DemostrationOperationConfig : OperationConfigBase, IHalconToolPath + { + [Category("缁勫悎鎿嶄綔閰嶇疆闆嗗悎")] + [Description("缁勫悎鎿嶄綔閰嶇疆闆嗗悎")] + [TypeConverter(typeof(CollectionCountConvert))] + [Editor(typeof(ComplexCollectionEditor<OperationCombination>), typeof(UITypeEditor))] + public List<OperationCombination> DemoOperations { get; set; } = new List<OperationCombination>(); + + public List<string> GetHalconToolPathList() + { + return DemoOperations.SelectMany(d => d.GetHalconToolPathList()).ToList(); + } + } + + public class OperationCombination : IComplexDisplay, IHalconToolPath + { + [Category("杩愬姩鏈烘瀯閰嶇疆")] + [Description("杩愬姩鏈烘瀯閰嶇疆")] + [TypeConverter(typeof(ComplexObjectConvert))] + [Editor(typeof(IOperationConfigByDeviceEditor), typeof(UITypeEditor))] + public DeviceOpBind MotionOp { get; set; } = new DeviceOpBind(); + + [Category("鐩告満鍜屾搷浣滈厤缃�")] + [Description("鐩告満鍜屾搷浣滈厤缃�")] + [TypeConverter(typeof(ComplexObjectConvert))] + [Editor(typeof(IOperationConfigByDeviceEditor), typeof(UITypeEditor))] + public DeviceOpBind CameraOp { get; set; } = new DeviceOpBind(); + + public string GetDisplayText() + { + return MotionOp.GetDisplayText() + "\t" + CameraOp.GetDisplayText(); + } + + public List<string> GetHalconToolPathList() + { + if (CameraOp.OpConfig is IHalconToolPath path) + { + return path.GetHalconToolPathList(); + } + else + { + return new List<string>(); + } + } } } -- Gitblit v1.8.0