From 0b29713a453a600b1bc75fa21a7766640cfe46c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Fri, 21 Mar 2025 07:40:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E4=B9=9F=E4=B8=8D=E7=9F=A5=E9=81=93?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E4=BB=80=E4=B9=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ms/app/device/spray/SprayTaskExecutor.java | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/qyft/ms/app/device/spray/SprayTaskExecutor.java b/src/main/java/com/qyft/ms/app/device/spray/SprayTaskExecutor.java index 9088c1b..bc9ae17 100644 --- a/src/main/java/com/qyft/ms/app/device/spray/SprayTaskExecutor.java +++ b/src/main/java/com/qyft/ms/app/device/spray/SprayTaskExecutor.java @@ -119,7 +119,7 @@ public class SprayTaskExecutor { // commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture); //先移动到玻片位置 DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(slideArr[sprayTaskStep.getIndex()][0],20.0); - DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(slideArr[sprayTaskStep.getIndex()][1],20.0); + DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(75.5 - slideArr[sprayTaskStep.getIndex()][1],20.0); CommandFuture motorXPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXPositionSetCommand); CommandFuture motorYPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYPositionSetCommand); @@ -156,19 +156,16 @@ public class SprayTaskExecutor { List commandFutureList = new ArrayList<>(); double aXPoint = (double) sprayStepCommands.get(0).getParam().get("position"); double aYPoint = (double) sprayStepCommands.get(1).getParam().get("position"); - for (DeviceCommand sprayStep : sprayStepCommands) { - if(cacheXPoint != aXPoint){ - CommandFuture commandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), sprayStep); - commandFutureList.add(commandFuture); - cacheXPoint = aXPoint; - } - if(cacheYPoint != aYPoint){ - CommandFuture commandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), sprayStep); - commandFutureList.add(commandFuture); - cacheYPoint = aYPoint; - } + if(cacheXPoint != aXPoint){ + CommandFuture commandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), sprayStepCommands.get(0)); + commandFutureList.add(commandFuture); + cacheXPoint = aXPoint; + } + if(cacheYPoint != aYPoint){ + CommandFuture commandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), sprayStepCommands.get(1)); + commandFutureList.add(commandFuture); + cacheYPoint = aYPoint; } - CommandFuture[] commandFutureArray = commandFutureList.toArray(new CommandFuture[0]); Point2D currentPoint; Point2D nextPoint = null;