|
@@ -1,5 +1,6 @@
|
|
package com.ruoyi.ams.xuankuang.service;
|
|
package com.ruoyi.ams.xuankuang.service;
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.ruoyi.hard.xuankang.BeltLineClient;
|
|
import com.ruoyi.hard.xuankang.BeltLineClient;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -20,9 +21,9 @@ public class BeltLineClientService {
|
|
//进入时抬升输送线
|
|
//进入时抬升输送线
|
|
public boolean openTheConveyorLine() {
|
|
public boolean openTheConveyorLine() {
|
|
//读输送线机械状态
|
|
//读输送线机械状态
|
|
- Number station = beltLineClient.readMechanicalState();
|
|
|
|
- log.info("BeltLineClientService - openTheConveyorLine station info is :{}", JSONObject.toJSONString(station));
|
|
|
|
- if (station.intValue() == 1) {
|
|
|
|
|
|
+ Number mechanicalState = beltLineClient.readMechanicalState();
|
|
|
|
+ log.info("BeltLineClientService - openTheConveyorLine station info is :{}", mechanicalState);
|
|
|
|
+ if (mechanicalState.intValue() == 1) {
|
|
return Boolean.TRUE;
|
|
return Boolean.TRUE;
|
|
}
|
|
}
|
|
//读模式
|
|
//读模式
|
|
@@ -35,9 +36,11 @@ public class BeltLineClientService {
|
|
//写通过方向
|
|
//写通过方向
|
|
beltLineClient.writeDirection(1);
|
|
beltLineClient.writeDirection(1);
|
|
//读状态
|
|
//读状态
|
|
- Number number1 = beltLineClient.readState();
|
|
|
|
- log.info("BeltLineClientService - openTheConveyorLine number1 info is :{}", JSONObject.toJSONString(number1));
|
|
|
|
- return number1.intValue() == 3;
|
|
|
|
|
|
+ Number logicStatus = beltLineClient.readState();
|
|
|
|
+ mechanicalState = beltLineClient.readMechanicalState();
|
|
|
|
+
|
|
|
|
+ log.info("BeltLineClientService - openTheConveyorLine current logicStatus is :{}, mechanicalState is :{}", logicStatus, mechanicalState);
|
|
|
|
+ return ObjectUtil.equal(mechanicalState, 1) && ObjectUtil.equal(logicStatus, 3);
|
|
}
|
|
}
|
|
return Boolean.FALSE;
|
|
return Boolean.FALSE;
|
|
}
|
|
}
|