diff --git a/src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorLiftDownCommandHandler.java b/src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorLiftDownCommandHandler.java index 0272217..acc8aef 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorLiftDownCommandHandler.java +++ b/src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorLiftDownCommandHandler.java @@ -34,7 +34,7 @@ public class CoverElevatorLiftDownCommandHandler extends BaseCommandHandler { CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); commandWait(deviceCommandFuture); } - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.trayMotorMoveBy(distance); + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.trayMotorMoveBy(-distance); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); commandWait(deviceCommandFuture); }); diff --git a/src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawOpenCommandHandler.java b/src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawOpenCommandHandler.java index 69ec167..c09d4df 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawOpenCommandHandler.java +++ b/src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawOpenCommandHandler.java @@ -22,21 +22,44 @@ import java.util.concurrent.CompletableFuture; @CommandMapping("debug_holding_jaw_open") public class HoldingJawOpenCommandHandler extends BaseCommandHandler { private final DeviceCommandService deviceCommandService; + private boolean stop = false; @Override public CompletableFuture handle(CmdDTO cmdDTO) { + this.stop = false; return runAsync(() -> { Double velocity = cmdDTO.getDoubleParam("velocity"); Double distance = cmdDTO.getDoubleParam("distance"); - if(velocity != null) { + Integer times = cmdDTO.getIntegerParam("times"); + if (velocity != null) { DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawSet(velocity); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); commandWait(deviceCommandFuture); } - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(distance); - CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); - commandWait(deviceCommandFuture); + if (times != null) { + for (int i = 0; i < times; i++) { + if (stop) { + return; + } + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(distance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + commandWait(deviceCommandFuture); + + DeviceCommandBundle backDeviceCommand = DeviceCommandGenerator.clawMove(-distance); + CommandFuture backDeviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), backDeviceCommand); + commandWait(backDeviceCommandFuture); + } + } else { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(distance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + commandWait(deviceCommandFuture); + } + }); } + + public synchronized void stop() { + this.stop = true; + } } diff --git a/src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawPauseCommandHandler.java b/src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawPauseCommandHandler.java index 86460d2..df27814 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawPauseCommandHandler.java +++ b/src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawPauseCommandHandler.java @@ -22,9 +22,11 @@ import java.util.concurrent.CompletableFuture; @CommandMapping("debug_holding_jaw_pause") public class HoldingJawPauseCommandHandler extends BaseCommandHandler { private final DeviceCommandService deviceCommandService; + private final HoldingJawOpenCommandHandler holdingJawOpenCommandHandler; @Override public CompletableFuture handle(CmdDTO cmdDTO) { + holdingJawOpenCommandHandler.stop(); return runAsync(() -> { DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawStop(); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); diff --git a/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftDownCommandHandler.java b/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftDownCommandHandler.java index 650c1e5..41c9e92 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftDownCommandHandler.java +++ b/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftDownCommandHandler.java @@ -24,13 +24,16 @@ import java.util.concurrent.CompletableFuture; @CommandMapping("debug_pallet_elevator_lift_down") public class PalletElevatorLiftDownCommandHandler extends BaseCommandHandler { private final DeviceCommandService deviceCommandService; + private boolean stop = false; @Override public CompletableFuture handle(CmdDTO cmdDTO) { + this.stop = false; return runAsync(() -> { String index = cmdDTO.getStringParam("index"); - Double distance =- cmdDTO.getDoubleParam("distance"); + Double distance = -cmdDTO.getDoubleParam("distance"); Double velocity = cmdDTO.getDoubleParam("velocity"); + Integer times = cmdDTO.getIntegerParam("times"); DeviceCommandBundle deviceCommand; HeatModuleId heatModuleId = HeatModuleId.valueOf(index); if (velocity != null) { @@ -47,18 +50,54 @@ public class PalletElevatorLiftDownCommandHandler extends BaseCommandHandler { commandWait(deviceCommandFuture); } - switch (heatModuleId) { - case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heaterMotor1MoveBy(distance); - case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heaterMotor2MoveBy(distance); - case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heaterMotor3MoveBy(distance); - case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heaterMotor4MoveBy(distance); - case heat_module_05 -> deviceCommand = DeviceCommandGenerator.heaterMotor5MoveBy(distance); - case heat_module_06 -> deviceCommand = DeviceCommandGenerator.heaterMotor6MoveBy(distance); - default -> throw new RuntimeException("index 未找到"); + if (times != null) { + for (int i = 0; i < times; i++) { + if (stop) { + return; + } + switch (heatModuleId) { + case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heaterMotor1MoveBy(-distance); + case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heaterMotor2MoveBy(-distance); + case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heaterMotor3MoveBy(-distance); + case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heaterMotor4MoveBy(-distance); + case heat_module_05 -> deviceCommand = DeviceCommandGenerator.heaterMotor5MoveBy(-distance); + case heat_module_06 -> deviceCommand = DeviceCommandGenerator.heaterMotor6MoveBy(-distance); + default -> throw new RuntimeException("index 未找到"); + } + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + commandWait(deviceCommandFuture); + + switch (heatModuleId) { + case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heaterMotor1MoveBy(distance); + case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heaterMotor2MoveBy(distance); + case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heaterMotor3MoveBy(distance); + case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heaterMotor4MoveBy(distance); + case heat_module_05 -> deviceCommand = DeviceCommandGenerator.heaterMotor5MoveBy(distance); + case heat_module_06 -> deviceCommand = DeviceCommandGenerator.heaterMotor6MoveBy(distance); + default -> throw new RuntimeException("index 未找到"); + } + CommandFuture backDeviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + commandWait(backDeviceCommandFuture); + + } + } else { + switch (heatModuleId) { + case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heaterMotor1MoveBy(-distance); + case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heaterMotor2MoveBy(-distance); + case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heaterMotor3MoveBy(-distance); + case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heaterMotor4MoveBy(-distance); + case heat_module_05 -> deviceCommand = DeviceCommandGenerator.heaterMotor5MoveBy(-distance); + case heat_module_06 -> deviceCommand = DeviceCommandGenerator.heaterMotor6MoveBy(-distance); + default -> throw new RuntimeException("index 未找到"); + } + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + commandWait(deviceCommandFuture); } - CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); - commandWait(deviceCommandFuture); }); } + + public synchronized void stop() { + this.stop = true; + } } diff --git a/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftUpCommandHandler.java b/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftUpCommandHandler.java index b0d104a..358cc8d 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftUpCommandHandler.java +++ b/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftUpCommandHandler.java @@ -23,13 +23,16 @@ import java.util.concurrent.CompletableFuture; @CommandMapping("debug_pallet_elevator_lift_up") public class PalletElevatorLiftUpCommandHandler extends BaseCommandHandler { private final DeviceCommandService deviceCommandService; + private boolean stop = false; @Override public CompletableFuture handle(CmdDTO cmdDTO) { + this.stop = false; return runAsync(() -> { String index = cmdDTO.getStringParam("index"); Double distance = cmdDTO.getDoubleParam("distance"); Double velocity = cmdDTO.getDoubleParam("velocity"); + Integer times = cmdDTO.getIntegerParam("times"); DeviceCommandBundle deviceCommand; HeatModuleId heatModuleId = HeatModuleId.valueOf(index); if (velocity != null) { @@ -45,19 +48,55 @@ public class PalletElevatorLiftUpCommandHandler extends BaseCommandHandler { CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); commandWait(deviceCommandFuture); } + if (times != null) { + for (int i = 0; i < times; i++) { + if (stop) { + return; + } + switch (heatModuleId) { + case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heaterMotor1MoveBy(distance); + case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heaterMotor2MoveBy(distance); + case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heaterMotor3MoveBy(distance); + case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heaterMotor4MoveBy(distance); + case heat_module_05 -> deviceCommand = DeviceCommandGenerator.heaterMotor5MoveBy(distance); + case heat_module_06 -> deviceCommand = DeviceCommandGenerator.heaterMotor6MoveBy(distance); + default -> throw new RuntimeException("index 未找到"); + } + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + commandWait(deviceCommandFuture); - switch (heatModuleId) { - case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heaterMotor1MoveBy(distance); - case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heaterMotor2MoveBy(distance); - case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heaterMotor3MoveBy(distance); - case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heaterMotor4MoveBy(distance); - case heat_module_05 -> deviceCommand = DeviceCommandGenerator.heaterMotor5MoveBy(distance); - case heat_module_06 -> deviceCommand = DeviceCommandGenerator.heaterMotor6MoveBy(distance); - default -> throw new RuntimeException("index 未找到"); + switch (heatModuleId) { + case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heaterMotor1MoveBy(-distance); + case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heaterMotor2MoveBy(-distance); + case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heaterMotor3MoveBy(-distance); + case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heaterMotor4MoveBy(-distance); + case heat_module_05 -> deviceCommand = DeviceCommandGenerator.heaterMotor5MoveBy(-distance); + case heat_module_06 -> deviceCommand = DeviceCommandGenerator.heaterMotor6MoveBy(-distance); + default -> throw new RuntimeException("index 未找到"); + } + CommandFuture backDeviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + commandWait(backDeviceCommandFuture); + + } + } else { + switch (heatModuleId) { + case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heaterMotor1MoveBy(distance); + case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heaterMotor2MoveBy(distance); + case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heaterMotor3MoveBy(distance); + case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heaterMotor4MoveBy(distance); + case heat_module_05 -> deviceCommand = DeviceCommandGenerator.heaterMotor5MoveBy(distance); + case heat_module_06 -> deviceCommand = DeviceCommandGenerator.heaterMotor6MoveBy(distance); + default -> throw new RuntimeException("index 未找到"); + } + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + commandWait(deviceCommandFuture); } - CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); - commandWait(deviceCommandFuture); + }); } + + public synchronized void stop() { + this.stop = true; + } } diff --git a/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorStopCommandHandler.java b/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorStopCommandHandler.java index e7ac3d1..7832e5b 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorStopCommandHandler.java +++ b/src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorStopCommandHandler.java @@ -24,9 +24,13 @@ import java.util.concurrent.CompletableFuture; @CommandMapping("debug_pallet_elevator_stop") public class PalletElevatorStopCommandHandler extends BaseCommandHandler { private final DeviceCommandService deviceCommandService; + private final PalletElevatorLiftUpCommandHandler palletElevatorLiftUpCommandHandler; + private final PalletElevatorLiftDownCommandHandler palletElevatorLiftDownCommandHandler; @Override public CompletableFuture handle(CmdDTO cmdDTO) { + palletElevatorLiftUpCommandHandler.stop(); + palletElevatorLiftDownCommandHandler.stop(); return runAsync(() -> { String index = cmdDTO.getStringParam("index"); HeatModuleId heatModuleId = HeatModuleId.valueOf(index); diff --git a/src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmMoveCommandHandler.java b/src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmMoveCommandHandler.java index 8fb2b57..0b48387 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmMoveCommandHandler.java +++ b/src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmMoveCommandHandler.java @@ -24,9 +24,11 @@ import java.util.concurrent.CompletableFuture; @CommandMapping("debug_transportation_arm_move") public class TransportationArmMoveCommandHandler extends BaseCommandHandler { private final DeviceCommandService deviceCommandService; + private boolean stop = false; @Override public CompletableFuture handle(CmdDTO cmdDTO) { + this.stop = false; return runAsync(() -> { Double xDimDistance = cmdDTO.getDoubleParam("xDimDistance"); Double yDimDistance = cmdDTO.getDoubleParam("yDimDistance"); @@ -35,18 +37,20 @@ public class TransportationArmMoveCommandHandler extends BaseCommandHandler { Double xDimVelocity = cmdDTO.getDoubleParam("xDimVelocity"); Double yDimVelocity = cmdDTO.getDoubleParam("yDimVelocity"); Double zDimVelocity = cmdDTO.getDoubleParam("zDimVelocity"); + Integer times = cmdDTO.getIntegerParam("times"); + List futuresList = new ArrayList<>(); - if(xDimVelocity != null){ + if (xDimVelocity != null) { DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryXSet(xDimVelocity); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); futuresList.add(deviceCommandFuture); } - if(yDimVelocity != null){ + if (yDimVelocity != null) { DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryYSet(yDimVelocity); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); futuresList.add(deviceCommandFuture); } - if(zDimVelocity != null){ + if (zDimVelocity != null) { DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryZSet(zDimVelocity); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); futuresList.add(deviceCommandFuture); @@ -54,24 +58,70 @@ public class TransportationArmMoveCommandHandler extends BaseCommandHandler { commandWait(futuresList.toArray(new CommandFuture[0])); futuresList.clear(); - if (xDimDistance != null) { - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryXMoveBy(xDimDistance); - CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); - futuresList.add(deviceCommandFuture); - } - if (yDimDistance != null) { - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryYMoveBy(yDimDistance); - CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); - futuresList.add(deviceCommandFuture); - } - if (zDimDistance != null) { - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryZMoveBy(zDimDistance); - CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); - futuresList.add(deviceCommandFuture); + if (times != null) { + for (int i = 0; i < times; i++) { + if (stop) { + return; + } + if (xDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryXMoveBy(xDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + if (yDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryYMoveBy(yDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + if (zDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryZMoveBy(zDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + commandWait(futuresList.toArray(new CommandFuture[0])); + if (xDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryXMoveBy(-xDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + if (yDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryYMoveBy(-yDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + if (zDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryZMoveBy(-zDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + commandWait(futuresList.toArray(new CommandFuture[0])); + } + } else { + if (xDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryXMoveBy(xDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + if (yDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryYMoveBy(yDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + if (zDimDistance != null) { + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.gantryZMoveBy(zDimDistance); + CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); + futuresList.add(deviceCommandFuture); + } + + commandWait(futuresList.toArray(new CommandFuture[0])); } - commandWait(futuresList.toArray(new CommandFuture[0])); + }); } + + public synchronized void stop() { + this.stop = true; + } } diff --git a/src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmStopCommandHandler.java b/src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmStopCommandHandler.java index 2503e5d..fc6b754 100644 --- a/src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmStopCommandHandler.java +++ b/src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmStopCommandHandler.java @@ -24,9 +24,11 @@ import java.util.concurrent.CompletableFuture; @CommandMapping("debug_transportation_arm_stop") public class TransportationArmStopCommandHandler extends BaseCommandHandler { private final DeviceCommandService deviceCommandService; + private final TransportationArmMoveCommandHandler transportationArmMoveCommandHandler; @Override public CompletableFuture handle(CmdDTO cmdDTO) { + transportationArmMoveCommandHandler.stop(); return runAsync(() -> { List dim = (List) cmdDTO.getParams().get("dim"); List futuresList = new ArrayList<>();