|
|
|
|
@ -648,40 +648,50 @@ public class PlcService {
|
|
|
|
|
lightSources.forEach(lightSource -> {
|
|
|
|
|
HikControlSocket.openLight(lightSource.getIp(), lightSource.getPort(), configProperties.getLightSource().getIndex(), 1);
|
|
|
|
|
});
|
|
|
|
|
Integer cameraId = getCameraByPlcCmd(plcCmdInfo, plcCmdInfo.getLeftRight1());
|
|
|
|
|
//普通使用对侧
|
|
|
|
|
Integer cameraId = plcCmdInfo.getLeftRight1() == 1? street.getCamera2Id(): street.getCamera1Id();
|
|
|
|
|
//使用对侧
|
|
|
|
|
// if (plcCmdInfo.getLeftRight1() == 1) {
|
|
|
|
|
// cameraId = street.getCamera2Id();
|
|
|
|
|
// } else {
|
|
|
|
|
// cameraId = street.getCamera1Id();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//蜜雪冰城拍摄货物顶部时用同侧相机
|
|
|
|
|
//Integer leftRightTop = plcCmdInfo.getLeftRight1() == 1 ? 2 : 1;
|
|
|
|
|
Integer cameraIdTop = getCameraByPlcCmd(plcCmdInfo, plcCmdInfo.getLeftRight1());
|
|
|
|
|
if(plcCmdInfo.getSeparation1() == 1 ){
|
|
|
|
|
cameraIdTop = cameraId;
|
|
|
|
|
}else if (plcCmdInfo.getLeftRight1() == 1) {
|
|
|
|
|
cameraIdTop = street.getCamera1Id();
|
|
|
|
|
} else {
|
|
|
|
|
cameraIdTop = street.getCamera2Id();
|
|
|
|
|
}
|
|
|
|
|
if (plcCmdInfo.getSeparation1() == 1 && configProperties.getScanCodeMode().getTray() == 2) {
|
|
|
|
|
//内测
|
|
|
|
|
String c = cmdCode + "-" + plcCmdInfo.getLeftRightStr(1);
|
|
|
|
|
String c = cmdCode + "-" + plcCmdInfo.getLeftRightStr(1) + (plcCmdInfo.getSeparation1() == 1?"":"-Out");
|
|
|
|
|
log.info("camera ptz" + c);
|
|
|
|
|
gyrateCameraByCode(cameraIdTop, c);
|
|
|
|
|
gyrateCameraByCode(cameraId, c);
|
|
|
|
|
} else {
|
|
|
|
|
String c = cmdCode + "-" + plcCmdInfo.getLeftRightStr(1);
|
|
|
|
|
String c = cmdCode + "-" + plcCmdInfo.getLeftRightStr(1) + (plcCmdInfo.getSeparation1() == 1?"":"-Out");
|
|
|
|
|
log.info("camera ptz" + c);
|
|
|
|
|
gyrateCameraByCode(cameraIdTop, c);
|
|
|
|
|
try {
|
|
|
|
|
Thread.sleep(configProperties.getCameraConfig().getDelayCaptureTime());
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gyrateCameraByCode(cameraId, c);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
String path = PathUtil.createFileNameByRowColumn("jpg", cameraId, plcCmdInfo.getRow1(), plcCmdInfo.getColumn1());
|
|
|
|
|
//拍照暂停1s再拍
|
|
|
|
|
try {
|
|
|
|
|
Thread.sleep(configProperties.getCameraConfig().getEDelayCaptureTime());
|
|
|
|
|
cameraCapture(cameraId, false, null, path);
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
cameraCapture(cameraIdTop, false, null, path);
|
|
|
|
|
|
|
|
|
|
//成都蜜雪冰城 只拍照人工核对
|
|
|
|
|
String e2 = "E2-" + plcCmdInfo.getLeftRightStr(1) + "-TOP";
|
|
|
|
|
String e2 = "E2-" + plcCmdInfo.getLeftRightStr(1) + "-TOP" + (plcCmdInfo.getSeparation1() == 1?"":"-Out");
|
|
|
|
|
log.info("camera ptz" +e2);
|
|
|
|
|
gyrateCameraByCode(cameraIdTop, e2);
|
|
|
|
|
|
|
|
|
|
|