石墨消解仪后端服务
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

package com.iflytop.gd.app.cmd;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.app.service.DeviceCommandUtilService;
import com.iflytop.gd.app.service.SelfTestService;
import com.iflytop.gd.common.annotation.CommandMapping;
import com.iflytop.gd.common.enums.cmd.CmdAxis;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.concurrent.CompletableFuture;
/**
* 指定加液机械臂回原点
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("dual_robot_joint_origin")//业务指令注解
public class DualRobotJointOriginCommand extends BaseCommandHandler {
private final DeviceCommandUtilService deviceCommandUtilService;
private final SelfTestService selfTestService;
@Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
Boolean joint1 = cmdDTO.getBooleanParam("joint1");
Boolean joint2 = cmdDTO.getBooleanParam("joint1");
return runAsync(() -> {
if(joint1){
deviceCommandUtilService.dualRobotOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand(), CmdAxis.joint1);
selfTestService.getSelfTestState().setDualRobotJoint1Origin(true);
}
if(joint2){
deviceCommandUtilService.dualRobotOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand(), CmdAxis.joint2);
selfTestService.getSelfTestState().setDualRobotJoint2Origin(true);
}
});
}
}