| | |
| | | private static LinkedHashMap<String, RuntimeConfigRule> buildRuntimeConfigRuleMap() { |
| | | LinkedHashMap<String, RuntimeConfigRule> ruleMap = new LinkedHashMap<>(); |
| | | putIntRule(ruleMap, "conveyorStationTaskLimit", 1, 1000); |
| | | putIntRule(ruleMap, "stationMaxTaskCountLimit", 0, 1000); |
| | | putIntRule(ruleMap, "stationCommandSendLength", 1, 200); |
| | | putRatioRule(ruleMap, "stationCommandSegmentAdvanceRatio"); |
| | | putIntRule(ruleMap, "stationCommandConfigRefreshSeconds", 5, 300); |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (isOutboundStationTaskLimitReached()) { |
| | | if (isConveyorStationTaskLimitReached()) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | private boolean isOutboundStationTaskLimitReached() { |
| | | int stationMaxTaskCount = getSystemConfigInt("stationMaxTaskCountLimit", 30); |
| | | if (stationMaxTaskCount <= 0) { |
| | | private boolean isConveyorStationTaskLimitReached() { |
| | | int conveyorStationTaskLimit = getSystemConfigInt("conveyorStationTaskLimit", 30); |
| | | if (conveyorStationTaskLimit <= 0) { |
| | | return false; |
| | | } |
| | | |
| | | int currentStationTaskCount = stationOperateProcessUtils.getCurrentStationTaskCount(); |
| | | if (currentStationTaskCount >= stationMaxTaskCount) { |
| | | News.warn("输送站点任务数量达到上限,已停止任务下发。当前任务数={},上限={}", currentStationTaskCount, stationMaxTaskCount); |
| | | if (currentStationTaskCount >= conveyorStationTaskLimit) { |
| | | News.warn("输送站点任务数量达到上限,已停止任务下发。当前任务数={},上限={}", |
| | | currentStationTaskCount, |
| | | conveyorStationTaskLimit); |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | return null; |
| | | } |
| | | |
| | | if (isConveyorStationTaskLimitReached()) { |
| | | return null; |
| | | } |
| | | |
| | | if (station == 1) { |
| | | if (dualCrnProtocol.getTaskNo() > 0) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "工位1系统内部记录有任务"); |
| | |
| | | wrkMast.getStaNo(), |
| | | currentStationTaskCount, |
| | | basStation.getOutTaskLimit()); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean isConveyorStationTaskLimitReached() { |
| | | int conveyorStationTaskLimit = getSystemConfigInt("conveyorStationTaskLimit", 30); |
| | | if (conveyorStationTaskLimit <= 0) { |
| | | return false; |
| | | } |
| | | |
| | | int currentStationTaskCount = stationOperateProcessUtils.getCurrentStationTaskCount(); |
| | | if (currentStationTaskCount >= conveyorStationTaskLimit) { |
| | | News.warn("输送站点任务数量达到上限,已停止双工位堆垛机任务下发。当前任务数={},上限={}", |
| | | currentStationTaskCount, |
| | | conveyorStationTaskLimit); |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | return getSystemConfigBoolean(CRN_OUT_REQUIRE_STATION_OUT_ENABLE_CONFIG, true); |
| | | } |
| | | |
| | | private int getSystemConfigInt(String code, int defaultValue) { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (!(systemConfigMapObj instanceof Map)) { |
| | | return defaultValue; |
| | | } |
| | | try { |
| | | Object value = ((Map<?, ?>) systemConfigMapObj).get(code); |
| | | if (value == null) { |
| | | return defaultValue; |
| | | } |
| | | return Integer.parseInt(String.valueOf(value).trim()); |
| | | } catch (Exception ignore) { |
| | | return defaultValue; |
| | | } |
| | | } |
| | | |
| | | private boolean getSystemConfigBoolean(String code, boolean defaultValue) { |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (!(systemConfigMapObj instanceof Map)) { |
| | |
| | | # 系统版本信息 |
| | | app: |
| | | version: 3.0.1.0 |
| | | version: 3.0.1.1 |
| | | version-type: prd # prd 或 dev |
| | | i18n: |
| | | default-locale: zh-CN |