ComponetInfo.cs
3.1 KB
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TSA_V.DeviceLibrary;
using TSA_V.LoadCSVLibrary;
namespace TSA_V.LoadCSVLibrary
{
public class ComponetInfo : CSVBase
{
public ComponetInfo()
{
PositionX = 0;
PositionY = 0;
Notes = "";
ComponentDes = "";
}
public int Id { get; set; }
/// <summary>
///位号/编号
/// </summary>
[CSVAttribute("Num", true,"位号", "编号")]
public string TagNo { get; set; }
/// <summary>
/// 物料编码/元器件名称
/// </summary>
[CSVAttribute("Code", true, "物料编码", "元器件名称", "Name")]
public string PN { get; set; }
/// <summary>
///元器件描述
/// </summary>
[CSVAttribute("Describe", "元器件描述", false )]
public string ComponentDes { get; set; }
/// <summary>
///数量
/// </summary>
[CSVAttribute("Count", "数量", true)]
public int ComCount { get; set; }
/// <summary>
///位置
/// </summary>
[CSVAttribute("PNum", true, "料盘位置", "位置", "PositionNum")]
public string PositionNum { get; set; }
/// <summary>
///X坐标
/// </summary>
[CSVAttribute("PositionX", "X坐标", false)]
public double PositionX { get; set; }
/// <summary>
///Y坐标
/// </summary>
[CSVAttribute("PositionY", "Y坐标", false)]
public double PositionY { get; set; }
/// <summary>
///注意事项
/// </summary>
[CSVAttribute("Notes", "注意事项", false)]
public string Notes { get; set; }
public int GetSortPosition()
{
try
{
return Convert.ToInt32(PositionNum);
}
catch (Exception ex)
{
}
return 0;
}
public bool IsSameCom(ComponetInfo com)
{
if (String.IsNullOrEmpty(this.TagNo))
{
if (this.Id <= 0)
{
if (this.PN.Equals(com.PN) && this.PositionNum.Equals(com.PositionNum))
{
return true;
}
}
else if (this.Id.Equals(com.Id))
{
return true;
}
}
else if (this.TagNo.Equals(com.TagNo))
{
return true;
}
return false;
}
public bool IsSameCom(SMTPointInfo point)
{
if (String.IsNullOrEmpty(this.TagNo))
{
if (this.PN.Equals(point.PN) )
{
return true;
}
}
else if (this.TagNo.Equals(point.TagNo))
{
return true;
}
return false;
}
}
}