自动化立体仓库 - WCS系统
#
Junjie
2023-12-13 bd0d3a69bc5a38c11af4aa7222806bacdea97318
src/main/java/com/zy/core/model/protocol/NyShuttleProtocol.java
@@ -204,6 +204,51 @@
     */
    private Integer token = 0;
    /**
     * 跑库状态
     */
    private Boolean moveLoc = false;
    /**
     * 跑库类型,0:跑轨道,1:跑库位
     */
    private Integer moveType = 0;
    /**
     * 跑库X起点
     */
    private Integer xStart = 0;
    /**
     * 跑库X终点
     */
    private Integer xTarget = 0;
    /**
     * 跑库X当前点位
     */
    private Integer xCurrent = 0;
    /**
     * 跑库Y起点
     */
    private Integer yStart = 0;
    /**
     * 跑库Y终点
     */
    private Integer yTarget = 0;
    /**
     * 跑库Y当前点位
     */
    private Integer yCurrent = 0;
    /**
     * 指令下发时间
     */
    private Long sendTime = 0L;
    //总里程数
    @Data
    public static class StatusSumClass {
@@ -444,21 +489,22 @@
                && this.taskNo == 0
                && this.protocolStatus == ShuttleProtocolStatusType.IDLE.id
                ;
        if (!res) {
            return res;
        } else {
            // 电量
            try {
                Integer chargeLine = SpringUtils.getBean(BasShuttleService.class).selectById(this.shuttleNo).getChargeLine();
                if (chargeLine == null) {
                    return false;
                }
                return this.getPowerPercent() >= chargeLine;
            } catch (Exception e) {
                News.error("fail", e);
                return false;
            }
        }
        return res;
//        if (!res) {
//            return res;
//        } else {
//            // 电量
//            try {
//                Integer chargeLine = SpringUtils.getBean(BasShuttleService.class).selectById(this.shuttleNo).getChargeLine();
//                if (chargeLine == null) {
//                    return false;
//                }
//                return this.getPowerPercent() >= chargeLine;
//            } catch (Exception e) {
//                News.error("fail", e);
//                return false;
//            }
//        }
    }
    // 是否处于空闲待命状态,传入的taskNo和当前taskNo相同时允许放行
@@ -469,18 +515,19 @@
                && (this.taskNo == 0 || this.taskNo == taskNo)
                && this.protocolStatus.intValue() == ShuttleProtocolStatusType.IDLE.id
                ;
        if (!res) {
            return res;
        } else {
            // 电量
            try {
                Integer chargeLine = SpringUtils.getBean(BasShuttleService.class).selectById(this.shuttleNo).getChargeLine();
                return this.getPowerPercent() > chargeLine;
            } catch (Exception e) {
                News.error("fail", e);
                return false;
            }
        }
        return res;
//        if (!res) {
//            return res;
//        } else {
//            // 电量
//            try {
//                Integer chargeLine = SpringUtils.getBean(BasShuttleService.class).selectById(this.shuttleNo).getChargeLine();
//                return this.getPowerPercent() > chargeLine;
//            } catch (Exception e) {
//                News.error("fail", e);
//                return false;
//            }
//        }
    }
    // 是否处于空闲待命状态
@@ -542,4 +589,10 @@
            }
        }
    }
    public void setShuttleNo(Short shuttleNo) {
        if (shuttleNo != 0) {
            this.shuttleNo = shuttleNo;
        }
    }
}