#
luxiaotao1123
2020-08-08 e42c649b6e14af84202c2df7e35c486ea0b5442c
#
1个文件已添加
1个文件已修改
52 ■■■■■ 已修改文件
src/main/java/com/zy/core/enums/CrnLiftPosType.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/model/protocol/CrnProtocol.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/enums/CrnLiftPosType.java
New file
@@ -0,0 +1,39 @@
package com.zy.core.enums;
public enum CrnLiftPosType {
    UP(0),   // 货叉原位
    DOWN(1),  // 货叉在左侧
    NONE(2),   // 货叉在右侧
    ;
    public Integer id;
    CrnLiftPosType(Integer id) {
        this.id = id;
    }
    public static CrnLiftPosType get(Short id) {
        if (null == id) {
            return null;
        }
        for (CrnLiftPosType type : CrnLiftPosType.values()) {
            if (type.id.equals(id.intValue())) {
                return type;
            }
        }
        return null;
    }
    public static CrnLiftPosType get(CrnLiftPosType type) {
        if (null == type) {
            return null;
        }
        for (CrnLiftPosType crnLiftPosType : CrnLiftPosType.values()) {
            if (crnLiftPosType == type) {
                return crnLiftPosType;
            }
        }
        return null;
    }
}
src/main/java/com/zy/core/model/protocol/CrnProtocol.java
@@ -1,6 +1,7 @@
package com.zy.core.model.protocol;
import com.zy.core.enums.CrnForkPosType;
import com.zy.core.enums.CrnLiftPosType;
import com.zy.core.enums.CrnModeType;
import com.zy.core.enums.CrnStatusType;
import lombok.Data;
@@ -91,6 +92,8 @@
     */
    public short liftPos;
    public CrnLiftPosType liftPosType;
    /**
     * 走行在定位
     * 0 = 在定位
@@ -143,6 +146,16 @@
        this.forkPos = CrnForkPosType.get(type).id.shortValue();
    }
    public void setLiftPos(Short liftPos) {
        this.liftPos = liftPos;
        this.liftPosType = CrnLiftPosType.get(liftPos);
    }
    public void setLiftPos(CrnLiftPosType type) {
        this.liftPosType = type;
        this.liftPos = CrnLiftPosType.get(type).id.shortValue();
    }
    public void setStatus(Short status){
        this.status = status;
        this.statusType = CrnStatusType.get(status);