|
|
|
@ -26,11 +26,12 @@ import static com.zhehekeji.web.service.KuKouService.setTrayCode;
|
|
|
|
public class CommandQueue {
|
|
|
|
public class CommandQueue {
|
|
|
|
// 增加queue
|
|
|
|
// 增加queue
|
|
|
|
public static void addCommand(IndustrialCameraVO scTransmission) {
|
|
|
|
public static void addCommand(IndustrialCameraVO scTransmission) {
|
|
|
|
queue.add(scTransmission);
|
|
|
|
delayQueue.add(scTransmission);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private static ExecutorService exec = Executors.newFixedThreadPool(1);
|
|
|
|
private static ExecutorService exec = Executors.newFixedThreadPool(1);
|
|
|
|
|
|
|
|
private static DelayQueue<IndustrialCameraVO> delayQueue = new DelayQueue<>();
|
|
|
|
|
|
|
|
|
|
|
|
private static LinkedBlockingQueue<IndustrialCameraVO> queue = new LinkedBlockingQueue<>();
|
|
|
|
// private static LinkedBlockingQueue<IndustrialCameraVO> queue = new LinkedBlockingQueue<>();
|
|
|
|
|
|
|
|
|
|
|
|
public static void sentHttp(RestTemplate restTemplate, ConfigProperties configProperties){
|
|
|
|
public static void sentHttp(RestTemplate restTemplate, ConfigProperties configProperties){
|
|
|
|
exec.execute(new Consumer(restTemplate, configProperties));
|
|
|
|
exec.execute(new Consumer(restTemplate, configProperties));
|
|
|
|
@ -50,7 +51,7 @@ public class CommandQueue {
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// CameraControlModule cameraControlModule = SpringContextUtil.getBean(CameraControlModule.class);
|
|
|
|
// CameraControlModule cameraControlModule = SpringContextUtil.getBean(CameraControlModule.class);
|
|
|
|
IndustrialCameraVO scTransmission = queue.take();
|
|
|
|
IndustrialCameraVO scTransmission = delayQueue.take();
|
|
|
|
if(scTransmission != null){
|
|
|
|
if(scTransmission != null){
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|