增求站台盘点多信号上传

泸州-视觉+扫码-昆船
LAPTOP-S9HJSOEB\昊天 2 months ago
parent e078d5c8bc
commit 3b4ac14150

@ -214,9 +214,25 @@ public class IndustrialCameraController {
kuKou.setWmsCode(industrialCameraVo.getCode());
kuKou.setPath(configProperties.getSavePath().getNetPicPath() + pa + ".jpg");
kuKou.setCategoryName(industrialCameraVo.getTypeMacth());
if (re && count == industrialCameraVo.getCount() && code.endsWith(industrialCameraVo.getCode())) {
if (re && count.equals(industrialCameraVo.getCount()) && code.endsWith(industrialCameraVo.getCode())) {
kuKou.setFlag(1);
} else kuKou.setFlag(0);
} else if (count.equals(-1)){
kuKou.setCount(0);
kuKou.setFlag(12);
}else if (count.equals(-2)){
kuKou.setCount(0);
kuKou.setFlag(11);
}else {
kuKou.setCount(0);
kuKou.setFlag(0);
}
kuKouService.save(kuKou);
// serialPortExample.openLight(0);

@ -2,6 +2,7 @@ package com.zhehekeji.web.service.IndustrialCamera;
import com.sun.jna.Native;
import com.sun.jna.ptr.PointerByReference;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import java.nio.file.Files;
@ -124,7 +125,7 @@ public class LxPointCloudSaveImage {
}
public static boolean saveImage(String sn, String path,int type) {
public static Integer saveImage(String sn, String path, int type) {
DcLibrary INSTANCE;
INSTANCE = INSTANCER;
int result = 0;
@ -150,7 +151,7 @@ public class LxPointCloudSaveImage {
System.out.println("stop Stream Result: " + result);
return true;
return result;
}
public static void main(String[] args) {

@ -87,7 +87,17 @@ public class InventoryService {
for (int i = 0; i < 3; i++) {
String currentPath = path.replace(".pcd", "_" + i + ".pcd"); // 添加索引以区分不同次拍照的文件路径
LxPointCloudSaveImage.saveImage(configProperties.getCameraConfig().getCamera3D(), currentPath, 1);
Integer picResult = LxPointCloudSaveImage.saveImage(configProperties.getCameraConfig().getCamera3D(), currentPath, 1);
if ( picResult==-3){
// 网络问题
log.error("3D拍照失败"+picResult);
return -1;
}else if(picResult != 0 && picResult!=25){
// 没有成功拍照
log.error("3D拍照失败"+picResult);
return -2;
}
log.info("3D拍照成功 "+picResult);
Integer result = PointCloudProcessor.getBaijiuBox(
currentPath,
@ -107,14 +117,11 @@ public class InventoryService {
return results.get(2);
}
try {
try {
Thread.sleep(300*(i+1)); // 间隔300ms
} catch (InterruptedException e) {
} catch (InterruptedException e) {
log.error("线程休眠异常", e);
}
}
}
return results.get(results.size() - 1);

Loading…
Cancel
Save