|
|
@ -37,24 +37,25 @@ public class MatrixSprayChangeParam extends BaseCommandHandler { |
|
|
|
Double highVoltageValue = form.getDoubleParam("highVoltageValue"); |
|
|
|
Double movingSpeed = form.getDoubleParam("movingSpeed"); |
|
|
|
sprayTask.setChangeSprayParam(motorZHeight, gasPressure, volume, highVoltage, highVoltageValue, movingSpeed); |
|
|
|
|
|
|
|
//1.速度 |
|
|
|
DeviceCommand motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(movingSpeed);//x轴电机速度设置 |
|
|
|
DeviceCommand motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(movingSpeed);//y轴电机速度设置 |
|
|
|
DeviceCommand motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(movingSpeed);//z轴电机速度设置 |
|
|
|
CommandFuture motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(motorXSpeedSetCmdToDeviceCommand, form, emitter); |
|
|
|
CommandFuture motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(motorYSpeedSetCmdToDeviceCommand, form, emitter); |
|
|
|
CommandFuture motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(motorZSpeedSetCmdToDeviceCommand, form, emitter); |
|
|
|
commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture); |
|
|
|
//2.流速 |
|
|
|
DeviceCommand syringePumpVolumeSetCommand = DeviceCommandGenerator.syringePumpVolumeSet(volume);//注射泵流速设置 |
|
|
|
CommandFuture syringePumpVolumeSetCommandFuture = deviceCommandService.sendCommand(syringePumpVolumeSetCommand, form, emitter); |
|
|
|
commandWait(syringePumpVolumeSetCommandFuture); |
|
|
|
//3.z轴高度 |
|
|
|
Double height = 101.2 - motorZHeight;//TODO 101.2是玻片高度,这个应该从数据库中获取 |
|
|
|
DeviceCommand smotorZPositionSetCommand = DeviceCommandGenerator.motorZPositionSet(height);//移动z轴到指定位置 |
|
|
|
CommandFuture smotorZPositionSetCommandFuture = deviceCommandService.sendCommand(smotorZPositionSetCommand, form, emitter); |
|
|
|
commandWait(smotorZPositionSetCommandFuture); |
|
|
|
if (!sprayTask.isPaused()) { |
|
|
|
//1.速度 |
|
|
|
DeviceCommand motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(movingSpeed);//x轴电机速度设置 |
|
|
|
DeviceCommand motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(movingSpeed);//y轴电机速度设置 |
|
|
|
DeviceCommand motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(movingSpeed);//z轴电机速度设置 |
|
|
|
CommandFuture motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(motorXSpeedSetCmdToDeviceCommand, form, emitter); |
|
|
|
CommandFuture motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(motorYSpeedSetCmdToDeviceCommand, form, emitter); |
|
|
|
CommandFuture motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(motorZSpeedSetCmdToDeviceCommand, form, emitter); |
|
|
|
commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture); |
|
|
|
//2.流速 |
|
|
|
DeviceCommand syringePumpVolumeSetCommand = DeviceCommandGenerator.syringePumpVolumeSet(volume);//注射泵流速设置 |
|
|
|
CommandFuture syringePumpVolumeSetCommandFuture = deviceCommandService.sendCommand(syringePumpVolumeSetCommand, form, emitter); |
|
|
|
commandWait(syringePumpVolumeSetCommandFuture); |
|
|
|
//3.z轴高度 |
|
|
|
Double height = 101.2 - motorZHeight;//TODO 101.2是玻片高度,这个应该从数据库中获取 |
|
|
|
DeviceCommand smotorZPositionSetCommand = DeviceCommandGenerator.motorZPositionSet(height);//移动z轴到指定位置 |
|
|
|
CommandFuture smotorZPositionSetCommandFuture = deviceCommandService.sendCommand(smotorZPositionSetCommand, form, emitter); |
|
|
|
commandWait(smotorZPositionSetCommandFuture); |
|
|
|
//4.是否打开高压 |
|
|
|
if (highVoltage) {//打开高压 |
|
|
|
DeviceCommand highVoltageOpenCommand = DeviceCommandGenerator.highVoltageOpen(highVoltageValue);//开启高压 |
|
|
|