自动化立体仓库 - WCS系统
#
Junjie
2023-09-18 b7cbb2a30125285eade6a26c9f3d39363c65481c
src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java
@@ -4,6 +4,7 @@
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasShuttle;
import com.zy.asrs.service.BasShuttleService;
import com.zy.asrs.utils.Utils;
import com.zy.common.utils.NavigatePositionConvert;
import com.zy.core.News;
import com.zy.core.enums.ShuttleErrorCodeType;
@@ -163,6 +164,11 @@
    private NyShuttlePointClass coord;
    /**
     * WCS库位xyz
     */
    private NyShuttlePointClass wcsPoint;
    /**
     * 任务目的库位xyztaskId(正在动作的任务ID)lastTaskId(最后一个完成的任务ID)recentTaskId(收到的最后一个任务ID)
     */
    private TaskClass task;
@@ -180,7 +186,7 @@
    /**
     * 故障码
     */
    private List<Integer> errCode;
    private Integer errCode;
    /**
     * mileage总里程数(米),liftNumber顶升总数dropNumber下降总数reversingX换X总数reversingY换Y总数
@@ -191,6 +197,13 @@
     * 非自动状态时间计时(S)
     */
    private Integer errTime;
    /**
     * 独占令牌
     * 未被任务占据,令牌为0
     * 被任务占据,将任务号赋值给令牌
     */
    private Integer token = 0;
    //总里程数
    @Data
@@ -222,7 +235,14 @@
        if (this.getFree() == null) {
            return "";
        }
        return this.getFree() == 1 ? "空闲" : "运行中";
        return this.getFree() == 0 ? "运行中" : "空闲";
    }
    public String getWorkingMode$() {
        if (this.getWorkingMode() == null) {
            return "";
        }
        return this.getWorkingMode() == 0 ? "手动" : "自动";
    }
    public String getLoadState$() {
@@ -251,7 +271,7 @@
            return "";
        }
        switch (this.getRunDir()) {
        switch (this.getLiftPosition()) {
            case 0:
                return "未知";
            case 1:
@@ -380,6 +400,13 @@
        return NavigatePositionConvert.nyXyzToLocNo(this.getPoint().getX(), this.getPoint().getY(), this.getPoint().getZ());
    }
    public String getPoint$$() {
        if (this.getPoint() == null) {
            return "";
        }
        return JSON.toJSONString(this.getPoint());
    }
    public String getCoord$() {
        if (this.getCoord() == null) {
            return "";
@@ -391,12 +418,17 @@
        String locNo = NavigatePositionConvert.nyXyzToLocNo(point.getX(), point.getY(), point.getZ());
        this.point = point;
        this.currentLocNo = locNo;
        NyShuttlePointClass wcsPoint = new NyShuttlePointClass();
        wcsPoint.setX(Utils.getRow(locNo));
        wcsPoint.setY(Utils.getBay(locNo));
        wcsPoint.setZ(Utils.getLev(locNo));
        this.wcsPoint = wcsPoint;
    }
    // 是否处于空闲待命状态
    public Boolean isIdle() {
        boolean res = this.free == ShuttleStatusType.IDLE.id
                && this.pakMk.equals(true)
                && !this.pakMk
                && this.errState == 0
                && this.taskNo == 0
                && this.protocolStatus == ShuttleProtocolStatusType.IDLE.id
@@ -421,7 +453,7 @@
    // 是否处于空闲待命状态,传入的taskNo和当前taskNo相同时允许放行
    public Boolean isIdle(int taskNo) {
        boolean res = this.free == ShuttleStatusType.IDLE.id
                && this.pakMk.equals(true)
                && !this.pakMk
                && this.errState == 0
                && (this.taskNo == 0 || this.taskNo == taskNo)
                && this.protocolStatus.intValue() == ShuttleProtocolStatusType.IDLE.id
@@ -443,7 +475,7 @@
    // 是否处于空闲待命状态
    public Boolean isIdleNoCharge() {
        boolean res = this.free == ShuttleStatusType.IDLE.id
                && this.pakMk.equals(true)
                && !this.pakMk
                && this.errState == 0
                && this.taskNo == 0
                && this.protocolStatus == ShuttleProtocolStatusType.IDLE.id
@@ -458,7 +490,7 @@
        }
        boolean res = this.free == ShuttleStatusType.IDLE.id
                && this.pakMk
                && !this.pakMk
                && this.errState == 0
                && this.taskNo == 0
                && this.protocolStatusType.id == ShuttleProtocolStatusType.IDLE.id