增加返回

泸州-视觉+扫码-昆船
LAPTOP-S9HJSOEB\昊天 1 year ago
parent 82e048e56e
commit 56a2e2d6a8

@ -302,6 +302,26 @@ public class CameraControlController {
return Result.success();
}
@PostMapping("/picFor/{id}")
@ApiOperation(value = "立即拍照100次")
public Result picFor(@PathVariable Integer id) {
checkLogin(id);
for (int i =100 ; i<0;i--) {
String path = "D:\\work\\" +i+ ".jpeg";
cameraControlModule.pic(id,0,path);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
TaskDelayExecutor.addPicDelayTask(id, path, 100L);
}
return Result.success();
}
@Resource
private ConfigProperties configProperties;
@Resource

@ -486,7 +486,7 @@ public class PlcService {
return true;
}
public void checkVision(KsecDataInfo dataInfo,Boolean flag){
public boolean checkVision(KsecDataInfo dataInfo,Boolean flag){
try {
HttpHeaders headers = new HttpHeaders();
@ -507,8 +507,10 @@ public class PlcService {
entity,
Boolean.class
);
return response.getBody();
} catch (Exception e) {
log.error("3D get pcd error", e);
return false;
}
}

@ -19,6 +19,8 @@ import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import static com.zhehekeji.web.pojo.Cmd.SC02;
/**
* TCP JSON
*/
@ -214,7 +216,11 @@ public class KsecDecoder extends DelimiterBasedFrameDecoder {
log.info("盘点结束:"+ksecInfo.getData().toString());
}else if (Cmd.SC.name().equals(ksecInfo.getType())) {
plcService.checkVision(dataInfo,true);
boolean flag = plcService.checkVision(dataInfo,true);
ksecInfo.getData().setCmdName("SC02");
ksecInfo.getData().setCheckRlt(flag?1:0);
ctx.channel().writeAndFlush(ksecInfo);
}
//找到该货位的最后一张照片与现在的照片比照
//plcService.recordStock(plcCmdInfo, dataInfo.getCode(), 0, 0);

Loading…
Cancel
Save