#
zjj
2025-03-31 e826b2ba77a95a0412ae6bb5c8a9c1e37afca291
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
package com.zy.asrs.wcs.rcs.model.protocol;
 
import com.zy.asrs.wcs.core.entity.BasConveyorSta;
import lombok.Data;
 
/**
 * 输送线plc单个站点详细信息
 */
@Data
public class StaProtocol implements Cloneable {
 
    // 站点编号
    private Integer siteId;
 
    // ----------------------------------------------------------------
    // 工作号
    private Short workNo = 0;
 
    // ----------------------------------------------------------------
    // 目标站
    private Short staNo;
 
    // ----------------------------------------------------------------
 
    //已完成工作号
    private Short finishWorkNo = 0;
    //空闲
    private boolean idle;
 
    //条码
    private String barcode;
 
    //重量
    private Integer weight;
    // 自动
    private boolean autoing;
 
    // 有物
    private boolean loading;
 
    // 可入
    private boolean inEnable;
 
    // 可出
    private boolean outEnable;
 
    // 空板信号
    private boolean emptyMk;
 
    // 满托盘
    private boolean fullPlt;
 
    // 高
    private boolean high;
 
    // 低
    private boolean low;
 
    // 锁定标记
    private boolean pakMk = true;
 
    // 外形检测 ------------------------------------------------------------------------
 
    // 前超限
    private boolean frontErr;
 
    // 后超限
    private boolean backErr;
 
    // 高超限
    private boolean highErr;
 
    // 左超限
    private boolean leftErr;
 
    // 右超限
    private boolean rightErr;
 
    // 超重
    private boolean weightErr;
 
    // 扫码失败
    private boolean barcodeErr;
 
    // 工作模式
    private Integer workMode;
 
    @Override
    public StaProtocol clone() {
        try {
            return (StaProtocol) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }
 
    public BasConveyorSta toSqlModel(BasConveyorSta station){
        station.setSiteNo(siteId);
        station.setTaskNo(workNo.intValue());
        station.setAutoing(autoing?"Y":"N");
        station.setLoading(loading?"Y":"N");
        station.setInEnable(inEnable?"Y":"N");
        station.setOutEnable(outEnable?"Y":"N");
        station.setWorkMode(workMode);
        station.setStaNo((int) staNo);
        station.setLocType1(0);  // 高低类型{0:未知,1:低库位,2:高库位}
        station.setLocType2(0);  // 宽窄类型{0:未知,1:窄库位,2:宽库位}
        station.setLocType3(0);  // 轻重类型{0:未知,1:轻库位,2:重库位}
        return station;
    }
 
    public Integer getLocType1() {
        if (!this.low  && !this.high){
            return 0;
        }
        if (this.low && !this.high) {
            return 1;
        }else if (this.high && !this.low) {
            return 2;
        }else if (this.high && this.low) {
            return 2;
        }
 
        return 0;
    }
 
}