石墨消解仪后端服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.5 KiB

  1. package com.iflytop.gd.app.cmd;
  2. import com.iflytop.gd.app.core.BaseCommandHandler;
  3. import com.iflytop.gd.app.model.dto.CmdDTO;
  4. import com.iflytop.gd.app.service.DeviceCommandUtilService;
  5. import com.iflytop.gd.app.service.SelfTestService;
  6. import com.iflytop.gd.common.annotation.CommandMapping;
  7. import com.iflytop.gd.common.enums.cmd.CmdAxis;
  8. import lombok.RequiredArgsConstructor;
  9. import lombok.extern.slf4j.Slf4j;
  10. import org.springframework.stereotype.Component;
  11. import java.util.concurrent.CompletableFuture;
  12. /**
  13. * 指定加液机械臂回原点
  14. */
  15. @Slf4j
  16. @Component
  17. @RequiredArgsConstructor
  18. @CommandMapping("dual_robot_joint_origin")//业务指令注解
  19. public class DualRobotJointOriginCommand extends BaseCommandHandler {
  20. private final DeviceCommandUtilService deviceCommandUtilService;
  21. private final SelfTestService selfTestService;
  22. @Override
  23. public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
  24. Boolean joint1 = cmdDTO.getBooleanParam("joint1");
  25. Boolean joint2 = cmdDTO.getBooleanParam("joint1");
  26. return runAsync(() -> {
  27. if(joint1){
  28. deviceCommandUtilService.dualRobotOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand(), CmdAxis.joint1);
  29. selfTestService.getSelfTestState().setDualRobotJoint1Origin(true);
  30. }
  31. if(joint2){
  32. deviceCommandUtilService.dualRobotOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand(), CmdAxis.joint2);
  33. selfTestService.getSelfTestState().setDualRobotJoint2Origin(true);
  34. }
  35. });
  36. }
  37. }