TrayInfo.cs
3.8 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
using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 托盘信息
/// </summary>
public class TrayInfo
{
public TrayInfo(int trayNum, bool isFull, int inOrOut = 0, InOutParam inoutParam = null,string ngMsg = "")
{
this.TrayCode = trayNum;
this.IsFull = isFull;
this.InOrOutStore = inOrOut;
if (inoutParam == null)
{
inoutParam = new InOutParam();
}
this.inoutPar = inoutParam;
ShowMsg = ngMsg;
}
public string ToStr()
{
string type = "无操作";
if (InOrOutStore.Equals(1))
{
type = inoutPar.InStoreNg ? "入料失败:" + ShowMsg : "入料:" + "" + inoutPar.ToStr() + "";
}
else if (InOrOutStore.Equals(2))
{
string outType = "出料:";
if (inoutPar.urgentReel)
{
outType = "紧急料:";
}else if (inoutPar.cutReel)
{
outType = "分盘料:";
}
type = outType + inoutPar.ToStr();
}
//return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
// "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
return "托盘 [" + TrayCode + "] [" + LastUpdateTime.ToLongTimeString() + "] [" + (IsFull ? "有料" : "空") + "] [" + type + "]"+"["+ ((inoutPar?.ManualJudgeNG ?? false) ? "判定NG" : "判定OK") + "]["+((inoutPar?.Corrected??false)?"纠正OK":"未纠正")+"]";
}
/// <summary>
/// 夹具编码值(1-32?)
/// </summary>
public int TrayCode = -1;
/// <summary>
/// 是否有料盘,true=有料盘
/// </summary>
public bool IsFull = false;
/// <summary>
/// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
/// </summary>
public int InOrOutStore = 0;
public string ShowMsg = "";
public DateTime LastUpdateTime = DateTime.Now;
private InOutParam inoutPar = null;
public InOutParam InoutPar
{
get
{
if (inoutPar == null)
{
inoutPar = new InOutParam();
}
inoutPar.TrayNumber = TrayCode;
return inoutPar;
}
set
{
this.inoutPar = value;
}
}
}
/// <summary>
/// 托盘上的物料的类型
/// </summary>
internal class ReelType
{
/// <summary>
/// 等待入库料盘
/// </summary>
internal static int InStore = 1;
/// <summary>
/// 料仓出库料盘
/// </summary>
internal static int OutStore = 2;
}
public class TrayDisableInfo
{
public TrayDisableInfo()
{
}
public TrayDisableInfo(int trayNum,string deviceName,string describle)
{
this.TrayCode = trayNum;
this.DDeviceName = deviceName;
this.DDescribe = describle;
DisableTime = DateTime.Now;
}
public int TrayCode { get; set; } = -1;
public string DDeviceName { get; set; } = "";
public string DDescribe { get; set; } = "";
public DateTime DisableTime { get; set; }
public string ToStr()
{
return $"托盘 [{TrayCode }] [{DisableTime.ToLongTimeString() }] [{DDeviceName} [{DDescribe}]";
}
}
}