From 0335ed60aaefc820718cd88593a5a822e5022411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Tue, 18 Mar 2025 20:38:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=9A=82=E5=81=9C=E6=97=B6=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=BC=80=E5=90=AF=E9=AB=98=E5=8E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../front/cmd/business/MatrixSprayChangeParam.java | 35 +++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java b/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java index 48b9035..791ecf6 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java @@ -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);//开启高压