自动化立体仓库 - WCS系统
#
yxFwq
2024-11-23 ff9b89307d063f29000857a8b8823bfd4b3de4a5
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
167
168
169
170
171
172
173
174
175
176
package com.zy.core.model.protocol;
 
import com.zy.asrs.entity.BasJar;
import com.zy.core.enums.CrnModeType;
import com.zy.core.enums.JarModeType;
import com.zy.core.enums.JarStatusType;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
 
import java.util.Date;
 
/**
 * Created by vincent on 2024/6/21
 */
@Slf4j
@Data
public class JarProtocol {
 
    /**
     * 设备号
     */
    private Integer jarNo;
 
    /**
     * 1 = 联机模式
     * 0 = 脱机模式
     */
    public Integer mode;
 
    public JarModeType modeType;
 
 
    /**
     IDLE(0, "空闲"),
     MOVING(1, "入料中"),
     SOS(2, "硫化中"),
     WAITING1(3, "出料中"),
     WAITING2(4, "停止"),
     WAITING3(5, "进料门打开中"),
     WAITING4(6, "出料门打开中"),
     WAITING5(7, "进料门关闭中"),
     OFF_LINE(8, "出料门关闭中"),
     OTHER(100, "其它"),
     */
    public Short status;
 
    public JarStatusType statusType;
 
    /*
     * 左门状态
     * 进料门
     * */
    private boolean leftDoor;
 
    /*
     * 右门状态
     * 出料门
     * */
    private boolean rightDoor;
 
    /*
     * 左门可开
     * 进料门
     * */
    private boolean leftInEnable;
 
    /*
     * 左门可关
     * 进料门
     * */
    private boolean leftOutEnable;
 
    /*
     * 右门可开
     * 出料门
     * */
    private boolean rightInEnable;
 
    /*
     * 右门可关
     * 出料门
     * */
    private boolean rightOutEnable;
 
    /*
     * 自动
     * */
    private boolean autoing;
 
    /*
     * open the left door
     * 进料门
     * */
    public Integer leftDoorOpen;
 
    /*
     * close the left door
     * 进料门
     * */
    public Integer leftDoorClose;
 
    /*
     * open the right door
     * 出料门
     * */
    public Integer rightDoorOpen;
 
    /*
     * close the right door
     * 出料门
     * */
    public Integer rightDoorClose;
 
    public Float jarTemperature;
    public Float jarPressure;
    public boolean holdingSign = false;
    public boolean openDoorSign = false;
    public boolean closeDoorSign = false;
    public Short upStatus = 0;
 
 
 
    /**
     * 异常码
     */
    public Integer jarErr = 0;
 
    public void setStatus(Short status){
        this.status = status;
        this.statusType = JarStatusType.get(status);
    }
 
    public void setStatus(JarStatusType type){
        this.statusType = type;
        this.status = JarStatusType.get(type).id.shortValue();
    }
 
    public void setMode(Integer mode) {
        this.mode = mode;
        this.modeType = JarModeType.get(mode);
    }
 
    public void setMode(JarModeType type) {
        this.modeType = type;
        this.mode = JarModeType.get(type).id;
    }
 
    public BasJar toSqlModel(BasJar basJar){
        if (jarErr!=null) {
            basJar.setJarErr(jarErr);
        }
        basJar.setJarMode(mode);
        basJar.setJarStatus(status.intValue());
        basJar.setLeftDoor(leftDoor?"Y":"N");
        basJar.setRightDoor(rightDoor?"Y":"N");
        basJar.setLeftInEnable(leftInEnable?"Y":"N");
        basJar.setLeftOutEnable(leftOutEnable?"Y":"N");
        basJar.setRightInEnable(rightInEnable?"Y":"N");
        basJar.setRightOutEnable(rightOutEnable?"Y":"N");
        basJar.setAutoing(autoing?"Y":"N");
        basJar.setJarTemperature(jarTemperature);
        basJar.setJarPressure(jarPressure);
        if (holdingSign){
            basJar.setHoldingTime(new Date());
        }
        if (openDoorSign){
            basJar.setOpenTime(new Date());
        }
        if (closeDoorSign){
            basJar.setCloseTime(new Date());
        }
 
        return basJar;
    }
 
}