Browse Source

调整调试指令

master
白凤吉 2 months ago
parent
commit
5615afd555
  1. 12
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugDoorCloseCommand.java
  2. 12
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugDoorOpenCommand.java
  3. 8
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStartCommand.java
  4. 8
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStopCommand.java
  5. 10
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugHeaterStartCommand.java
  6. 8
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugHeaterStopCommand.java
  7. 18
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidMotorMoveByCommand.java
  8. 16
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidMotorMoveToCommand.java
  9. 2
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidMotorOriginCommand.java
  10. 2
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidMotorStopCommand.java
  11. 8
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpMoveByCommand.java
  12. 8
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpStartCommand.java
  13. 4
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThickCommand.java
  14. 4
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThinCommand.java
  15. 4
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenVacantCommand.java
  16. 4
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWasteCommand.java
  17. 4
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWaterCommand.java
  18. 10
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugMotorXMoveByCommand.java
  19. 2
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugMotorXMoveToCommand.java
  20. 10
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugMotorZMoveByCommand.java
  21. 2
      src/main/java/com/iflytop/sgs/app/cmd/debug/DebugMotorZMoveToCommand.java
  22. 2
      src/main/java/com/iflytop/sgs/app/service/device/module/SolutionModuleService.java
  23. 12
      src/main/java/com/iflytop/sgs/common/cmd/DeviceCommandGenerator.java

12
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugDoorCloseCommand.java

@ -26,10 +26,16 @@ public class DebugDoorCloseCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
Double speed = cmdDTO.getDoubleParam("speed");
return runAsync(() -> { return runAsync(() -> {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.doorMove(Double.valueOf(0));
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture);
if (speed != null) {
DeviceCommandBundle doorSetDeviceCommandBundle = DeviceCommandGenerator.doorSet(speed);
CommandFuture doorSetDeviceCommandSetFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), doorSetDeviceCommandBundle);
CommandUtil.wait(doorSetDeviceCommandSetFuture);
}
DeviceCommandBundle doorMoveDeviceCommand = DeviceCommandGenerator.doorMove(0.0);
CommandFuture doorMoveDeviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), doorMoveDeviceCommand);
CommandUtil.wait(doorMoveDeviceCommandFuture);
}); });
} }
} }

12
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugDoorOpenCommand.java

@ -1,11 +1,10 @@
package com.iflytop.sgs.app.cmd.debug; package com.iflytop.sgs.app.cmd.debug;
import cn.hutool.core.lang.Assert;
import com.iflytop.sgs.app.core.BaseCommandHandler; import com.iflytop.sgs.app.core.BaseCommandHandler;
import com.iflytop.sgs.app.model.dto.CmdDTO; import com.iflytop.sgs.app.model.dto.CmdDTO;
import com.iflytop.sgs.app.model.entity.DevicePosition; import com.iflytop.sgs.app.model.entity.DevicePosition;
import com.iflytop.sgs.app.service.device.DeviceCommandService;
import com.iflytop.sgs.app.service.api.DevicePositionService; import com.iflytop.sgs.app.service.api.DevicePositionService;
import com.iflytop.sgs.app.service.device.DeviceCommandService;
import com.iflytop.sgs.common.annotation.CommandMapping; import com.iflytop.sgs.common.annotation.CommandMapping;
import com.iflytop.sgs.common.cmd.CommandFuture; import com.iflytop.sgs.common.cmd.CommandFuture;
import com.iflytop.sgs.common.cmd.DeviceCommandBundle; import com.iflytop.sgs.common.cmd.DeviceCommandBundle;
@ -31,11 +30,14 @@ public class DebugDoorOpenCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
double speed = cmdDTO.getDoubleParam("speed");
Double speed = cmdDTO.getDoubleParam("speed");
DevicePosition devicePosition = devicePositionService.getPosition(DevicePositionCode.doorOpen); DevicePosition devicePosition = devicePositionService.getPosition(DevicePositionCode.doorOpen);
return runAsync(() -> { return runAsync(() -> {
CommandFuture deviceCommandSetFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), DeviceCommandGenerator.doorSet(speed));
CommandUtil.wait(deviceCommandSetFuture);
if (speed != null) {
DeviceCommandBundle doorSetDeviceCommandBundle = DeviceCommandGenerator.doorSet(speed);
CommandFuture doorSetDeviceCommandSetFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), doorSetDeviceCommandBundle);
CommandUtil.wait(doorSetDeviceCommandSetFuture);
}
CommandFuture deviceCommandOpenFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), DeviceCommandGenerator.doorMove(devicePosition.getDistance())); CommandFuture deviceCommandOpenFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), DeviceCommandGenerator.doorMove(devicePosition.getDistance()));
CommandUtil.wait(deviceCommandOpenFuture); CommandUtil.wait(deviceCommandOpenFuture);

