自动化立体仓库 - WCS系统
lsh
2024-06-06 ae0f47d70a1a4d539bf7cb0d69e0375d91ef3f7c
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
package com.zy.core.model.protocol;
 
import com.zy.asrs.entity.BasJar;
import com.zy.core.enums.JarStatusType;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
 
/**
 * Created by vincent on 2020/8/7
 */
@Slf4j
@Data
public class JarProtocol {
 
    /**
     * 设备号
     */
    private Integer jarNo;
 
    /**
     * 1 = 联机模式
     * 0 = 脱机模式
     */
    public Integer mode;
 
    /**
     IDLE(0, "空闲"),
     MOVING(1, "作业中"),
     SOS(2, "报警"),
     WAITING(3, "任务完成等待WCS确认"),
     */
    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;
 
 
    /**
     * 异常码
     */
    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 BasJar toSqlModel(BasJar basJar){
        if (jarErr!=null) {
            basJar.setJarErr(jarErr);
        }
        basJar.setJarMode(mode);
//        if (basSte.getPakMk().equals("N")) {
//            if (!Cools.isEmpty(row)) {
//                basSte.setRow(row.intValue());
//            }
//            if (!Cools.isEmpty(bay)) {
//                basSte.setBay(bay.intValue());
//            }
//            if (!Cools.isEmpty(lev)) {
//                basSte.setLev(lev.intValue());
//            }
//        }
        return basJar;
    }
 
}