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 ReadyTakeFromConveyorSta implements IActionBody, Serializable { private static final long serialVersionUID = 2178106700498872411L; @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; }