|
|
@ -81,13 +81,13 @@ 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(); |
|
|
|
DeviceCommand motorZPositionSetAboveSlideCommand = DeviceCommandGenerator.motorZPositionSet(height); |
|
|
|
CommandFuture motorZPositionSetAboveSlideCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetAboveSlideCommand); |
|
|
|
commandWait(motorZPositionSetAboveSlideCommandFuture); |
|
|
|
// |
|
|
|
// SysSettings slideHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper<SysSettings>().eq(SysSettings::getCode, "slide_height")); |
|
|
|
// Double slideHeight = Double.parseDouble(slideHeightSysSettings.getValue()); |
|
|
|
// Double height = slideHeight - sprayTask.getSprayParams().getMotorZHeight();//下降z轴高度 |
|
|
|
// DeviceCommand motorZPositionSetAboveSlideCommand = DeviceCommandGenerator.motorZPositionSet(height); |
|
|
|
// CommandFuture motorZPositionSetAboveSlideCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetAboveSlideCommand); |
|
|
|
// commandWait(motorZPositionSetAboveSlideCommandFuture); |
|
|
|
|
|
|
|
DeviceCommand threeWayValveOpenSyringePipelineCommand = DeviceCommandGenerator.threeWayValveOpenSyringePipeline();//打开三通阀喷嘴管路 |
|
|
|
CommandFuture threeWayValveOpenSyringePipelineCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), threeWayValveOpenSyringePipelineCommand); |
|
|
@ -100,15 +100,45 @@ 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 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 motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(slideArr[sprayTaskStep.getIndex()][1],20.0); |
|
|
|
CommandFuture motorXPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXPositionSetCommand); |
|
|
|
CommandFuture motorYPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYPositionSetCommand); |
|
|
|
|
|
|
|
SysSettings slideHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper<SysSettings>().eq(SysSettings::getCode, "slide_height")); |
|
|
|
Double slideHeight = Double.parseDouble(slideHeightSysSettings.getValue()); |
|
|
|
Double height = slideHeight - sprayTask.getSprayParams().getMotorZHeight();//下降z轴高度 |
|
|
|
DeviceCommand motorZPositionSetAboveSlideCommand = DeviceCommandGenerator.motorZPositionSet(height,15.0); |
|
|
|
CommandFuture motorZPositionSetAboveSlideCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetAboveSlideCommand); |
|
|
|
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());//推动移动注射泵 |
|
|
|
CommandFuture syringePumpForwardCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpForwardCommand); |
|
|
|
commandWait(syringePumpForwardCommandFuture); |
|
|
@ -170,15 +200,33 @@ public class SprayTaskExecutor { |
|
|
|
CommandFuture nozzleValveCloseCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveCloseCommand); |
|
|
|
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回原点 |
|
|
|
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(0.0); |
|
|
|
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(0.0); |
|
|
|
DeviceCommand motorZPositionSetCommand = DeviceCommandGenerator.motorZPositionSet(0.0); |
|
|
|
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(0.0,20.0); |
|
|
|
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(0.0,20.0); |
|
|
|
DeviceCommand motorZPositionSetCommand = DeviceCommandGenerator.motorZPositionSet(0.0,15.0); |
|
|
|
CommandFuture motorXPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXPositionSetCommand); |
|
|
|
CommandFuture motorYPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYPositionSetCommand); |
|
|
|
CommandFuture motorZPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetCommand); |
|
|
|
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); |
|
|
|
|
|
|
|
SprayTask.getInstance().clear(); |
|
|
|
deviceStatus.setSpraying(false); |
|
|
|
deviceStatus.setSuspendable(false); |
|
|
|