|
|
|
@ -252,14 +252,10 @@ public class PlcService {
|
|
|
|
String path = null;
|
|
|
|
String path = null;
|
|
|
|
|
|
|
|
|
|
|
|
Boolean needCapture = doNeedCaptureByCode(orderInfo.getCmdCode());
|
|
|
|
Boolean needCapture = doNeedCaptureByCode(orderInfo.getCmdCode());
|
|
|
|
/***
|
|
|
|
/**
|
|
|
|
* 判断该巷道有几个相机
|
|
|
|
* 古井贡酒球机分前后,前使用左侧相机
|
|
|
|
* 如果有一个相机,就一个相机转
|
|
|
|
|
|
|
|
* 如果有两个相机,则左侧转camera1
|
|
|
|
|
|
|
|
* 右侧转camera2
|
|
|
|
|
|
|
|
* 没有就不管了
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Integer cameraId = getCameraByPlcCmdAction(plcCmdInfo, orderInfo.getCmdCode());
|
|
|
|
Integer cameraId = (plcCmdInfo.getFromAround() == 1)? street.getCamera1Id(): street.getCamera2Id();
|
|
|
|
gyrateCameraByCode(cameraId, orderInfo.getCmdCode(), orderInfo.getOrderNum());
|
|
|
|
gyrateCameraByCode(cameraId, orderInfo.getCmdCode(), orderInfo.getOrderNum());
|
|
|
|
if (needCapture) {
|
|
|
|
if (needCapture) {
|
|
|
|
Boolean delay = true;
|
|
|
|
Boolean delay = true;
|
|
|
|
@ -286,7 +282,9 @@ public class PlcService {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
delayTime = configProperties.getCameraConfig().getC2OutDelayCaptureTime();
|
|
|
|
delayTime = configProperties.getCameraConfig().getC2OutDelayCaptureTime();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(configProperties.getOrderTest() == 1 && plcCmdInfo.getFromAround() == 2) {
|
|
|
|
|
|
|
|
checkTest(plcCmdInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else if (code.startsWith("C3")) {
|
|
|
|
} else if (code.startsWith("C3")) {
|
|
|
|
delayTime = configProperties.getCameraConfig().getC3DelayCaptureTime();
|
|
|
|
delayTime = configProperties.getCameraConfig().getC3DelayCaptureTime();
|
|
|
|
|
|
|
|
|
|
|
|
@ -813,6 +811,7 @@ public class PlcService {
|
|
|
|
plcCmdInfo.setFromSide(dataInfo.getFromSide());
|
|
|
|
plcCmdInfo.setFromSide(dataInfo.getFromSide());
|
|
|
|
plcCmdInfo.setFromSeparation(dataInfo.getFromSeparation());
|
|
|
|
plcCmdInfo.setFromSeparation(dataInfo.getFromSeparation());
|
|
|
|
plcCmdInfo.setToSeparation(dataInfo.getToSeparation());
|
|
|
|
plcCmdInfo.setToSeparation(dataInfo.getToSeparation());
|
|
|
|
|
|
|
|
plcCmdInfo.setFromAround(dataInfo.getFromAround());
|
|
|
|
plcCmdInfo.setToSide(dataInfo.getToSide());
|
|
|
|
plcCmdInfo.setToSide(dataInfo.getToSide());
|
|
|
|
//左右不交换
|
|
|
|
//左右不交换
|
|
|
|
if(dataInfo.getFromDirection() == 1){
|
|
|
|
if(dataInfo.getFromDirection() == 1){
|
|
|
|
@ -903,7 +902,7 @@ public class PlcService {
|
|
|
|
dataInfo.setGoodsNumberResult(algorithmPojo.getGoodsNumberResult());
|
|
|
|
dataInfo.setGoodsNumberResult(algorithmPojo.getGoodsNumberResult());
|
|
|
|
log.info("盘点完成");
|
|
|
|
log.info("盘点完成");
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
checkTest(plcCmdInfo, ksecInfo.getType(), dataInfo);
|
|
|
|
checkTest(plcCmdInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -911,7 +910,7 @@ public class PlcService {
|
|
|
|
return dataInfo;
|
|
|
|
return dataInfo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void checkTest(PlcCmdInfo plcCmdInfo, String type, KsecDataInfo dataInfo) {
|
|
|
|
private void checkTest(PlcCmdInfo plcCmdInfo) {
|
|
|
|
Street street = streetService.getStreetByPlcId(plcCmdInfo.getPlcId());
|
|
|
|
Street street = streetService.getStreetByPlcId(plcCmdInfo.getPlcId());
|
|
|
|
|
|
|
|
|
|
|
|
Socket socket = new Socket();
|
|
|
|
Socket socket = new Socket();
|
|
|
|
@ -919,7 +918,7 @@ public class PlcService {
|
|
|
|
OutputStream os = null;
|
|
|
|
OutputStream os = null;
|
|
|
|
InputStream is = null;
|
|
|
|
InputStream is = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
socket.connect(new InetSocketAddress(street.getPlcIp(),669),3000);
|
|
|
|
socket.connect(new InetSocketAddress(street.getPlcIp(),street.getPlcPort()),3000);
|
|
|
|
//socket.setSoTimeout(10000);
|
|
|
|
//socket.setSoTimeout(10000);
|
|
|
|
os = socket.getOutputStream();
|
|
|
|
os = socket.getOutputStream();
|
|
|
|
Thread.sleep(100);
|
|
|
|
Thread.sleep(100);
|
|
|
|
|