领胜LDS 键盘AOI检测项目
wells.liu
2020-07-04 4cb676856f0c791ffcbef569c0ca8195bf8b0938
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
using Bro.Common.Helper;
using System.ComponentModel;
 
namespace Bro.Common.Model
{
    public class VelocityParams : IComplexDisplay
    {
        [Category("速度参数")]
        [Description("运行速度")]
        [DisplayName("运行速度")]
        public float Velocity { get; set; }
 
        [Category("速度参数")]
        [Description("加速度")]
        [DisplayName("加速度")]
        public float Acceleration { get; set; }
 
        [Category("速度参数")]
        [Description("减速度")]
        [DisplayName("减速度")]
        public float Deceleration { get; set; }
 
        [Category("Jog速度参数")]
        [Description("Jog速度")]
        [DisplayName("Jog速度")]
        public float JogVelocity { get; set; }
 
        public bool Equals(VelocityParams dest)
        {
            return Velocity == dest.Velocity
                && Acceleration == dest.Acceleration
                && Deceleration == dest.Deceleration;
        }
 
        public bool IsValid()
        {
            return Velocity <= 0 || Acceleration <= 0 || Deceleration <= 0;
        }
 
        public string GetDisplayText()
        {
            return $"Vel:{Velocity.ToString("f2")},Acc:{Acceleration.ToString("f2")},Dec:{Deceleration.ToString("f2")}";
        }
    }
}