领胜LDS 键盘AOI检测项目
wells.liu
2020-06-26 cfb34dcd56659252216cd88efbe41868e4ac5227
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
using Bro.Common.Base;
using Bro.Common.Helper;
using Bro.Common.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Drawing.Design;
 
namespace Bro.Device.GTSCard
{
    public abstract class GTSCardOperationConfigBase : OperationConfigBase
    {
        ///// <summary>
        ///// 需要操作的PLC项
        ///// </summary>
        //public List<PLCItem> Items { get; set; } = new List<PLCItem>();
    }
 
    //public class GTSCardInitialConfigBase : InitialConfigBase, IMonitorConfig
    //{
    //    [Category("驱动类型")]
    //    [Description("驱动类型")]
    //    [DisplayName("驱动类型")]
    //    [TypeConverter(typeof(PLCTypeConverter))]
    //    public override string DriverType { get; set; }
 
    //    [Category("警报配置")]
    //    [Description("警报配置列表")]
    //    [DisplayName("警报配置")]
    //    [TypeConverter(typeof(CollectionCountConvert))]
    //    [Editor(typeof(WarningSetsEditor), typeof(UITypeEditor))]
    //    public List<WarningSet> WarningSetCollection { get; set; } = new List<WarningSet>();
 
    //    #region IMonitorConfig
    //    [Category("监听设置")]
    //    [Description("监听操作配置集合")]
    //    [DisplayName("监听配置")]
    //    [TypeConverter(typeof(CollectionCountConvert))]
    //    [Editor(typeof(ComplexCollectionEditor<MonitorSet>), 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; } = 100;
 
    //    [Category("监听设置")]
    //    [Description("超时设置,单位:ms")]
    //    [DisplayName("监听超时")]
    //    public int MonitorTimeout { get; set; } = 500;
 
    //    [Category("事件地址设置")]
    //    [Description("事件开始地址,PLC的实际寄存器地址。十进制,不包含功能码。")]
    //    [DisplayName("监听开始地址")]
    //    public int EventStartAddress { get; set; } = 8000;
 
    //    [Category("事件地址设置")]
    //    [Description("事件地址长度,最大长度128")]
    //    [DisplayName("监听长度")]
    //    public int EventLength { get; set; } = 120;
 
    //    public List<IMonitorSet> GetAllMonitorSet()
    //    {
    //        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>
    /// 点位类型
    /// </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>
        /// 正面光(左)
        /// </summary>
        public const short EXO_9 = 108;//正面光(左)
 
        /// <summary>
        /// 正面光(后)
        /// </summary>
        public const short EXO_10 = 109;//正面光(后)
 
        /// <summary>
        /// 正面光(右)
        /// </summary>
        public const short EXO_11 = 110;//正面光(右)
 
        /// <summary>
        /// 正面光(前)
        /// </summary>
        public const short EXO_12 = 111;//正面光(前)
 
        /// <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
    }
}