自动化立体仓库 - WCS系统
#
luxiaotao1123
2022-12-30 994b12f9df6da1db761445ce75dd7bee899cd304
src/main/java/com/zy/core/model/protocol/SteProtocol.java
@@ -4,6 +4,7 @@
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasSte;
import com.zy.asrs.service.BasSteService;
import com.zy.core.News;
import com.zy.core.enums.SteHisTaskStatusType;
import com.zy.core.enums.SteLocaType;
import com.zy.core.enums.SteStatusType;
@@ -69,6 +70,12 @@
     * 电池电量
     */
    public Float charge = 0.0F;
    public void setCharge(Float charge) {
        if (charge >= 0) {
            this.charge = charge;
        }
    }
    /**
     * 满电
@@ -190,6 +197,12 @@
     */
    private Short chargeStatus;
    // 入库取空
    private Boolean inEmpty;
    // 出库取空
    private Boolean outEmpty;
    public void setStatus(Short status){
        this.status = status;
        this.statusType = SteStatusType.get(status);
@@ -251,9 +264,12 @@
    // 是否处于空闲待命状态
    public Boolean isIdle() {
        boolean res = this.statusType.equals(SteStatusType.IDLE)
                && this.mode == 1
                && this.pakMk.equals("N")
                && !isAlarm()
                && this.chargeStatus == 0;
                && this.chargeStatus == 0
                && isEnable()
                ;
        if (!res) {
            return res;
        } else {
@@ -262,7 +278,7 @@
                String chargeLine = SpringUtils.getBean(BasSteService.class).selectById(this.steNo).getChargeLine();
                return charge > Float.parseFloat(chargeLine);
            } catch (Exception e) {
                log.error("fail", e);
                News.error("fail", e);
                return false;
            }
        }
@@ -273,4 +289,11 @@
        return this.alarm > 1;
    }
    public Boolean isEnable() {
        if (Cools.isEmpty(row, bay, lev)) {
            return false;
        }
        return row > 0 && bay > 0 && lev > 0;
    }
}