8
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStartCommand.java

@ -27,16 +27,16 @@ public class DebugFanStartCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
String heatModuleCodeStr = cmdDTO.getStringParam("heatModuleCode");
HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatModuleCodeStr);
return runAsync(() -> { return runAsync(() -> {
String index = cmdDTO.getStringParam("index");
HeatModuleCode heatModuleId = HeatModuleCode.valueOf(index);
DeviceCommandBundle deviceCommand; DeviceCommandBundle deviceCommand;
switch (heatModuleId) {
switch (heatModuleCode) {
case heat_module_01 -> deviceCommand = DeviceCommandGenerator.fan1Open(); case heat_module_01 -> deviceCommand = DeviceCommandGenerator.fan1Open();
case heat_module_02 -> deviceCommand = DeviceCommandGenerator.fan2Open(); case heat_module_02 -> deviceCommand = DeviceCommandGenerator.fan2Open();
case heat_module_03 -> deviceCommand = DeviceCommandGenerator.fan3Open(); case heat_module_03 -> deviceCommand = DeviceCommandGenerator.fan3Open();
case heat_module_04 -> deviceCommand = DeviceCommandGenerator.fan4Open(); case heat_module_04 -> deviceCommand = DeviceCommandGenerator.fan4Open();
default -> throw new RuntimeException("index 未找到");
default -> throw new RuntimeException("heatModuleCode 未找到");
} }
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);

8
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugFanStopCommand.java

@ -27,16 +27,16 @@ public class DebugFanStopCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
String heatModuleCodeStr = cmdDTO.getStringParam("heatModuleCode");
HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatModuleCodeStr);
return runAsync(() -> { return runAsync(() -> {
String index = cmdDTO.getStringParam("index");
HeatModuleCode heatModuleId = HeatModuleCode.valueOf(index);
DeviceCommandBundle deviceCommand; DeviceCommandBundle deviceCommand;
switch (heatModuleId) {
switch (heatModuleCode) {
case heat_module_01 -> deviceCommand = DeviceCommandGenerator.fan1Close(); case heat_module_01 -> deviceCommand = DeviceCommandGenerator.fan1Close();
case heat_module_02 -> deviceCommand = DeviceCommandGenerator.fan2Close(); case heat_module_02 -> deviceCommand = DeviceCommandGenerator.fan2Close();
case heat_module_03 -> deviceCommand = DeviceCommandGenerator.fan3Close(); case heat_module_03 -> deviceCommand = DeviceCommandGenerator.fan3Close();
case heat_module_04 -> deviceCommand = DeviceCommandGenerator.fan4Close(); case heat_module_04 -> deviceCommand = DeviceCommandGenerator.fan4Close();
default -> throw new RuntimeException("index 未找到");
default -> throw new RuntimeException("heatModuleCode 未找到");
} }
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);

10
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugHeaterStartCommand.java

@ -27,17 +27,17 @@ public class DebugHeaterStartCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
String heatModuleCodeStr = cmdDTO.getStringParam("heatModuleCode");
Double temperature = cmdDTO.getDoubleParam("temperature");
HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatModuleCodeStr);
return runAsync(() -> { return runAsync(() -> {
String index = cmdDTO.getStringParam("index");
Double temperature = cmdDTO.getDoubleParam("temperature");
HeatModuleCode heatModuleId = HeatModuleCode.valueOf(index);
DeviceCommandBundle deviceCommand; DeviceCommandBundle deviceCommand;
switch (heatModuleId) {
switch (heatModuleCode) {
case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heatRod1Open(temperature); case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heatRod1Open(temperature);
case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heatRod2Open(temperature); case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heatRod2Open(temperature);
case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heatRod3Open(temperature); case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heatRod3Open(temperature);
case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heatRod4Open(temperature); case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heatRod4Open(temperature);
default -> throw new RuntimeException("index 未找到");
default -> throw new RuntimeException("heatModuleCode 未找到");
} }
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);

8
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugHeaterStopCommand.java

@ -27,16 +27,16 @@ public class DebugHeaterStopCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
String heatModuleCodeStr = cmdDTO.getStringParam("heatModuleCode");
HeatModuleCode heatModuleCode = HeatModuleCode.valueOf(heatModuleCodeStr);
return runAsync(() -> { return runAsync(() -> {
String index = cmdDTO.getStringParam("index");
HeatModuleCode heatModuleId = HeatModuleCode.valueOf(index);
DeviceCommandBundle deviceCommand; DeviceCommandBundle deviceCommand;
switch (heatModuleId) {
switch (heatModuleCode) {
case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heatRod1Close(); case heat_module_01 -> deviceCommand = DeviceCommandGenerator.heatRod1Close();
case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heatRod2Close(); case heat_module_02 -> deviceCommand = DeviceCommandGenerator.heatRod2Close();
case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heatRod3Close(); case heat_module_03 -> deviceCommand = DeviceCommandGenerator.heatRod3Close();
case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heatRod4Close(); case heat_module_04 -> deviceCommand = DeviceCommandGenerator.heatRod4Close();
default -> throw new RuntimeException("index 未找到");
default -> throw new RuntimeException("heatModuleCode 未找到");
} }
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);

18
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidMotorMoveByCommand.java

@ -28,14 +28,12 @@ public class DebugLiquidMotorMoveByCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
this.stop = false; this.stop = false;
Double distance = cmdDTO.getDoubleParam("distance");
Double speed = cmdDTO.getDoubleParam("speed");
Integer times = cmdDTO.getIntegerParam("times");
return runAsync(() -> { return runAsync(() -> {
Double distance = cmdDTO.getDoubleParam("distance");
Double speed = cmdDTO.getDoubleParam("speed");
Integer times = cmdDTO.getIntegerParam("times");
if (speed != null) { if (speed != null) {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.motorLiquidSet(speed);
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.liquidMotorSet(speed);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);
} }
@ -45,26 +43,24 @@ public class DebugLiquidMotorMoveByCommand extends BaseCommandHandler {
return; return;
} }
if (distance != null) { if (distance != null) {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.motorLiquidMoveBy(distance);
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.liquidMotorMoveBy(distance);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);
} }
if (distance != null) { if (distance != null) {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.motorLiquidMoveBy(-distance);
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.liquidMotorMoveBy(-distance);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);
} }
} }
} else { } else {
if (distance != null) { if (distance != null) {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.motorLiquidMoveBy(distance);
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.liquidMotorMoveBy(distance);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);
} }
} }
}); });
} }

