Shelf.cs
1.2 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace DeviceLibrary
{
public enum ShelfType
{
None,
Big,
Small,
Pack,
Reel
}
public class Shelf
{
/// <summary>
/// 料车rfid
/// </summary>
public string RFID { get; set; }
/// <summary>
/// 料车类型
/// </summary>
public ShelfType Type { get; set; }
/// <summary>
/// 料车是否有料
/// </summary>
public bool IsFull { get; set; }
public Shelf(string rfid="",bool isFull=false,ShelfType type = ShelfType.None)
{
RFID = rfid;
Type = type;
IsFull = isFull;
}
public Shelf ToCopy()
{
PropertyInfo[] infos = this.GetType().GetProperties();
Shelf shelf = new Shelf();
PropertyInfo[] infos2 = shelf.GetType().GetProperties();
for (int i = 0; i < infos2.Length; i++)
{
infos2[i].SetValue(shelf, infos[i].GetValue(this));
}
return shelf;
}
}
}