4 changed files with 99 additions and 48 deletions
-
48src/main/java/com/iflytop/gd/app/cmd/GantryOriginCommand.java
-
33src/main/java/com/iflytop/gd/app/cmd/GantryXOriginCommand.java
-
33src/main/java/com/iflytop/gd/app/cmd/GantryYOriginCommand.java
-
33src/main/java/com/iflytop/gd/app/cmd/GantryZOriginCommand.java
@ -1,48 +0,0 @@ |
|||||
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 lombok.RequiredArgsConstructor; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.springframework.stereotype.Component; |
|
||||
|
|
||||
import java.util.concurrent.CompletableFuture; |
|
||||
|
|
||||
/** |
|
||||
* 龙门架机械臂指定轴回原点 |
|
||||
*/ |
|
||||
@Slf4j |
|
||||
@Component |
|
||||
@RequiredArgsConstructor |
|
||||
@CommandMapping("gantry_origin")//业务指令注解 |
|
||||
public class GantryOriginCommand extends BaseCommandHandler { |
|
||||
private final DeviceCommandUtilService deviceCommandUtilService; |
|
||||
private final SelfTestService selfTestService; |
|
||||
|
|
||||
@Override |
|
||||
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { |
|
||||
return runAsync(() -> { |
|
||||
//TODO 回原点指令要拆分成三个 |
|
||||
Boolean x = cmdDTO.getBooleanParam("x");//x轴是否回原点 |
|
||||
Boolean y = cmdDTO.getBooleanParam("y");//y轴是否回原点 |
|
||||
Boolean z = cmdDTO.getBooleanParam("z");//z轴是否回原点 |
|
||||
if (x != null && x) { |
|
||||
deviceCommandUtilService.gantryXMoveOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand()); |
|
||||
selfTestService.getSelfTestState().setGantryXOrigin(true);//设置是否在原点状态 |
|
||||
} |
|
||||
if (y != null && y) { |
|
||||
deviceCommandUtilService.gantryYMoveOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand()); |
|
||||
selfTestService.getSelfTestState().setGantryYOrigin(true);//设置是否在原点状态 |
|
||||
} |
|
||||
|
|
||||
if (z != null && z) { |
|
||||
deviceCommandUtilService.gantryZMoveOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand()); |
|
||||
selfTestService.getSelfTestState().setGantryZOrigin(true);//设置是否在原点状态 |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
|
|
@ -0,0 +1,33 @@ |
|||||
|
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 lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 龙门架机械臂x轴回原点 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("gantry_x_origin")//业务指令注解 |
||||
|
public class GantryXOriginCommand extends BaseCommandHandler { |
||||
|
private final DeviceCommandUtilService deviceCommandUtilService; |
||||
|
private final SelfTestService selfTestService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { |
||||
|
return runAsync(() -> { |
||||
|
deviceCommandUtilService.gantryXMoveOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand()); |
||||
|
selfTestService.getSelfTestState().setGantryXOrigin(true);//设置是否在原点状态 |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,33 @@ |
|||||
|
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 lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 龙门架机械臂y轴回原点 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("gantry_y_origin")//业务指令注解 |
||||
|
public class GantryYOriginCommand extends BaseCommandHandler { |
||||
|
private final DeviceCommandUtilService deviceCommandUtilService; |
||||
|
private final SelfTestService selfTestService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { |
||||
|
return runAsync(() -> { |
||||
|
deviceCommandUtilService.gantryYMoveOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand()); |
||||
|
selfTestService.getSelfTestState().setGantryYOrigin(true);//设置是否在原点状态 |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,33 @@ |
|||||
|
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 lombok.RequiredArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.concurrent.CompletableFuture; |
||||
|
|
||||
|
/** |
||||
|
* 龙门架机械臂z轴回原点 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@RequiredArgsConstructor |
||||
|
@CommandMapping("gantry_z_origin")//业务指令注解 |
||||
|
public class GantryZOriginCommand extends BaseCommandHandler { |
||||
|
private final DeviceCommandUtilService deviceCommandUtilService; |
||||
|
private final SelfTestService selfTestService; |
||||
|
|
||||
|
@Override |
||||
|
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { |
||||
|
return runAsync(() -> { |
||||
|
deviceCommandUtilService.gantryZMoveOrigin(cmdDTO.getCommandId(), cmdDTO.getCommand()); |
||||
|
selfTestService.getSelfTestState().setGantryZOrigin(true);//设置是否在原点状态 |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue