|
|
@ -81,6 +81,7 @@ public class SprayTaskExecutor { |
|
|
|
CommandFuture motorYPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYPositionSetCommand); |
|
|
|
CommandFuture motorZPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetCommand); |
|
|
|
commandWait(motorXPositionSetCommandFuture, motorYPositionSetCommandFuture, motorZPositionSetCommandFuture); |
|
|
|
|
|
|
|
SysSettings slideHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper<SysSettings>().eq(SysSettings::getCode, "slide_height")); |
|
|
|
Double slideHeight = Double.parseDouble(slideHeightSysSettings.getValue()); |
|
|
|
Double height = slideHeight - sprayTask.getSprayParams().getMotorZHeight(); |
|
|
@ -100,18 +101,19 @@ public class SprayTaskExecutor { |
|
|
|
sprayTask.setSprayPreStepsCompleted(true); |
|
|
|
} |
|
|
|
|
|
|
|
DeviceCommand nozzleValveOpenCommand = DeviceCommandGenerator.nozzleValveOpen();//开启喷嘴阀 |
|
|
|
CommandFuture nozzleValveOpenCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveOpenCommand); |
|
|
|
commandWait(nozzleValveOpenCommandFuture); |
|
|
|
|
|
|
|
int reCurrentStep = sprayTask.getCurrentStep(); |
|
|
|
int currentStep = 0; //当前喷涂步骤 |
|
|
|
int sprayNum = 1; |
|
|
|
for (SprayTaskStep sprayTaskStep : sprayTask.getSprayTaskStepList()) {//循环进行多次喷涂 |
|
|
|
|
|
|
|
DeviceCommand nozzleValveOpenCommand = DeviceCommandGenerator.nozzleValveOpen();//开启喷嘴阀 |
|
|
|
DeviceCommand syringePumpForwardCommand = DeviceCommandGenerator.syringePumpForward(sprayTask.getSprayParams().getVolume());//推动移动注射泵 |
|
|
|
CommandFuture nozzleValveOpenCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveOpenCommand); |
|
|
|
CommandFuture syringePumpForwardCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpForwardCommand); |
|
|
|
commandWait(nozzleValveOpenCommandFuture, syringePumpForwardCommandFuture); |
|
|
|
commandWait(syringePumpForwardCommandFuture); |
|
|
|
Thread.sleep(100); |
|
|
|
|
|
|
|
List<Point2D> sprayStepList = new ArrayList<>(); |
|
|
|
sprayTask.setSuspendable(true);//可以暂停,单次喷涂范围内可以进行暂停 |
|
|
|
deviceStatus.setSuspendable(true); |
|
|
|
for (int i = 0; i < sprayTaskStep.getSpraySteps().size(); i++) {//单次喷涂 |
|
|
@ -126,7 +128,6 @@ public class SprayTaskExecutor { |
|
|
|
} |
|
|
|
|
|
|
|
CommandFuture[] commandFutureArray = commandFutureList.toArray(new CommandFuture[0]); |
|
|
|
// sprayTaskPointCollector.startCollecting(sprayTaskStep.getIndex()); //开启点位推送 |
|
|
|
Point2D currentPoint; |
|
|
|
Point2D nextPoint = null; |
|
|
|
if (i != 0) { |
|
|
@ -141,7 +142,6 @@ public class SprayTaskExecutor { |
|
|
|
webSocketService.pushMsg(WebSocketMessageType.SPRAY_POINT, sprayTaskPointCollectorPushBO); |
|
|
|
} |
|
|
|
commandWait(commandFutureArray); |
|
|
|
// sprayTaskPointCollector.stopCollecting();//关闭点位推送 |
|
|
|
currentStep++; |
|
|
|
sprayTask.setCurrentStep(currentStep);//将当前的喷涂进度缓存 |
|
|
|
if (nextPoint != null) { |
|
|
@ -156,16 +156,19 @@ public class SprayTaskExecutor { |
|
|
|
sprayTask.setSuspendable(false);//不可暂停 |
|
|
|
deviceStatus.setSuspendable(false); |
|
|
|
|
|
|
|
DeviceCommand nozzleValveCloseCommand = DeviceCommandGenerator.nozzleValveClose();//关闭喷嘴阀 |
|
|
|
|
|
|
|
DeviceCommand syringePumpStopCommand = DeviceCommandGenerator.syringePumpStop();//停止推动注射泵 |
|
|
|
CommandFuture nozzleValveCloseCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveCloseCommand); |
|
|
|
CommandFuture syringePumpStopCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpStopCommand); |
|
|
|
commandWait(nozzleValveCloseCommandFuture, syringePumpStopCommandFuture); |
|
|
|
commandWait(syringePumpStopCommandFuture); |
|
|
|
sprayNum++; |
|
|
|
} |
|
|
|
DeviceCommand highVoltageCloseCommand = DeviceCommandGenerator.highVoltageClose();//关闭高压 |
|
|
|
CommandFuture highVoltageCloseCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), highVoltageCloseCommand); |
|
|
|
commandWait(highVoltageCloseCommandFuture); |
|
|
|
Thread.sleep(500); |
|
|
|
DeviceCommand nozzleValveCloseCommand = DeviceCommandGenerator.nozzleValveClose();//关闭喷嘴阀 |
|
|
|
CommandFuture nozzleValveCloseCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveCloseCommand); |
|
|
|
commandWait(nozzleValveCloseCommandFuture); |
|
|
|
|
|
|
|
//XYZ回原点 |
|
|
|
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(0.0); |
|
|
|