ComponetInfo.cs
4.3 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
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
using System;
using System.Collections.Generic;
using System.Drawing;
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 = "";
Text = "";
}
public int Id { get; set; }
/// <summary>
///位号/编号
/// </summary>
[CSVAttribute("Num", true,"位号", "编号", "Part Number")]
public string TagNo { get; set; }
/// <summary>
/// 物料编码/元器件名称
/// </summary>
[CSVAttribute("Code", true, "物料编码", "元器件名称", "Name", "Material Code")]
public string PN { get; set; }
/// <summary>
///位置
/// </summary>
[CSVAttribute("PNum", true, "料盘位置", "位置", "PositionNum", "Lot")]
public string PositionNum { get; set; }
/// <summary>
///数量
/// </summary>
[CSVAttribute("Count", true, "数量", "Quantity")]
public string ComCount { get; set; }
/// <summary>
///X坐标
/// </summary>
[CSVAttribute("PositionX", false, "X坐标", "X")]
public double PositionX { get; set; }
/// <summary>
///Y坐标
/// </summary>
[CSVAttribute("PositionY", false, "Y坐标", "Y")]
public double PositionY { get; set; }
/// <summary>
///注意事项
/// </summary>
[CSVAttribute("Notes", false, "注意事项", "Note")]
public string Notes { get; set; }
/// <summary>
///元器件描述
/// </summary>
[CSVAttribute("Describe", false, "元器件描述", "Description")]
public string ComponentDes { get; set; }
/// <summary>
///投影文字
/// </summary>
[CSVAttribute("Text", "投影文字", false)]
public string Text { 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(string pn,string posNum,string TagNo)
{
if (String.IsNullOrEmpty(this.TagNo))
{
if (this.PN.Equals(pn) && this.PositionNum.Equals(posNum))
{
return true;
}
}
else if (this.TagNo.Equals(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)&&this.PositionNum.Equals(point.PositionNum))
{
return true;
}
return false;
}
public bool IsSameComAndCount(SMTPointInfo point)
{
if (this.PN.Equals(point.PN) && int.Parse(this.ComCount) >0)
{
return true;
}
return false;
}
public string toStr()
{
return $"ID:{Id},Pn:{PN},TagNo:{TagNo},X:{PositionX},Y:{PositionY},Des:{ComponentDes},Count:{ComCount},PositionNum:{PositionNum}";
}
}
}