16
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidMotorMoveToCommand.java

@ -24,16 +24,18 @@ import java.util.concurrent.CompletableFuture;
public class DebugLiquidMotorMoveToCommand extends BaseCommandHandler { public class DebugLiquidMotorMoveToCommand extends BaseCommandHandler {
private final DeviceCommandService deviceCommandService; private final DeviceCommandService deviceCommandService;
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) throws Exception { public CompletableFuture<Void> handle(CmdDTO cmdDTO) throws Exception {
double position = cmdDTO.getDoubleParam("position");
double speed = cmdDTO.getDoubleParam("speed");
Double position = cmdDTO.getDoubleParam("position");
Double speed = cmdDTO.getDoubleParam("speed");
return runAsync(() -> { return runAsync(() -> {
CommandFuture deviceSetCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), DeviceCommandGenerator.motorLiquidSet(speed));
CommandUtil.wait(deviceSetCommandFuture);
CommandFuture deviceMoveCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), DeviceCommandGenerator.motorLiquidMove(position));
CommandUtil.wait(deviceMoveCommandFuture);
DeviceCommandBundle liquidMotorSetDeviceCommandBundle = DeviceCommandGenerator.liquidMotorSet(speed);
CommandFuture liquidMotorSetDeviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidMotorSetDeviceCommandBundle);
CommandUtil.wait(liquidMotorSetDeviceCommandFuture);
DeviceCommandBundle liquidMotorMoveDeviceCommandBundle = DeviceCommandGenerator.liquidMotorMove(position);
CommandFuture liquidMotorMoveDeviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidMotorMoveDeviceCommandBundle);
CommandUtil.wait(liquidMotorMoveDeviceCommandFuture);
}); });
} }
} }

