From ff18fa3c007656bd37cad91fac9a9cb03f4070b8 Mon Sep 17 00:00:00 2001 From: patrick <patrick.xu@broconcentric.com> Date: 星期日, 20 十月 2019 14:13:16 +0800 Subject: [PATCH] 1. 修改SeerAGV驱动通信代码 2. 修改机器人通信部分代码 3. 取消原有流程任务队列模式,使用即时方法调用。 --- src/A032.Process/ProcessConfig.cs | 134 ++++++++++++++++++++++---------------------- 1 files changed, 66 insertions(+), 68 deletions(-) diff --git a/src/A032.Process/ProcessConfig.cs b/src/A032.Process/ProcessConfig.cs index 3640397..c7cbb46 100644 --- a/src/A032.Process/ProcessConfig.cs +++ b/src/A032.Process/ProcessConfig.cs @@ -46,6 +46,12 @@ [TypeConverter(typeof(CollectionCountConvert))] [Editor(typeof(ComplexCollectionEditor<HikCameraInitialConfig>), typeof(UITypeEditor))] public List<HikCameraInitialConfig> CameraConfigCollection { get; set; } = new List<HikCameraInitialConfig>(); + + [Category("璁惧閰嶇疆")] + [Description("AGV灏忚溅璁惧缁戝畾閰嶇疆锛岄厤缃粦瀹氱殑AGV锛屾満鍣ㄤ汉鍜岀浉鏈轰俊鎭�")] + [TypeConverter(typeof(CollectionCountConvert))] + [Editor(typeof(ComplexCollectionEditor<AGVBindUnit>), typeof(UITypeEditor))] + public List<AGVBindUnit> AGVBindCollection { get; set; } = new List<AGVBindUnit>(); #endregion #region 鎿嶄綔閰嶇疆 @@ -55,15 +61,15 @@ //[Editor(typeof(MonitorSetBindEditor), typeof(UITypeEditor))] //public Dictionary<string, MonitorSet> PLCMonitorSet { get; set; } = new Dictionary<string, MonitorSet>(); - ///// <summary> - ///// 鎿嶄綔閰嶇疆鐨勫瓧鍏搁泦鍚� - ///// Key锛歁ethodCode锛孷alue锛氭搷浣滈厤缃� - ///// </summary> - //[Category("鎿嶄綔閰嶇疆")] - //[Description("鎿嶄綔閰嶇疆闆嗗悎")] - //[TypeConverter(typeof(CollectionCountConvert))] - //[Editor(typeof(OperationConfigBindEditor), typeof(UITypeEditor))] - //public Dictionary<string, IOperationConfig> ProcessOpConfigDict { get; set; } = new Dictionary<string, IOperationConfig>(); + /// <summary> + /// 鎿嶄綔閰嶇疆鐨勫瓧鍏搁泦鍚� + /// Key锛歁ethodCode锛孷alue锛氭搷浣滈厤缃� + /// </summary> + [Category("鎿嶄綔閰嶇疆")] + [Description("榛樿鎿嶄綔閰嶇疆闆嗗悎")] + [TypeConverter(typeof(CollectionCountConvert))] + [Editor(typeof(OperationConfigBindEditor), typeof(UITypeEditor))] + public Dictionary<string, IOperationConfig> ProcessOpConfigDict { get; set; } = new Dictionary<string, IOperationConfig>(); //[Category("鐩戝惉鍜屾搷浣滈厤缃�")] //[Description("鐩戝惉鎿嶄綔閰嶇疆闆嗗悎")] @@ -96,18 +102,20 @@ [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] public string LogPath { get; set; } - [Category("鏃ュ織閰嶇疆")] - [Description("GRR鏃ュ織鏂囦欢澶硅矾寰�")] - [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] - public string GRRLogPath { get; set; } + //[Category("鏃ュ織閰嶇疆")] + //[Description("GRR鏃ュ織鏂囦欢澶硅矾寰�")] + //[Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] + //public string GRRLogPath { get; set; } [Category("CSV鏂囦欢閰嶇疆")] [Description("鏄惁鍋欳SV鏂囦欢杈撳嚭")] + [Browsable(false)] public bool IsCSVOutput { get; set; } = false; [Category("CSV鏂囦欢閰嶇疆")] [Description("CSV杈撳嚭鏂囦欢澶硅矾寰�")] [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] + [Browsable(false)] public string CSVFilePath { get; set; } #endregion @@ -117,9 +125,9 @@ //[Editor(typeof(ComplexCollectionEditor<WarningSet>), typeof(UITypeEditor))] //public List<WarningSet> WarningSets { get; set; } = new List<WarningSet>(); - [Category("PLC鐩稿叧閰嶇疆")] - [Description("浜у搧鍑哄垪鏃舵槸鍚︽湁纭鍔ㄤ綔銆倀rue锛氭湁纭鍔ㄤ綔锛岀‘璁ゅ悗浜у搧鍑哄垪锛沠alse锛氭病鏈夌‘璁ゅ姩浣滐紝鏌ヨ鏃朵骇鍝佸嚭鍒�")] - public bool IsConfirmWhenProductionDone { get; set; } = false; + //[Category("PLC鐩稿叧閰嶇疆")] + //[Description("浜у搧鍑哄垪鏃舵槸鍚︽湁纭鍔ㄤ綔銆倀rue锛氭湁纭鍔ㄤ綔锛岀‘璁ゅ悗浜у搧鍑哄垪锛沠alse锛氭病鏈夌‘璁ゅ姩浣滐紝鏌ヨ鏃朵骇鍝佸嚭鍒�")] + //public bool IsConfirmWhenProductionDone { get; set; } = false; [Category("NG鍥剧墖淇濆瓨閰嶇疆")] [Description("NG鍥剧墖淇濆瓨鐩綍")] @@ -140,8 +148,48 @@ [Category("璺緞鐩稿叧")] [Description("鍚勪綅缃爣瀹氱煩闃�")] [TypeConverter(typeof(CollectionCountConvert))] - [Editor(typeof(ComplexCollectionEditor<PositionMatrix>), typeof(UITypeEditor))] - public List<PositionMatrix> MatrixCollection { get; set; } = new List<PositionMatrix>(); + [Editor(typeof(ComplexCollectionEditor<PositionVisionConfig>), typeof(UITypeEditor))] + public List<PositionVisionConfig> VisionConfigCollection { get; set; } = new List<PositionVisionConfig>(); + + [Category("瑙嗚閰嶇疆")] + [Description("鏄惁鍚敤瑙嗚寮曞")] + public bool IsEnableVisionGuide { get; set; } = false; + + /// <summary> + /// 绌篢ray涓婃枡闃堝�硷紝AGV涓婄殑绌簍ray鏁伴噺涓嶅ぇ浜庤鏁板�兼椂锛孉GV鍙互鎵ц绌篢ray涓婃枡浠诲姟 + /// </summary> + [Category("闃堝�艰缃�")] + [Description("绌篢ray涓婃枡闃堝�硷紝AGV涓婄殑绌簍ray鏁伴噺涓嶅ぇ浜庤鏁板�兼椂锛孉GV鍙互鎵ц绌篢ray涓婃枡浠诲姟")] + public int AGV_EmptyTrayThreshold { get; set; } = 0; + + /// <summary> + /// 婊ray涓嬫枡闃堝�硷紝AGV涓婄殑婊ray鏁伴噺涓嶅皬浜庤鏁板�兼椂锛孉GV鍙互鎵ц婊ray涓嬫枡浠诲姟 + /// </summary> + [Category("闃堝�艰缃�")] + [Description("婊ray涓嬫枡闃堝�硷紝AGV涓婄殑婊ray鏁伴噺涓嶅皬浜庤鏁板�兼椂锛孉GV鍙互鎵ц婊ray涓嬫枡浠诲姟")] + public int AGV_FullTrayThreshold { get; set; } = 10; + + /// <summary> + /// 浜х嚎蹇欐椂鎷嶇収纭绛夊緟闂撮殧锛屼互绉掍负鍗曚綅 + /// </summary> + [Category("闃堝�艰缃�")] + [Description("浜х嚎蹇欐椂鎷嶇収纭绛夊緟闂撮殧锛屼互绉掍负鍗曚綅")] + public int LineBusyWaitInterval { get; set; } = 60; + + /// <summary> + /// 浜х嚎蹇欐椂鎷嶇収閲嶈瘯娆℃暟 + /// </summary> + [Category("闃堝�艰缃�")] + [Description("浜х嚎蹇欐椂鎷嶇収閲嶈瘯娆℃暟")] + public int LineBusyRetryTimes { get; set; } = 10; + + [Category("闃堝�艰缃�")] + [Description("鏈哄彴鍘嬫満婊ray鏁伴噺")] + public int Machine_FullTrayNum { get; set; } + + [Category("闃堝�艰缃�")] + [Description("鏈哄彴鍘嬫満绌篢ray鏁伴噺")] + public int Machine_EmptyTrayNum { get; set; } #region Ignore [Browsable(false)] @@ -190,55 +238,5 @@ [JsonIgnore] public virtual bool IsDBSave { get; set; } = false; #endregion - } - - public class PathPosition : IComplexDisplay - { - [Category("瀵艰埅璺緞")] - [Description("璺緞鑺傜偣浠g爜")] - public string PositionCode { get; set; } - - [Category("瀵艰埅璺緞")] - [Description("璺緞鑺傜偣鎻忚堪")] - public string Description { get; set; } - - public string GetDisplayText() - { - return $"{PositionCode}-{Description}"; - } - } - - public class PositionMatrix : IComplexDisplay - { - [Category("浣嶇疆鐭╅樀")] - [Description("浣嶇疆浠g爜")] - [TypeConverter(typeof(PositionCodeConverter))] - public string PositionCode { get; set; } - - [Category("浣嶇疆鐭╅樀")] - [Description("璇ヤ綅缃爣瀹氱煩闃�")] - [TypeConverter(typeof(SimpleCollectionConvert<double>))] - public List<double> Matrix { get; set; } = new List<double>(); - - public string GetDisplayText() - { - return $"{PositionCode}:{string.Join(",", Matrix)}"; - } - } - - public class PositionCodeConverter : ComboBoxItemTypeConvert - { - public override void GetConvertHash() - { - using (var scope = GlobalVar.Container.BeginLifetimeScope()) - { - var config = scope.Resolve<ProcessConfig>(); - - config.PositionCollection.ForEach(p => - { - _hash[p.PositionCode] = $"{p.PositionCode}-{p.Description}"; - }); - } - } } } -- Gitblit v1.8.0