Browse Source

调整自检逻辑

master
白凤吉 2 months ago
parent
commit
93647c2bf1
  1. 5
      src/main/java/com/iflytop/gd/app/command/selftest/TrayOutCommand.java
  2. 3
      src/main/java/com/iflytop/gd/app/service/device/module/DoorModuleService.java

5
src/main/java/com/iflytop/gd/app/command/selftest/TrayOutCommand.java

@ -25,6 +25,7 @@ import java.util.concurrent.CompletableFuture;
@RequiredArgsConstructor @RequiredArgsConstructor
@CommandMapping("tray_out")//业务指令注解 @CommandMapping("tray_out")//业务指令注解
public class TrayOutCommand extends BaseCommandHandler { public class TrayOutCommand extends BaseCommandHandler {
private final DoorModuleService doorModuleService;
private final HeatModuleService heatModuleService; private final HeatModuleService heatModuleService;
private final CapModuleService capModuleService; private final CapModuleService capModuleService;
private final SolutionModuleService solutionModuleService; private final SolutionModuleService solutionModuleService;
@ -57,6 +58,10 @@ public class TrayOutCommand extends BaseCommandHandler {
return runAsync(() -> { return runAsync(() -> {
try { try {
if(!deviceStateService.getDeviceState().getDoor().isOpen()){
doorModuleService.doorOpen();
deviceStateService.getDeviceState().getDoor().setOpen(true);
}
// TrayState trayState = deviceStateService.getTrayInSolutionModule(); // TrayState trayState = deviceStateService.getTrayInSolutionModule();
solutionModuleService.requestSolutionModule(cmdDTO.getCommandId(), cmdDTO.getCommand());//申请使用加液区并等待 solutionModuleService.requestSolutionModule(cmdDTO.getCommandId(), cmdDTO.getCommand());//申请使用加液区并等待
capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区至拍子夹取的高度 capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区至拍子夹取的高度

3
src/main/java/com/iflytop/gd/app/service/device/module/DoorModuleService.java

@ -21,7 +21,6 @@ import org.springframework.stereotype.Service;
public class DoorModuleService { public class DoorModuleService {
private final DeviceCommandService deviceCommandService; private final DeviceCommandService deviceCommandService;
private final DevicePositionService devicePositionService; private final DevicePositionService devicePositionService;
private final DeviceStateService deviceStateService;
/** /**
* 开门 * 开门
@ -38,7 +37,6 @@ public class DoorModuleService {
//从数据库获取开门距离 //从数据库获取开门距离
Double doorOpenDistance = devicePositionService.getPosition(DevicePositionCode.doorOpen).getDistance(); Double doorOpenDistance = devicePositionService.getPosition(DevicePositionCode.doorOpen).getDistance();
doorMove(commandId, command, doorOpenDistance); doorMove(commandId, command, doorOpenDistance);
deviceStateService.getDeviceState().getDoor().setOpen(true);
} }
/** /**
@ -53,7 +51,6 @@ public class DoorModuleService {
*/ */
public void doorClose(String commandId, String command) throws Exception { public void doorClose(String commandId, String command) throws Exception {
doorMove(commandId, command, 0); doorMove(commandId, command, 0);
deviceStateService.getDeviceState().getDoor().setOpen(true);
} }
/** /**

Loading…
Cancel
Save