From 9a9fb7a9e71b45bc3b91a0c48373e12d385680b8 Mon Sep 17 00:00:00 2001 From: xcd <834800634@qq.com> Date: 星期三, 01 七月 2020 19:44:31 +0800 Subject: [PATCH] Merge branch 'master' of http://gitblit.broconcentric.com:8088/r/M071 --- src/Bro.Device.GTSCard/GTSCardConfig.cs | 301 ++++++++++++++++++++----------------------------- 1 files changed, 122 insertions(+), 179 deletions(-) diff --git a/src/Bro.Device.GTSCard/GTSCardConfig.cs b/src/Bro.Device.GTSCard/GTSCardConfig.cs index de7aad9..5c843a4 100644 --- a/src/Bro.Device.GTSCard/GTSCardConfig.cs +++ b/src/Bro.Device.GTSCard/GTSCardConfig.cs @@ -1,6 +1,7 @@ 锘縰sing Bro.Common.Base; using Bro.Common.Helper; using Bro.Common.Interface; +using Bro.Common.Model; using Newtonsoft.Json; using System; using System.Collections.Generic; @@ -39,20 +40,11 @@ [Description("CardNum锛氬崱鍙�")] public int CardNum { get; set; } - //[Category("鏉垮崱閰嶇疆")] - //[Description("IO鍗″彿")] - //public int IOCardNum { get; set; } - [Category("鏉垮崱閰嶇疆")] [DisplayName("鍒濆閰嶇疆鏂囦欢璺緞")] [Description("InitialConfigFilePath锛氬垵濮嬮厤缃枃浠惰矾寰�")] [Editor(typeof(FileDialogEditor), typeof(UITypeEditor))] public string InitialConfigFilePath { get; set; } - - [Category("IO鎵弿閰嶇疆")] - [DisplayName("鎵弿闂撮殧")] - [Description("ScanInterval锛氭壂鎻忛棿闅旓紝浠ユ绉掍负鍗曚綅")] - public int ScanInterval { get; set; } = 100; [Category("杞撮厤缃�")] [DisplayName("杞存暟閲�")] @@ -76,15 +68,63 @@ [Description("ActionAfterDelay锛氬姩浣滃畬鎴愬悗寤惰繜")] public int ActionAfterDelay { get; set; } = 100; - public bool IsEnableMonitor { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public int MonitorInterval { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public int MonitorTimeout { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public List<IMonitorSet> MonitorSetCollection { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + [Category("璀︽姤閰嶇疆")] + [Description("WarningSetCollection锛氳鎶ラ厤缃垪琛�")] + [DisplayName("璀︽姤閰嶇疆")] + [TypeConverter(typeof(CollectionCountConvert))] + [Editor(typeof(WarningSetsEditor), typeof(UITypeEditor))] + public List<IWarningSet> WarningSetCollection { get; set; } = new List<IWarningSet>(); + + #region IMonitorConfig + [Category("鐩戝惉璁剧疆")] + [Description("MonitorSetCollection锛氱洃鍚搷浣滈厤缃泦鍚�")] + [DisplayName("鐩戝惉閰嶇疆")] + [TypeConverter(typeof(CollectionCountConvert))] + [Editor(typeof(ComplexCollectionEditor<MotionCardMonitorSet>), typeof(UITypeEditor))] + public List<IMonitorSet> MonitorSetCollection { get; set; } = new List<IMonitorSet>(); + + [Category("鐩戝惉璁剧疆")] + [Description("true锛氬惎鍔ㄧ洃鍚� false锛氬叧闂洃鍚�")] + [DisplayName("鐩戝惉鍚敤")] + public bool IsEnableMonitor { get; set; } = true; + + [Category("鐩戝惉璁剧疆")] + [Description("鎵弿闂撮殧鏃堕棿锛屽崟浣嶏細ms")] + [DisplayName("鎵弿闂撮殧")] + public int MonitorInterval { get; set; } = 10; + + [Category("鐩戝惉璁剧疆")] + [Description("瓒呮椂璁剧疆锛屽崟浣嶏細ms")] + [DisplayName("鐩戝惉瓒呮椂")] + public int MonitorTimeout { get; set; } = 500; + + //[Category("浜嬩欢鍦板潃璁剧疆")] + //[Description("浜嬩欢寮�濮嬪湴鍧�锛孭LC鐨勫疄闄呭瘎瀛樺櫒鍦板潃銆傚崄杩涘埗锛屼笉鍖呭惈鍔熻兘鐮併��")] + //[DisplayName("鐩戝惉寮�濮嬪湴鍧�")] + //public int EventStartAddress { get; set; } = 8000; + + //[Category("浜嬩欢鍦板潃璁剧疆")] + //[Description("浜嬩欢鍦板潃闀垮害锛屾渶澶ч暱搴�128")] + //[DisplayName("鐩戝惉闀垮害")] + //public int EventLength { get; set; } = 120; public List<IMonitorSet> GetAllMonitorSet() { - throw new NotImplementedException(); + WarningSetCollection.ForEach(m => m.Source = this.Name); + + MonitorSetCollection.ForEach(m => m.SourceDevice = this.Id); + return MonitorSetCollection; } + #endregion + + //#region IMotion Related + //[Category("杩愬姩閰嶇疆")] + //[Description("杩愬姩杞寸姸鎬侀泦鍚�")] + //[DisplayName("杩愬姩杞寸姸鎬侀泦鍚�")] + //[TypeConverter(typeof(CollectionCountConvert))] + //[Editor(typeof(ComplexCollectionEditor<PLCMotionDefinition_State>), typeof(UITypeEditor))] + //public List<PLCMotionDefinition_State> MotionStateCollection { get; set; } = new List<PLCMotionDefinition_State>(); + //#endregion } /// <summary> @@ -201,7 +241,7 @@ /// <summary> /// 閫熷害鍙傛暟瀵硅薄 /// </summary> - public class VelocityPara + public class VelocityPara { [Category("閫熷害閰嶇疆")] [DisplayName("閫熷害")] @@ -211,12 +251,60 @@ [Category("閫熷害閰嶇疆")] [DisplayName("鍔犻�熷害")] [Description("Acc锛氬姞閫熷害,涓�0鏃惰〃绀轰笉淇敼褰撳墠璁剧疆")] - public double Acc { get; set; } = 0; + public double Acc { get; set; } = 1; [Category("閫熷害閰嶇疆")] [DisplayName("鍑忛�熷害")] - [Description("鍑忛�熷害,涓�0鏃惰〃绀轰笉淇敼褰撳墠璁剧疆銆傚洖鍘熺偣妯″紡鏃惰缃负鏇茬嚎鍙傛暟")] - public double Dec { get; set; } = 0; + [Description("鍑忛�熷害,涓�0鏃惰〃绀轰笉淇敼褰撳墠璁剧疆")] + public double Dec { get; set; } = 1; + } + + /// <summary> + /// 鍥炲師鐐瑰弬鏁板璞� + /// </summary> + public class GoHomePara + { + [Category("鍥炲師鐐瑰弬鏁�")] + [DisplayName("鍥炲師鐐规柟寮�")] + [Description("HomeMode锛氬洖鍘熺偣鏂瑰紡 锛圚OME_MODE_LIMIT = 10; HOME_MODE_LIMIT_HOME = 11; HOME_MODE_LIMIT_INDEX = 12; HOME_MODE_LIMIT_HOME_INDEX = 13;HOME_MODE_HOME = 20;HOME_MODE_HOME_INDEX = 22;HOME_MODE_INDEX = 30;")] + public short HomeMode { get; set; } = 11; + + [Category("鍥炲師鐐瑰弬鏁�")] + [DisplayName("鍥炲師鐐规柟鍚�")] + [Description("HomeDir锛�1 姝e悜锛�-1 璐熷悜")] + public short HomeDir { get; set; } = 1; + + [Category("鍥炲師鐐瑰弬鏁�")] + [DisplayName("鍥炲師鐐规柟鍚�")] + [Description("HomeDir锛�1 姝e悜锛�-1 璐熷悜")] + public short Edge { get; set; } = 0; + + [Category("鍥炲師鐐瑰弬鏁�")] + [DisplayName("鍥炲師鐐规渶浣庨�熷害")] + [Description("LowVelocity锛氶�熷害,涓�0鏃惰〃绀轰笉淇敼褰撳墠璁剧疆")] + public double LowVelocity { get; set; } = 50; + + + [Category("鍥炲師鐐瑰弬鏁�")] + [DisplayName("鍥炲師鐐规渶楂橀�熷害")] + [Description("HighVelocity锛氶�熷害,涓�0鏃惰〃绀轰笉淇敼褰撳墠璁剧疆")] + public double HighVelocity { get; set; } = 50; + + [Category("鍥炲師鐐瑰弬鏁�")] + [DisplayName("鎼滄悳璺濈")] + [Description("SearchHomeDistance锛氭悳鎼滆窛绂�")] + public int SearchHomeDistance { get; set; } = 9999999; + + [Category("鍥炲師鐐瑰弬鏁�")] + [DisplayName("鍋忕Щ璺濈")] + [Description("HomeOffset锛氬亸绉昏窛绂�")] + public int HomeOffset { get; set; } = 0; + + [Category("鍥炲師鐐瑰弬鏁�")] + [DisplayName("璺宠繃姝ラ暱")] + [Description("EscapeStep锛氳烦杩囨闀�")] + public int EscapeStep { get; set; } = 1000; + } /// <summary> @@ -313,6 +401,22 @@ { velocityPara = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("VelocityPara")); + } + } + + private GoHomePara goHomePara = new GoHomePara(); + [Category("杩愬姩閰嶇疆")] + [DisplayName("鍥炲師鐐瑰弬鏁�")] + [Description("GoHomePara锛氶�熷害鍙傛暟")] + [TypeConverter(typeof(ComplexObjectConvert))] + [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))] + public GoHomePara GoHomePara + { + get => goHomePara; + set + { + goHomePara = value; + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("GoHomePara")); } } @@ -511,165 +615,4 @@ public AutoResetEvent MoveSendHandle { get; set; } = new AutoResetEvent(false); } - ///// <summary> - ///// 鐐逛綅绫诲瀷 - ///// </summary> - //public enum PosType - //{ - // /// <summary> - // /// 鐩寸嚎鎻掕ˉ - // /// </summary> - // Line = 1, - // /// <summary> - // /// 鍦嗗姬鎻掕ˉ(鍗婂緞) - // /// </summary> - // CircleRadius, - // /// <summary> - // /// 鍦嗗姬鎻掕ˉ(鍦嗗績) - // /// </summary> - // CircleCenter - //} - - - //public static class GTSCardParameter - //{ - // #region 杩愬姩鍙傛暟 - // public static int Dangliang = 1; - // public static int AxisCount = 2;//杩愬姩杞存暟閲� - // public static short CardNum = Convert.ToInt16(ConfigurationManager.AppSettings["cardNum"]); - // public static short fifo = Convert.ToInt16(ConfigurationManager.AppSettings["fifo"]); - // public static int FlySpeed = Convert.ToInt32(ConfigurationManager.AppSettings["flySpeed"]); - // public static double FlyAcc = Convert.ToDouble(ConfigurationManager.AppSettings["flyAcc"]); - // public static int P2PSpeed = Convert.ToInt32(ConfigurationManager.AppSettings["p2pSpeed"]); - // public static double P2PAcc = Convert.ToDouble(ConfigurationManager.AppSettings["p2pAcc"]); - // public static double P2PDec = Convert.ToDouble(ConfigurationManager.AppSettings["p2pDec"]); - // public static int FreeSpeed = Convert.ToInt32(ConfigurationManager.AppSettings["freeSpeed"]); - // public static int VelEnd = Convert.ToInt32(ConfigurationManager.AppSettings["velEnd"]);//椋炴媿缁撴潫閫熷害 - // public static int HomeSpeed = Convert.ToInt32(ConfigurationManager.AppSettings["homeSpeed"]); - // public static int Loading = Convert.ToInt32(ConfigurationManager.AppSettings["loading"]); - // //public const short cardn = 0;//杩愬姩鎺у埗鍣ㄥ崱鍙� 榛樿涓猴細0 - // //public const short crdn = 1;//鍧愭爣绯诲彿 鍙栧�艰寖鍥达細[1, 2] - // //public const short fifo = 0;//鎻掕ˉ缂撳瓨鍖哄彿 鍙栧�艰寖鍥达細[0, 1]锛岄粯璁ゅ�间负锛�0 - // //public const int flySpeed = 250;//椋炴媿閫熷害 - // //public const double flyAcc = 0.5;//椋炴媿鍔犻�熷害 - // //public const int gocatorSpeed = 150;//3D妫�娴嬭酱杩愬姩閫熷害 - // //public const int p2pSpeed = 250;//P2P閫熷害 - // //public const double p2pAcc = 1;//P2P鍔犻�熷害 - // //public const double p2pDec = 1;//P2P鍑忛�熷害 - // //public const int calibrationSpeed = 10;//鏍囧畾閫熷害 - // //public const int calibrationZ = 19336;//鏍囧畾Z杞撮珮搴� - // //public const int barcodeSpeed = 250;//鏉$爜妫�娴嬭酱杩愬姩閫熷害 - // //public const int freeSpeed = 250;//闈炴娴嬫椂杞磋繍鍔ㄩ�熷害 - // //public const int velEnd = 0;//椋炴媿缁撴潫閫熷害 - // //public const int homeSpeed = 50;//鍥為浂閫熷害 - // //public const int loading = 80000;//涓婃枡浣嶇疆 - // #endregion - - // #region IO - // /// <summary> - // /// 杈撳叆IO榛樿鍊� - // /// </summary> - // public const int InDefaultValue = 0xFFDA; - // /// <summary> - // /// 澶圭揣姘旂几 - // /// </summary> - // public const short EXO_1 = 100;//澶圭揣姘旂几 - // /// <summary> - // /// 鏃ュ厜鐏� - // /// </summary> - // public const short EXO_2 = 101;//鏃ュ厜鐏� - // /// <summary> - // /// 鍏夋簮鍒囨崲 - // /// </summary> - // public const short EXO_3 = 102;//鍏夋簮鍒囨崲 - // /// <summary> - // /// 绾㈢伅 - // /// </summary> - // public const short EXO_4 = 103;//绾㈢伅 - // /// <summary> - // /// 榛勭伅 - // /// </summary> - // public const short EXO_5 = 104;//榛勭伅 - // /// <summary> - // /// 缁跨伅 - // /// </summary> - // public const short EXO_6 = 105;//缁跨伅 - // /// <summary> - // /// 铚傞福鍣� - // /// </summary> - // public const short EXO_7 = 106;//铚傞福鍣� - // /// <summary> - // /// Gocator X - // /// </summary> - // public const short EXO_8 = 107;//Gocator X - - // /// <summary> - // /// 姝i潰鍏�(宸�) - // /// </summary> - // public const short EXO_9 = 108;//姝i潰鍏�(宸�) - - // /// <summary> - // /// 姝i潰鍏�(鍚�) - // /// </summary> - // public const short EXO_10 = 109;//姝i潰鍏�(鍚�) - - // /// <summary> - // /// 姝i潰鍏�(鍙�) - // /// </summary> - // public const short EXO_11 = 110;//姝i潰鍏�(鍙�) - - // /// <summary> - // /// 姝i潰鍏�(鍓�) - // /// </summary> - // public const short EXO_12 = 111;//姝i潰鍏�(鍓�) - - // /// <summary> - // /// Gocator Y - // /// </summary> - // public const short EXO_16 = 115;//Gocator Y - - // /// <summary> - // /// 杈撳嚭IO榛樿鍊� - // /// </summary> - // public const int OutDefaultValue = 0xFFF; - // /// <summary> - // /// 宸﹀惎鍔� - // /// </summary> - // public const short EXI0 = 0;//宸﹁捣鍔� - // /// <summary> - // /// 鍙冲惎鍔� - // /// </summary> - // public const short EXI1 = 1;//鍙宠捣鍔� - // /// <summary> - // /// 鍋滄 - // /// </summary> - // public const short EXI2 = 2;//鍋滄 - // /// <summary> - // /// 澶嶄綅 - // /// </summary> - // public const short EXI3 = 3;//澶嶄綅 - // /// <summary> - // /// 鎬ュ仠 - // /// </summary> - // public const short EXI4 = 4;//鎬ュ仠 - // /// <summary> - // /// 闂ㄥ紑鍏� - // /// </summary> - // public const short EXI5 = 5;//闂ㄥ紑鍏� - // /// <summary> - // /// 瀹夊叏鍏夊箷 - // /// </summary> - // public const short EXI6 = 6;//瀹夊叏鍏夊箷 - - // public const short EXI7 = 7;// - // /// <summary> - // /// 澶圭揣姘旂几鍘熶綅 - // /// </summary> - // public const short EXI8 = 8;//澶圭揣姘旂几鍘熶綅 - // /// <summary> - // /// 澶圭揣姘旂几鍒颁綅 - // /// </summary> - // public const short EXI9 = 9;//澶圭揣姘旂几鍒颁綅 - // #endregion - //} } -- Gitblit v1.8.0