|
@ -108,14 +108,6 @@ public class SprayTaskExecutor { |
|
|
int currentStep = 0; //当前喷涂步骤 |
|
|
int currentStep = 0; //当前喷涂步骤 |
|
|
int sprayNum = 1; |
|
|
int sprayNum = 1; |
|
|
for (SprayTaskStep sprayTaskStep : sprayTask.getSprayTaskStepList()) {//循环进行多次喷涂 |
|
|
for (SprayTaskStep sprayTaskStep : sprayTask.getSprayTaskStepList()) {//循环进行多次喷涂 |
|
|
//加快速度 |
|
|
|
|
|
// DeviceCommand motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(20.0);//x轴电机速度设置 |
|
|
|
|
|
// DeviceCommand motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(20.0);//y轴电机速度设置 |
|
|
|
|
|
// DeviceCommand motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(20.0);//z轴电机速度设置 |
|
|
|
|
|
// CommandFuture motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// CommandFuture motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// CommandFuture motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture); |
|
|
|
|
|
//先移动到玻片位置 |
|
|
//先移动到玻片位置 |
|
|
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(slideArr[sprayTaskStep.getIndex()][0],20.0); |
|
|
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(slideArr[sprayTaskStep.getIndex()][0],20.0); |
|
|
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(75.5 - slideArr[sprayTaskStep.getIndex()][1],20.0); |
|
|
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(75.5 - slideArr[sprayTaskStep.getIndex()][1],20.0); |
|
@ -129,15 +121,6 @@ public class SprayTaskExecutor { |
|
|
CommandFuture motorZPositionSetAboveSlideCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetAboveSlideCommand); |
|
|
CommandFuture motorZPositionSetAboveSlideCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetAboveSlideCommand); |
|
|
commandWait(motorXPositionSetCommandFuture, motorYPositionSetCommandFuture, motorZPositionSetAboveSlideCommandFuture); |
|
|
commandWait(motorXPositionSetCommandFuture, motorYPositionSetCommandFuture, motorZPositionSetAboveSlideCommandFuture); |
|
|
|
|
|
|
|
|
//还原速度 |
|
|
|
|
|
// motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//x轴电机速度设置 |
|
|
|
|
|
// motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//y轴电机速度设置 |
|
|
|
|
|
// motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//y轴电机速度设置 |
|
|
|
|
|
// motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture); |
|
|
|
|
|
|
|
|
|
|
|
DeviceCommand syringePumpForwardCommand = DeviceCommandGenerator.syringePumpForward(sprayTask.getSprayParams().getVolume());//推动移动注射泵 |
|
|
DeviceCommand syringePumpForwardCommand = DeviceCommandGenerator.syringePumpForward(sprayTask.getSprayParams().getVolume());//推动移动注射泵 |
|
|
CommandFuture syringePumpForwardCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpForwardCommand); |
|
|
CommandFuture syringePumpForwardCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpForwardCommand); |
|
|
commandWait(syringePumpForwardCommandFuture); |
|
|
commandWait(syringePumpForwardCommandFuture); |
|
@ -156,6 +139,7 @@ public class SprayTaskExecutor { |
|
|
List<CommandFuture> commandFutureList = new ArrayList<>(); |
|
|
List<CommandFuture> commandFutureList = new ArrayList<>(); |
|
|
double aXPoint = (double) sprayStepCommands.get(0).getParam().get("position"); |
|
|
double aXPoint = (double) sprayStepCommands.get(0).getParam().get("position"); |
|
|
double aYPoint = (double) sprayStepCommands.get(1).getParam().get("position"); |
|
|
double aYPoint = (double) sprayStepCommands.get(1).getParam().get("position"); |
|
|
|
|
|
|
|
|
if(cacheXPoint != aXPoint){ |
|
|
if(cacheXPoint != aXPoint){ |
|
|
CommandFuture commandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), sprayStepCommands.get(0)); |
|
|
CommandFuture commandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), sprayStepCommands.get(0)); |
|
|
commandFutureList.add(commandFuture); |
|
|
commandFutureList.add(commandFuture); |
|
@ -209,15 +193,6 @@ public class SprayTaskExecutor { |
|
|
CommandFuture nozzleValveCloseCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveCloseCommand); |
|
|
CommandFuture nozzleValveCloseCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveCloseCommand); |
|
|
commandWait(nozzleValveCloseCommandFuture); |
|
|
commandWait(nozzleValveCloseCommandFuture); |
|
|
|
|
|
|
|
|
//加快速度 |
|
|
|
|
|
// DeviceCommand motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(20.0);//x轴电机速度设置 |
|
|
|
|
|
// DeviceCommand motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(20.0);//y轴电机速度设置 |
|
|
|
|
|
// DeviceCommand motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(20.0);//y轴电机速度设置 |
|
|
|
|
|
// CommandFuture motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// CommandFuture motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// CommandFuture motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture); |
|
|
|
|
|
|
|
|
|
|
|
//XYZ回原点 |
|
|
//XYZ回原点 |
|
|
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(0.0,20.0); |
|
|
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(0.0,20.0); |
|
|
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(0.0,20.0); |
|
|
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(0.0,20.0); |
|
@ -227,14 +202,6 @@ public class SprayTaskExecutor { |
|
|
CommandFuture motorZPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetCommand); |
|
|
CommandFuture motorZPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetCommand); |
|
|
commandWait(motorXPositionSetCommandFuture, motorYPositionSetCommandFuture, motorZPositionSetCommandFuture); |
|
|
commandWait(motorXPositionSetCommandFuture, motorYPositionSetCommandFuture, motorZPositionSetCommandFuture); |
|
|
|
|
|
|
|
|
//还原速度 |
|
|
|
|
|
// motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//x轴电机速度设置 |
|
|
|
|
|
// motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//y轴电机速度设置 |
|
|
|
|
|
// motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//y轴电机速度设置 |
|
|
|
|
|
// motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand); |
|
|
|
|
|
// commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture); |
|
|
|
|
|
|
|
|
|
|
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(sprayTask.getCmdId(), sprayTask.getCmdCode(), CommandStatus.SUCCESS, "喷涂任务执行成功")); |
|
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(sprayTask.getCmdId(), sprayTask.getCmdCode(), CommandStatus.SUCCESS, "喷涂任务执行成功")); |
|
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(sprayTask.getCmdId(), sprayTask.getCmdCode(), CommandStatus.SPRAY_TASK_FINISH, "喷涂任务结束")); |
|
|
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(sprayTask.getCmdId(), sprayTask.getCmdCode(), CommandStatus.SPRAY_TASK_FINISH, "喷涂任务结束")); |
|
|