|
|
@ -75,7 +75,6 @@ public class SprayTaskExecutor { |
|
|
|
try { |
|
|
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(sprayTask.getCmdId(), sprayTask.getCmdCode(), CommandStatus.START, "喷涂任务开始执行")); |
|
|
|
List<SprayTaskParams> sprayTaskParams = sprayTask.getSprayTaskParams(); |
|
|
|
int currentStep = 0; //不管是暂停还是新的线程,记录当前线程喷涂步骤序号 |
|
|
|
for (SprayTaskParams sprayTaskParam : sprayTaskParams) {//循环玻片 |
|
|
|
if (sprayTask.getCurrentIndex() != null && sprayTaskParam.getIndex() < sprayTask.getCurrentIndex()) { |
|
|
|
continue; |
|
|
@ -83,6 +82,9 @@ public class SprayTaskExecutor { |
|
|
|
sprayTask.setCurrentIndex(sprayTaskParam.getIndex()); |
|
|
|
int sprayNum = 1; //当前玻片是第几次喷涂 |
|
|
|
for (SprayTimes sprayTimes : sprayTaskParam.getTimes()) {//每个拨片有多次喷涂,循环每次喷涂 |
|
|
|
if (sprayNum < sprayTask.getSprayNum()) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
sprayTask.setSprayTimes(sprayTimes); |
|
|
|
Double[] slide = slideArr[sprayTaskParam.getIndex()];//获取玻片的坐标 |
|
|
|
|
|
|
@ -124,6 +126,7 @@ public class SprayTaskExecutor { |
|
|
|
//因为走的是折现,所以单词指令只需要移动x或y,缓存上一个点位用来判断本次是走x还是y |
|
|
|
double cacheXPoint = -1; |
|
|
|
double cacheYPoint = -1; |
|
|
|
int currentStep = 0; //记录当前线程喷涂步骤序号 |
|
|
|
for (SprayTaskStep sprayTaskStep : sprayTaskStepList) {//因为田字格喷涂其实是两次 |
|
|
|
if (sprayTimes.getHighVoltage()) {//加电 |
|
|
|
DeviceCommand highVoltageOpenCommand = DeviceCommandGenerator.highVoltageOpen(sprayTimes.getHighVoltageValue());//开启高压 |
|
|
@ -153,7 +156,7 @@ public class SprayTaskExecutor { |
|
|
|
commandFutureList.add(commandFuture); |
|
|
|
cacheYPoint = currentPoint.y; |
|
|
|
} |
|
|
|
sprayTask.getSprayTaskSprayedList().add(new SprayTaskSprayed(sprayNum,sprayTaskParam.getIndex(),currentPoint)); |
|
|
|
sprayTask.getSprayTaskSprayedList().add(new SprayTaskSprayed(sprayNum, sprayTaskParam.getIndex(), currentPoint)); |
|
|
|
SprayTaskPointCollectorPushBO sprayTaskPointCollectorPushBO = new SprayTaskPointCollectorPushBO(sprayTask.getCmdId(), sprayTask.getCmdCode(), sprayTaskParam.getIndex(), sprayNum, currentPoint); |
|
|
|
webSocketService.pushMsg(WebSocketMessageType.SPRAY_POINT, sprayTaskPointCollectorPushBO);//向前端推送当前路径 |
|
|
|
|
|
|
@ -166,14 +169,16 @@ public class SprayTaskExecutor { |
|
|
|
DeviceCommand syringePumpStopCommand = DeviceCommandGenerator.syringePumpStop();//停止推动注射泵 |
|
|
|
CommandFuture syringePumpStopCommandFuture = deviceCommandService.sendCommandSprayTask(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpStopCommand); |
|
|
|
commandWait(syringePumpStopCommandFuture); |
|
|
|
if(sprayTimes.getGridDelay() != null){ |
|
|
|
if (sprayTimes.getGridDelay() != null) { |
|
|
|
delay(sprayTimes.getGridDelay() * 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
sprayNum++; |
|
|
|
sprayTask.setSprayNum(sprayNum); |
|
|
|
sprayTask.setCurrentStep(0); |
|
|
|
delay(sprayTimes.getDelay() * 1000); |
|
|
|
} |
|
|
|
|
|
|
|
sprayTask.setSprayNum(0); |
|
|
|
} |
|
|
|
//喷涂完毕 |
|
|
|
DeviceCommand highVoltageCloseCommand = DeviceCommandGenerator.highVoltageClose();//关闭高压 |
|
|
|