2
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidMotorOriginCommand.java

@ -15,7 +15,7 @@ import org.springframework.stereotype.Component;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
/** /**
* 加液位电机复位
* 加液位电机回原点
*/ */
@Slf4j @Slf4j
@Component @Component

2
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidMotorStopCommand.java

@ -27,7 +27,7 @@ public class DebugLiquidMotorStopCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
return runAsync(() -> { return runAsync(() -> {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.motorLiquidStop();
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.liquidMotorStop();
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);
}); });

8
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpMoveByCommand.java

@ -28,12 +28,10 @@ public class DebugLiquidPumpMoveByCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
this.stop = false; this.stop = false;
Double distance = cmdDTO.getDoubleParam("distance");
Double speed = cmdDTO.getDoubleParam("speed");
Integer times = cmdDTO.getIntegerParam("times");
return runAsync(() -> { return runAsync(() -> {
Double distance = cmdDTO.getDoubleParam("distance");
Double speed = cmdDTO.getDoubleParam("speed");
Integer times = cmdDTO.getIntegerParam("times");
if (speed != null) { if (speed != null) {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.liquidPumpSet(speed); DeviceCommandBundle deviceCommand = DeviceCommandGenerator.liquidPumpSet(speed);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);

8
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpStartCommand.java

@ -27,11 +27,11 @@ public class DebugLiquidPumpStartCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
Double speed = cmdDTO.getDoubleParam("speed");
String direction = cmdDTO.getStringParam("direction");//front back 正转倒转
Integer channel = 1;
CmdDirection cmdDirection = CmdDirection.valueOf(direction);
return runAsync(() -> { return runAsync(() -> {
Double speed = cmdDTO.getDoubleParam("speed");
String direction = cmdDTO.getStringParam("direction");//front back 正转倒转
Integer channel = 1;
CmdDirection cmdDirection = CmdDirection.valueOf(direction);
DeviceCommandBundle deviceCommand; DeviceCommandBundle deviceCommand;
if (speed != null) { if (speed != null) {
deviceCommand = DeviceCommandGenerator.liquidPumpStart(cmdDirection); deviceCommand = DeviceCommandGenerator.liquidPumpStart(cmdDirection);

4
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugValveSwitchThickCommand.java → src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThickCommand.java

@ -20,8 +20,8 @@ import java.util.concurrent.CompletableFuture;
@Slf4j @Slf4j
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
@CommandMapping("valve_switch_thick")
public class DebugValveSwitchThickCommand extends BaseCommandHandler {
@CommandMapping("liquid_valve_open_thick")
public class DebugLiquidValveOpenThickCommand extends BaseCommandHandler {
private final DeviceCommandService deviceCommandService; private final DeviceCommandService deviceCommandService;
@Override @Override

4
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugValveSwitchThinCommand.java → src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThinCommand.java

@ -20,8 +20,8 @@ import java.util.concurrent.CompletableFuture;
@Slf4j @Slf4j
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
@CommandMapping("valve_switch_thin")
public class DebugValveSwitchThinCommand extends BaseCommandHandler {
@CommandMapping("liquid_valve_open_thin")
public class DebugLiquidValveOpenThinCommand extends BaseCommandHandler {
private final DeviceCommandService deviceCommandService; private final DeviceCommandService deviceCommandService;
@Override @Override

4
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugValveSwitchVacantCommand.java → src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenVacantCommand.java

@ -20,8 +20,8 @@ import java.util.concurrent.CompletableFuture;
@Slf4j @Slf4j
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
@CommandMapping("valve_switch_vacant")
public class DebugValveSwitchVacantCommand extends BaseCommandHandler {
@CommandMapping("liquid_valve_open_vacant")
public class DebugLiquidValveOpenVacantCommand extends BaseCommandHandler {
private final DeviceCommandService deviceCommandService; private final DeviceCommandService deviceCommandService;
@Override @Override

4
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugValveSwitchWasteCommand.java → src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWasteCommand.java

@ -20,8 +20,8 @@ import java.util.concurrent.CompletableFuture;
@Slf4j @Slf4j
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
@CommandMapping("valve_switch_waste")
public class DebugValveSwitchWasteCommand extends BaseCommandHandler {
@CommandMapping("liquid_valve_open_waste")
public class DebugLiquidValveOpenWasteCommand extends BaseCommandHandler {
private final DeviceCommandService deviceCommandService; private final DeviceCommandService deviceCommandService;
@Override @Override

4
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugValveSwitchWaterCommand.java → src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWaterCommand.java

@ -20,8 +20,8 @@ import java.util.concurrent.CompletableFuture;
@Slf4j @Slf4j
@Component @Component
@RequiredArgsConstructor @RequiredArgsConstructor
@CommandMapping("valve_switch_water")
public class DebugValveSwitchWaterCommand extends BaseCommandHandler {
@CommandMapping("liquid_valve_open_water")
public class DebugLiquidValveOpenWaterCommand extends BaseCommandHandler {
private final DeviceCommandService deviceCommandService; private final DeviceCommandService deviceCommandService;
@Override @Override

10
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugMotorXMoveByCommand.java

@ -28,14 +28,10 @@ public class DebugMotorXMoveByCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
this.stop = false; this.stop = false;
Double distance = cmdDTO.getDoubleParam("distance");
Double speed = cmdDTO.getDoubleParam("speed");
Integer times = cmdDTO.getIntegerParam("times");
return runAsync(() -> { return runAsync(() -> {
Double distance = cmdDTO.getDoubleParam("distance");
Double speed = cmdDTO.getDoubleParam("speed");
Integer times = cmdDTO.getIntegerParam("times");
if (speed != null) { if (speed != null) {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferXSet(speed); DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferXSet(speed);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);

2
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugMotorXMoveToCommand.java

@ -26,7 +26,7 @@ public class DebugMotorXMoveToCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
double position = cmdDTO.getDoubleParam("position");
Double position = cmdDTO.getDoubleParam("position");
return runAsync(() -> { return runAsync(() -> {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferXMove(position); DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferXMove(position);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);

10
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugMotorZMoveByCommand.java

@ -28,13 +28,10 @@ public class DebugMotorZMoveByCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
this.stop = false; this.stop = false;
Double distance = cmdDTO.getDoubleParam("distance");
Double speed = cmdDTO.getDoubleParam("speed");
Integer times = cmdDTO.getIntegerParam("times");
return runAsync(() -> { return runAsync(() -> {
Double distance = cmdDTO.getDoubleParam("distance");
Double speed = cmdDTO.getDoubleParam("speed");
Integer times = cmdDTO.getIntegerParam("times");
if (speed != null) { if (speed != null) {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferZSet(speed); DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferZSet(speed);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
@ -65,7 +62,6 @@ public class DebugMotorZMoveByCommand extends BaseCommandHandler {
} }
}); });
} }

2
src/main/java/com/iflytop/sgs/app/cmd/debug/DebugMotorZMoveToCommand.java

@ -27,7 +27,7 @@ public class DebugMotorZMoveToCommand extends BaseCommandHandler {
@Override @Override
public CompletableFuture<Void> handle(CmdDTO cmdDTO) throws Exception { public CompletableFuture<Void> handle(CmdDTO cmdDTO) throws Exception {
double position = cmdDTO.getDoubleParam("position");
Double position = cmdDTO.getDoubleParam("position");
return runAsync(() -> { return runAsync(() -> {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferZMove(position); DeviceCommandBundle deviceCommand = DeviceCommandGenerator.transferZMove(position);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);

2
src/main/java/com/iflytop/sgs/app/service/device/module/SolutionModuleService.java

@ -97,7 +97,7 @@ public class SolutionModuleService {
* 加液机械臂移动到指定点 * 加液机械臂移动到指定点
*/ */
public void motorLiquidMove(String cmdId, String cmdCode, double position) throws Exception { public void motorLiquidMove(String cmdId, String cmdCode, double position) throws Exception {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.motorLiquidMove(position);
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.liquidMotorMove(position);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand);
CommandUtil.wait(deviceCommandFuture); CommandUtil.wait(deviceCommandFuture);
} }

12
src/main/java/com/iflytop/sgs/common/cmd/DeviceCommandGenerator.java

@ -86,7 +86,7 @@ public class DeviceCommandGenerator {
* *
* @param speed 速度 单位 mm/s * @param speed 速度 单位 mm/s
*/ */
public static DeviceCommandBundle motorLiquidSet(Double speed) {
public static DeviceCommandBundle liquidMotorSet(Double speed) {
DeviceCommandParams params = new DeviceCommandParams(); DeviceCommandParams params = new DeviceCommandParams();
params.setSpeed(speed); params.setSpeed(speed);
return setInfoCmd(CmdDevice.liquid_motor, CmdAction.set, params, "加液臂电机设置参数"); return setInfoCmd(CmdDevice.liquid_motor, CmdAction.set, params, "加液臂电机设置参数");
@ -178,7 +178,7 @@ public class DeviceCommandGenerator {
/** /**
* 加液位电机停止 * 加液位电机停止
*/ */
public static DeviceCommandBundle motorLiquidStop() {
public static DeviceCommandBundle liquidMotorStop() {
return controlMotorCmd(CmdDevice.liquid_motor, CmdAction.stop, null, "加液位电机 停止"); return controlMotorCmd(CmdDevice.liquid_motor, CmdAction.stop, null, "加液位电机 停止");
} }
@ -187,7 +187,7 @@ public class DeviceCommandGenerator {
* *
* @param position 位置 单位 mm * @param position 位置 单位 mm
*/ */
public static DeviceCommandBundle motorLiquidMove(Double position) {
public static DeviceCommandBundle liquidMotorMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams(); DeviceCommandParams params = new DeviceCommandParams();
params.setPosition(position); params.setPosition(position);
return controlMotorCmd(CmdDevice.liquid_motor, CmdAction.move, params, "加液升降电机移动"); return controlMotorCmd(CmdDevice.liquid_motor, CmdAction.move, params, "加液升降电机移动");
@ -198,7 +198,7 @@ public class DeviceCommandGenerator {
* *
* @param position 加液量 单位mL * @param position 加液量 单位mL
*/ */
public static DeviceCommandBundle motorLiquidMoveBy(Double position) {
public static DeviceCommandBundle liquidMotorMoveBy(Double position) {
DeviceCommandParams params = new DeviceCommandParams(); DeviceCommandParams params = new DeviceCommandParams();
params.setPosition(position); params.setPosition(position);
return controlCmd(CmdDevice.liquid_motor, CmdAction.move_by, params, "加液机械臂 相对移动"); return controlCmd(CmdDevice.liquid_motor, CmdAction.move_by, params, "加液机械臂 相对移动");
@ -216,10 +216,10 @@ public class DeviceCommandGenerator {
} }
/** /**
* 加液泵 泵1旋转
* 加液泵旋转
* *
*/ */
public static DeviceCommandBundle acidPump1Rotate(CmdDirection direction) {
public static DeviceCommandBundle liquidPumpRotate(CmdDirection direction) {
DeviceCommandParams params = new DeviceCommandParams(); DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction); params.setDirection(direction);
return setInfoCmd(CmdDevice.liquid_pump, CmdAction.rotate, params, "加液泵 旋转"); return setInfoCmd(CmdDevice.liquid_pump, CmdAction.rotate, params, "加液泵 旋转");

Loading…
Cancel
Save