#
vincentlu
10 天以前 655ba6bfba4b1087e093efe675e46afbff597b97
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
package com.zy.acs.common.domain.protocol.action;
 
import com.zy.acs.common.domain.protocol.IActionBody;
import com.zy.acs.common.utils.Utils;
import lombok.Data;
 
import java.io.Serializable;
 
/**
 * 准备从货架放货
 * 属性值:方向,左1 右2
 * Created by vincent on 2023/3/23
 */
@Data
public class ReadyReleaseToShelvesLoc implements IActionBody, Serializable {
 
    private static final long serialVersionUID = 6496283344148393737L;
 
    @Override
    public byte[] writeToBytes() {
//        byte[] heightBytes = Utils.reverse(RadixTools.shortToByte(this.height));
//        byte[] depthBytes = Utils.reverse(RadixTools.shortToByte(this.depth));
//        return Utils.merge(heightBytes, depthBytes);
 
        byte heightByte = (byte) ((this.height == null ? 0 : this.height) & 0xFF);
        byte depthByte  = (byte) ((this.depth  == null ? 0 : this.depth)  & 0xFF);
        return Utils.merge(heightByte, depthByte);
//        return new byte[]{ heightByte, depthByte };
    }
 
    @Override
    public void readFromBytes(byte[] messageBodyBytes) {
 
    }
 
    // 取货高度
    private Short height;
 
    // 取货深度
    private Short depth;
 
}