InOutParam.cs
4.7 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
using log4net;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace OnlineStore.DeviceLibrary
{
public class InOutParam
{
public InOutParam()
{
ACStoreP = null;
this.PosInfo = new InOutPosInfo("", "");
MoveP = null;
}
public InOutParam(InOutPosInfo inoutInfo, LineMoveP linePosition = null)
{
ACStoreP = null; ;
MoveP = linePosition;
this.PosInfo = inoutInfo;
}
private ShelfPosition ACStoreP = null;
public ShelfPosition GetACPosition()
{
try
{
if (ACStoreP == null)
{
string posId = PosInfo != null ? PosInfo.ShelfPosId : "";
ACStoreP = CSVPositionReader<ShelfPosition>.GetPositon(posId);
}
}
catch (Exception ex)
{
LogUtil.error("GetACPosition 出错:" + ex.ToString());
}
return ACStoreP;
}
public InOutPosInfo PosInfo { get; set; }
public LineMoveP MoveP { get; set; }
public ShelfPosition LocationPos = null;
public bool LoadLocationP(int storeID)
{
if (LocationPos == null)
{
string posId = EquipManager.GetLocationPosId(storeID, PosInfo.PlateW);
if (!String.IsNullOrEmpty(posId))
{
LocationPos = CSVPositionReader<ShelfPosition>.GetPositon(posId);
}
}
if (LocationPos == null)
{
LogUtil.info(PosInfo.ToStr() + " 出库 不需要定位 ");
return false;
}
else
{
LogUtil.info(PosInfo.ToStr() + " 出库前 需要定位【" + LocationPos.PositionNum + "】 ");
return true;
}
}
}
public class InOutPosInfo
{
public InOutPosInfo(string barcode, string shelfPosId, int platew =0, int plateh =0,bool IsNg=false,string boxPosId="", bool urgentReel = false , bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0)
{
this.barcode = barcode;
this.ShelfPosId = shelfPosId;
this.PlateW = platew;
this.PlateH = plateh;
this.urgentReel = urgentReel;
this.cutReel = cutReel;
this.smallReel = smallReel;
this.rfid = rfid;
this.rfidLoc = rfidLoc;
this.IsNg = IsNg;
this.BoxPosId = boxPosId;
}
/// <summary>
/// 物品二维码
/// </summary>
public string barcode { get; set; }
/// <summary>
/// 料加上的库位号
/// </summary>
public string ShelfPosId { get; set; }
/// <summary>
/// 料仓里的库位号
/// </summary>
public string BoxPosId { get; set; }
/// <summary>
/// 料盘宽
/// </summary>
public int PlateW { get; set; }
/// <summary>
/// 料盘高
/// </summary>
public int PlateH { get; set; }
/// <summary>
/// urgentReel: true 表示紧急料,需要出到料串上
/// </summary>
public bool urgentReel { get; set; }
/// <summary>
/// cutReel: true 表示分盘料,需要出到料串上
/// </summary>
public bool cutReel { get; set; }
/// <summary>
/// smallReel: true 小料(7x8),放置到小料架上
/// </summary>
public bool smallReel { get; set; }
/// <summary>
/// rfid: 分配的料架RFID
/// </summary>
public string rfid { get; set; }
/// <summary>
/// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线,
/// 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线;
/// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
/// </summary>
public int rfidLoc { get; set; }
/// <summary>
/// 是否是去NG箱的料
/// </summary>
public bool IsNg { get; set; }
public string ToStr()
{
return " [" + barcode + "] [" + ShelfPosId + "] [" + PlateW + "x" + PlateH + "],boxPos["+BoxPosId+"],urgentReel [" + urgentReel
+ "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "]";
}
}
}