Tjiny
7 天以前 6d40f7c8b19efc612f824ee7e778d5be9f8382f5
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
155
156
157
158
159
160
161
162
163
164
165
166
using SqlSugar;
 
namespace HH.WCS.Mobox3.RiDong.models
{
    /// <summary>
    /// 线体实体类
    /// </summary>
    [SugarTable("TN_ConveyorLinesInfo")]
    public class ConveyorLinesInfo : BaseModel
    {
        /// <summary>
        /// 线体编号
        /// </summary>
        public string CODE { get; set; }
        
        /// <summary>
        /// 用途
        /// </summary>
        public string PURPOSE { get; set; }
        
        /// <summary>
        /// 目的地
        /// </summary>
        public int DEVICESIGN { get; set; }
        
        /// <summary>
        /// IP地址
        /// </summary>
        public string ADDRESS { get; set; }
        
        /// <summary>
        /// 当前货位信息
        /// </summary>
        public string LOCATION { get; set; }
        
        /// <summary>
        /// 写入起始地址(偏移量)
        /// </summary>
        public int WRITEADDR { get; set; }
        
        /// <summary>
        /// 读取起始地址(偏移量)
        /// </summary>
        public int READADDR { get; set; }
        
        /// <summary>
        /// 取货信号
        /// 0        表示没有请求
        /// plc写1   plc读取到此处线体的托盘号,写1,代表货已经到达此处
        /// wcs写2   wcs循环查询当前线体中间表信息是否为1,如果为1,表示当前货物到达线体,此时wcs完成该托盘的输送线任务以及推送agv任务,推送完后写2
        /// wcs写3   agv申请取货时,往该线体写3
        /// plc写4   plc读取到信号为3时,代表agv在申请取货,此时如果输送线是可取状态写4
        /// wcs写5   wcs读到输送线状态是4的情况下,取货,货物取货完成后写5
        /// plc写0   agv取货完成后,读到信号为5,此时给输送线取货完成信号并清理管道
        /// </summary>
        public int LOADSTATE { get; set; }
            
        /// <summary>
        /// 放货信号
        /// 0        表示没有请求
        /// wcs写1   agv申请放货,往中间表写1
        /// plc写2   plc读到信号为1时,判断自身是否可以放货,如果可以写2
        /// wcs写3   输送线允许卸货,卸货完成后给输送线写3
        /// plc写0   读取信号为3,表示卸货完成,此时给输送线写完成信号以及其他数据,中间表更改为0
        /// </summary>
        public int UNLOADSTATE { get; set; }
        
        /// <summary>
        /// 任务是否创建
        /// 0:创建
        /// 1:未创建
        /// </summary>
        public int TASKCREATE { get; set; } = 0;
        
        /// <summary>
        /// 任务完成信号
        /// 0        没有请求
        /// 1        托盘到达终点,写1,wcs读到1后修改对应的任务为完成状态
        /// 2        异常状态,表明wcs给的托盘和实际的不同,此时怎么处理
        /// </summary>
        public int TASKFINISH { get; set; } = 0;
 
        /// <summary>
        /// 开关门信号
        /// 0        没有请求
        /// wcs写1   agv申请开哪个门,就给对应的门中间表写1
        /// plc写2   plc读取到1后,通知开门,然后中间表写2
        /// plc写3   plc一直循环读取门的状态,当门的状态为开门2的时候,写3通知小车进去
        /// wcs写4   agv进入后发1025信号,通知关门,写4
        /// plc写0   plc读取到关门信号后,写0并关门
        /// </summary>
        public int CONTROLDOOR { get; set; }
        
        /// <summary>
        /// 托盘类型
        /// </summary>
        public string CONTAINERTYPE { get; set; }
 
        /// <summary>
        /// 条形码
        /// </summary>
        public string BARCODE { get; set; }
        
        /// <summary>
        /// 重量
        /// </summary>
        public float WEIGHT { get; set; }
 
        /// <summary>
        /// 是否启用(默认启用,为1)
        /// </summary>
        public int ENABLE { get; set; } = 1;
        
        /// <summary>
        /// 出库方向
        /// </summary>
        public int DIRECTION { get; set; }
        
        /// <summary>
        /// 门禁信号
        /// </summary>
        public int ACCESS { get; set; }
 
        /// <summary>
        /// 获取出库方向
        /// </summary>
        /// <param name="dir"></param>
        /// <returns></returns>
        public static int GetDirection(string dir, string type)
        {
            switch (dir)
            {
                case "产线一":
                    return 1;
                case "产线二":
                    return 2;
                case "产线三":
                    return 3;
                case "产线四":
                    return 4;
                case "国外线":
                    switch (type)
                    {
                        case "整托出库":
                            return 5;
                        case "分拣出库":
                            return 7;
                        default:
                            return 0;
                    }
                case "国内线":
                    switch (type)
                    {
                        case "整托出库":
                            return 6;
                        case "分拣出库":
                            return 8;
                        default:
                            return 0;
                    }
                default:
                    return 0;
            }
        }
    }
}