Browse Source

feat:封装指令

master
白凤吉 3 months ago
parent
commit
31ec814dd8
  1. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStartRecycleCommandHandler.java
  2. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStartRefrigerationCommandHandler.java
  3. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStopHeatingCommandHandler.java
  4. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStopRecycleCommandHandler.java
  5. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStopRefrigerationCommandHandler.java
  6. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorLiftDownCommandHandler.java
  7. 23
      src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorLiftUpCommandHandler.java
  8. 16
      src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorResetCommandHandler.java
  9. 16
      src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorStopCommandHandler.java
  10. 21
      src/main/java/com/iflytop/gd/app/cmd/debug/DoorCloseCommandHandler.java
  11. 21
      src/main/java/com/iflytop/gd/app/cmd/debug/DoorOpenCommandHandler.java
  12. 21
      src/main/java/com/iflytop/gd/app/cmd/debug/DoorStopCommandHandler.java
  13. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/HeaterStartCommandHandler.java
  14. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/HeaterStartHeatMaintainingCommandHandler.java
  15. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/HeaterStopCommandHandler.java
  16. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/HeaterStopMaintainingCommandHandler.java
  17. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawCloseCommandHandler.java
  18. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawOpenCommandHandler.java
  19. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawPauseCommandHandler.java
  20. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/LiquidArmResetCommandHandler.java
  21. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/LiquidArmRotateCommandHandler.java
  22. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/LiquidArmStopCommandHandler.java
  23. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/LiquidPumpPreEvacuateCommandHandler.java
  24. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/LiquidPumpPrefillCommandHandler.java
  25. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/LiquidPumpStartCommandHandler.java
  26. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/LiquidPumpStopCommandHandler.java
  27. 23
      src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftDownCommandHandler.java
  28. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftUpCommandHandler.java
  29. 23
      src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorStopCommandHandler.java
  30. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/ShakerStartCommandHandler.java
  31. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/ShakerStopCommandHandler.java
  32. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmMoveCommandHandler.java
  33. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmResetCommandHandler.java
  34. 22
      src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmStopCommandHandler.java
  35. 11
      src/main/java/com/iflytop/gd/app/cmd/debug/debugDoorMove.java
  36. 13
      src/main/java/com/iflytop/gd/app/controller/CmdController.java
  37. 22
      src/main/java/com/iflytop/gd/app/controller/CmdDebugController.java
  38. 7
      src/main/java/com/iflytop/gd/app/core/CommandHandlerRegistry.java
  39. 497
      src/main/java/com/iflytop/gd/common/cmd/DeviceCommandGenerator.java
  40. 3
      src/main/java/com/iflytop/gd/common/cmd/DeviceCommandParams.java
  41. 29
      src/main/java/com/iflytop/gd/common/enums/AcidPumpDevice.java
  42. 12
      src/main/java/com/iflytop/gd/common/enums/HeatModuleId.java
  43. 2
      src/main/java/com/iflytop/gd/common/enums/cmd/CmdAction.java
  44. 46
      src/main/java/com/iflytop/gd/common/enums/cmd/CmdDevice.java
  45. 5
      src/main/java/com/iflytop/gd/common/result/ResultCode.java

22
src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStartRecycleCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理冷阱开启循环指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_cold_trap_start_recycle")
public class ColdTrapStartRecycleCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStartRefrigerationCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理启动冷阱制冷指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_cold_trap_start_refrigeration")
public class ColdTrapStartRefrigerationCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStopHeatingCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理冷阱停止加热指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_cold_trap_stop_heating")
public class ColdTrapStopHeatingCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStopRecycleCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理停止冷阱循环指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_cold_trap_stop_recycle")
public class ColdTrapStopRecycleCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStopRefrigerationCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理停止冷阱制冷指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_cold_trap_stop_refrigeration")
public class ColdTrapStopRefrigerationCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorLiftDownCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理拍子电机下降指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_cover_elevator_lift_down")
public class CoverElevatorLiftDownCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

23
src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorLiftUpCommandHandler.java

@ -1,23 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理拍子电机抬升指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_cover_elevator_lift_up")
public class CoverElevatorLiftUpCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

16
src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorResetCommandHandler.java

@ -1,16 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
/**
* 处理拍子抬升电机复位指令
*/
@CommandMapping("debug_cover_elevator_reset")
public class CoverElevatorResetCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

16
src/main/java/com/iflytop/gd/app/cmd/debug/CoverElevatorStopCommandHandler.java

@ -1,16 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
/**
* 处理拍子抬升电机停止指令
*/
@CommandMapping("debug_cover_elevator_stop")
public class CoverElevatorStopCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

21
src/main/java/com/iflytop/gd/app/cmd/debug/DoorCloseCommandHandler.java

@ -1,21 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理关门指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_door_close")
public class DoorCloseCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

21
src/main/java/com/iflytop/gd/app/cmd/debug/DoorOpenCommandHandler.java

@ -1,21 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理开门指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_door_open")
public class DoorOpenCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

21
src/main/java/com/iflytop/gd/app/cmd/debug/DoorStopCommandHandler.java

@ -1,21 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理停止门运动指令处理器
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_door_stop")
public class DoorStopCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/HeaterStartCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理启动加热器指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_heater_start")
public class HeaterStartCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/HeaterStartHeatMaintainingCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理启动加热器恒温指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_heater_start_heat_maintaining")
public class HeaterStartHeatMaintainingCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/HeaterStopCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理停止加热器指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_heater_stop")
public class HeaterStopCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/HeaterStopMaintainingCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理停止恒温加热指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_heater_stop_heat_maintaining")
public class HeaterStopMaintainingCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawCloseCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理夹爪闭合指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_holding_jaw_close")
public class HoldingJawCloseCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawOpenCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理打开夹爪指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_holding_jaw_open")
public class HoldingJawOpenCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawPauseCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理暂停夹爪指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_holding_jaw_pause")
public class HoldingJawPauseCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/LiquidArmResetCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 复位加液臂指令处理器
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_liquid_arm_reset")
public class LiquidArmResetCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/LiquidArmRotateCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理加液臂旋转指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_liquid_arm_rotation")
public class LiquidArmRotateCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/LiquidArmStopCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理加液臂停止指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_liquid_arm_stop")
public class LiquidArmStopCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/LiquidPumpPreEvacuateCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理排空加液头指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_liquid_pump_pre_evacuation")
public class LiquidPumpPreEvacuateCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/LiquidPumpPrefillCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理加液头预充指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_liquid_pump_pre_filling")
public class LiquidPumpPrefillCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/LiquidPumpStartCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理加液泵启动指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_liquid_pump_start")
public class LiquidPumpStartCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/LiquidPumpStopCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理加液泵停止指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_liquid_pump_stop")
public class LiquidPumpStopCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

23
src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftDownCommandHandler.java

@ -1,23 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理降下托盘指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_pallet_elevator_lift_down")
public class PalletElevatorLiftDownCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorLiftUpCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理托盘电机上升指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_pallet_elevator_lift_up")
public class PalletElevatorLiftUpCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

23
src/main/java/com/iflytop/gd/app/cmd/debug/PalletElevatorStopCommandHandler.java

@ -1,23 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理停止托盘抬升器指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_pallet_elevator_stop")
public class PalletElevatorStopCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/ShakerStartCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理启动摇匀器指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_shaker_start")
public class ShakerStartCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/ShakerStopCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理停止摇匀器指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_shaker_stop")
public class ShakerStopCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmMoveCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理移动转移机械臂指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_transportation_arm_move")
public class TransportationArmMoveCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmResetCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理复位转移机械臂指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_transportation_arm_reset")
public class TransportationArmResetCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

22
src/main/java/com/iflytop/gd/app/cmd/debug/TransportationArmStopCommandHandler.java

@ -1,22 +0,0 @@
package com.iflytop.gd.app.cmd.debug;
import com.iflytop.gd.app.core.BaseCommandHandler;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.annotation.CommandMapping;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理停止转移机械臂移动指令
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_transportation_arm_stop")
public class TransportationArmStopCommandHandler extends BaseCommandHandler {
@Override
public void handle(CmdDTO cmdDTO) {
}
}

11
src/main/java/com/iflytop/gd/app/cmd/debug/ColdTrapStartHeatingCommandHandler.java → src/main/java/com/iflytop/gd/app/cmd/debug/debugDoorMove.java

@ -12,20 +12,19 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* 处理冷阱开启加热
* 门电机 移动指定距离
*/
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("debug_cold_trap_start_heating")
public class ColdTrapStartHeatingCommandHandler extends BaseCommandHandler {
@CommandMapping("debug_door_move")
public class debugDoorMove extends BaseCommandHandler {
private final DeviceCommandService deviceCommandService;
@Override
public void handle(CmdDTO cmdDTO) throws Exception {
DeviceCommand deviceCommand = DeviceCommandGenerator.coldTrapOpenHeart();
Double position = cmdDTO.getDoubleParam("position");
DeviceCommand deviceCommand = DeviceCommandGenerator.doorMove(position);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
commandWait(deviceCommandFuture);
}
}

13
src/main/java/com/iflytop/gd/app/controller/CmdController.java

@ -1,9 +1,8 @@
package com.iflytop.gd.app.controller;
import com.iflytop.gd.common.cmd.CommandHandler;
import com.iflytop.gd.app.core.CommandHandlerRegistry;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.exception.UnSupportCommandException;
import com.iflytop.gd.common.cmd.CommandHandler;
import com.iflytop.gd.common.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -25,19 +24,11 @@ public class CmdController {
@Operation(summary = "前端统一调用一个接口")
@PostMapping
public Result<?> controlMethod(@Valid @RequestBody CmdDTO cmdDTO) {
public Result<?> controlMethod(@Valid @RequestBody CmdDTO cmdDTO) throws Exception {
String commandName = cmdDTO.getCommand();
try {
CommandHandler commandHandler = registry.getCommandHandler(commandName);
log.info("业务指令开始执行");
commandHandler.handle(cmdDTO);
} catch (UnSupportCommandException exception) {
log.error("未找到对应的业务指令");
return Result.failed(exception.getMessage());
} catch (Exception e) {
log.error("执行业务指令发生异常: {}", cmdDTO, e);
return Result.failed(e.getMessage());
}
return Result.success();
}

22
src/main/java/com/iflytop/gd/app/controller/CmdDebugController.java

@ -1,10 +1,9 @@
package com.iflytop.gd.app.controller;
import com.iflytop.gd.app.core.CommandHandlerRegistry;
import com.iflytop.gd.app.model.dto.CmdDTO;
import com.iflytop.gd.common.exception.UnSupportCommandException;
import com.iflytop.gd.common.result.Result;
import com.iflytop.gd.common.cmd.CommandHandler;
import com.iflytop.gd.app.core.CommandHandlerRegistry;
import com.iflytop.gd.common.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
@ -15,8 +14,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.CompletableFuture;
@Tag(name = "前端调试指令")
@RestController
@RequestMapping("/api/debug/cmd")
@ -27,22 +24,11 @@ public class CmdDebugController {
@Operation(summary = "前端调试指令")
@PostMapping
public Result<?> controlMethod(@Valid @RequestBody CmdDTO cmdDTO) {
public Result<?> controlMethod(@Valid @RequestBody CmdDTO cmdDTO) throws Exception {
String commandName = cmdDTO.getCommand();
try {
log.info("收到调试指令{}", commandName);
CommandHandler commandHandler = registry.getCommandHandler(commandName);
log.info("找到指令处理器{}", commandHandler.getClass().getName());
log.info("调试指令开始执行");
commandHandler.handle(cmdDTO);
log.info("指令处理器提交异步执行");
} catch (UnSupportCommandException exception) {
log.error("未找到对应的调试指令{}", commandName);
String errorMsg = "未找到对应的调试指令, commandName=" + commandName;
return Result.failed(errorMsg);
} catch (Exception e) {
log.error("执行调试指令发生异常: {}", cmdDTO, e);
return Result.failed(e.getMessage());
}
return Result.success();
}

7
src/main/java/com/iflytop/gd/app/core/CommandHandlerRegistry.java

@ -1,8 +1,10 @@
package com.iflytop.gd.app.core;
import com.iflytop.gd.common.exception.UnSupportCommandException;
import com.iflytop.gd.common.annotation.CommandMapping;
import com.iflytop.gd.common.cmd.CommandHandler;
import com.iflytop.gd.common.exception.AppException;
import com.iflytop.gd.common.exception.UnSupportCommandException;
import com.iflytop.gd.common.result.ResultCode;
import io.micrometer.common.lang.NonNull;
import jakarta.annotation.PostConstruct;
import jakarta.validation.constraints.NotNull;
@ -42,13 +44,14 @@ public class CommandHandlerRegistry implements ApplicationContextAware {
/**
* 通过模块名称和命令名称获取命令处理器
*
* @param commandName 命令名称
* @return 命令处理器
* @throws UnSupportCommandException
*/
public CommandHandler getCommandHandler(@NotNull String commandName) throws UnSupportCommandException {
if (!handlerMap.containsKey(commandName)) {
throw new UnSupportCommandException("commandName=" + commandName);
throw new AppException(ResultCode.COMMAND_NOT_FOUND);
}
return handlerMap.get(commandName);
}

497
src/main/java/com/iflytop/gd/common/cmd/DeviceCommandGenerator.java

@ -9,331 +9,404 @@ import com.iflytop.gd.common.enums.cmd.*;
public class DeviceCommandGenerator {
/**
* 打开
* 移动
*
* @param position 位置 单位mm
*/
public static DeviceCommand doorOpen() {
return controlMotorCmd(CmdDevice.door, CmdAction.open, null, "打开设备门");
public static DeviceCommand doorMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setPosition(position);
return controlMotorCmd(CmdDevice.door_motor, CmdAction.move, params, "门 移动");
}
/**
* 关闭
* 停止动作
*/
public static DeviceCommand doorClose() {
return controlMotorCmd(CmdDevice.door, CmdAction.close, null, "关闭设备门");
public static DeviceCommand doorStop() {
return controlMotorCmd(CmdDevice.door_motor, CmdAction.stop, null, "门 停止");
}
/**
* 停止动作
* 回原点
*/
public static DeviceCommand doorStop() {
return controlMotorCmd(CmdDevice.door, CmdAction.stop, null, "停止门动作");
public static DeviceCommand doorOrigin() {
return controlMotorCmd(CmdDevice.door_motor, CmdAction.origin, null, "门 回原点");
}
/**
* 摇匀电机 设置参数
* 设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand shakeMotorSet(Double current, Double speed) {
public static DeviceCommand doorSet(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.shake_motor, CmdAction.set, params, "摇匀电机设置参数");
return setInfoCmd(CmdDevice.door_motor, CmdAction.set, null, "门 设置参数");
}
/**
* 摇匀电机 开始摇匀
*/
public static DeviceCommand shakeMotorStart() {
return controlMotorCmd(CmdDevice.shake_motor, CmdAction.start, null, "开始摇匀");
return controlMotorCmd(CmdDevice.shake_motor, CmdAction.start, null, "摇匀 开始");
}
/**
* 摇匀电机 结束摇匀
*/
public static DeviceCommand shakeMotorStop() {
return controlMotorCmd(CmdDevice.shake_motor, CmdAction.stop, null, "结束摇匀");
return controlMotorCmd(CmdDevice.shake_motor, CmdAction.stop, null, "摇匀 结束");
}
/**
* 托盘电机 设置参数
* 摇匀电机 设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 r/s
*/
public static DeviceCommand trayMotorSet(Double current, Double speed) {
public static DeviceCommand shakeMotorSet(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.tray_motor, CmdAction.set, params, "托盘电机设置参数");
}
/**
* 托盘电机 回原点
*/
public static DeviceCommand trayMotorOrigin() {
return controlMotorCmd(CmdDevice.tray_motor, CmdAction.origin, null, "托盘电机回原点");
return setInfoCmd(CmdDevice.shake_motor, CmdAction.set, params, "摇匀 设置参数");
}
/**
* 托盘电机 移动
* 拍子升降电机 移动
*
* @param position 位置 单位mm
*/
public static DeviceCommand trayMotorMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setPosition(position);
return controlMotorCmd(CmdDevice.tray_motor, CmdAction.move, params, "托盘电机移动");
return controlMotorCmd(CmdDevice.tray_motor, CmdAction.move, params, "拍子升降电机 移动");
}
/**
* 托盘电机 停止移动
* 拍子升降电机 停止移动
*/
public static DeviceCommand trayMotorStop() {
return controlMotorCmd(CmdDevice.tray_motor, CmdAction.stop, null, "托盘电机停止移动");
return controlMotorCmd(CmdDevice.tray_motor, CmdAction.stop, null, "拍子升降电机 停止移动");
}
/**
* 拍子升降电机 回原点
*/
public static DeviceCommand trayMotorOrigin() {
return controlMotorCmd(CmdDevice.tray_motor, CmdAction.origin, null, "拍子升降电机 回原点");
}
/**
* 双轴械臂 设置参数
* 拍子升降电机 设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand dualRobotSet(CmdAxis axis, Double speed) {
public static DeviceCommand trayMotorSet(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setAxis(axis);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.dual_robot, CmdAction.set, params, "双轴械臂设置参数");
return setInfoCmd(CmdDevice.tray_motor, CmdAction.set, params, "拍子升降电机 设置参数");
}
/**
* 双轴械臂 回原点
* 双轴械臂 移动关节1
*
* @param position 位置 单位°
* @param speed 速度 单位 °/s
*/
public static DeviceCommand dualRobotOrigin(CmdAxis axis) {
public static DeviceCommand dualRobotJoint1Move(Double position, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setAxis(axis);
return controlCmd(CmdDevice.dual_robot, CmdAction.origin, params, "双轴械臂回原点");
params.setAxis(CmdAxis.joint1);
params.setPosition(position);
params.setSpeed(speed);
return controlCmd(CmdDevice.dual_robot, CmdAction.move_joint, params, "双轴械臂 移动关节1");
}
/**
* 双轴械臂 移动关节
* 双轴械臂 移动关节2
*
* @param position 位置 单位°
* @param speed 速度 单位 °/s
*/
public static DeviceCommand dualRobotMoveJoint(CmdAxis axis, CmdDirection direction, Double angle, Double speed) {
public static DeviceCommand dualRobotJoint2Move(Double position, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setAxis(axis);
params.setDirection(direction);
params.setAngle(angle);
params.setAxis(CmdAxis.joint2);
params.setPosition(position);
params.setSpeed(speed);
return controlCmd(CmdDevice.dual_robot, CmdAction.move_x_joint, params, "双轴械臂移动关节");
return controlCmd(CmdDevice.dual_robot, CmdAction.move_joint, params, "双轴械臂 移动关节2");
}
/**
* 双轴械臂 x移动位置
* 双轴械臂 移动至指定点
*
* @param speed 速度 单位 °/s
* @param x 位置x
* @param y 位置y
*/
public static DeviceCommand dualRobotXMovePos(CmdDirection direction, Double position, Double speed) {
public static DeviceCommand dualRobotMovePoint(Double speed, Double x, Double y) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlCmd(CmdDevice.dual_robot, CmdAction.move_x_joint, params, "双轴械臂移动x");
params.setX(x);
params.setY(y);
return controlCmd(CmdDevice.dual_robot, CmdAction.move_point, params, "双轴械臂 移动至指定点");
}
/**
* 双轴械臂 y移动位置
* 双轴械臂 轴1停止移动
*/
public static DeviceCommand dualRobotYMovePos(CmdDirection direction, Double position, Double speed) {
public static DeviceCommand dualRobotJoint1Stop() {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlCmd(CmdDevice.dual_robot, CmdAction.move_y_joint, params, "双轴械臂移动y");
params.setAxis(CmdAxis.joint1);
return controlCmd(CmdDevice.dual_robot, CmdAction.stop, params, "双轴械臂 轴1停止移动");
}
/**
* 双轴械臂 轴2停止移动
*/
public static DeviceCommand dualRobotJoint2Stop() {
DeviceCommandParams params = new DeviceCommandParams();
params.setAxis(CmdAxis.joint2);
return controlCmd(CmdDevice.dual_robot, CmdAction.stop, params, "双轴械臂 轴2停止移动");
}
/**
* 双轴械臂 轴1回原点
*/
public static DeviceCommand dualRobotJoint1Origin() {
DeviceCommandParams params = new DeviceCommandParams();
params.setAxis(CmdAxis.joint1);
return controlCmd(CmdDevice.dual_robot, CmdAction.origin, params, "双轴械臂 轴1回原点");
}
/**
* 双轴械臂 轴2回原点
*/
public static DeviceCommand dualRobotJoint2Origin() {
DeviceCommandParams params = new DeviceCommandParams();
params.setAxis(CmdAxis.joint2);
return controlCmd(CmdDevice.dual_robot, CmdAction.origin, params, "双轴械臂 轴2回原点");
}
/**
* 双轴械臂 轴1设置参数
*
* @param speed 速度 单位 °/s
*/
public static DeviceCommand dualRobotJoint1Set(Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setAxis(CmdAxis.joint1);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.dual_robot, CmdAction.set, params, "双轴械臂 轴1设置参数");
}
/**
* 双轴械臂 停止移动
* 双轴械臂 轴2设置参数
*
* @param speed 速度 单位 °/s
*/
public static DeviceCommand dualRobotStop(CmdAxis axis) {
public static DeviceCommand dualRobotJoint2Set(Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setAxis(axis);
return controlCmd(CmdDevice.dual_robot, CmdAction.stop, params, "双轴械臂停止移动");
params.setAxis(CmdAxis.joint1);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.dual_robot, CmdAction.set, params, "双轴械臂 轴2设置参数");
}
/**
* 龙门架 x轴设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand hBotXSet(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand gantryXSet(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.hbot_x, CmdAction.set, params, "龙门架x轴设置参数");
return setInfoCmd(CmdDevice.gantry_x, CmdAction.set, params, "龙门架 x轴设置参数");
}
/**
* 龙门架 y轴设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand hBotYSet(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand gantryYSet(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.hbot_y, CmdAction.set, params, "龙门架y轴设置参数");
return setInfoCmd(CmdDevice.gantry_y, CmdAction.set, params, "龙门架 y轴设置参数");
}
/**
* 龙门架 z轴设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand hBotZSet(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand gantryZSet(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.hbot_z, CmdAction.set, params, "龙门架z轴设置参数");
return setInfoCmd(CmdDevice.gantry_z, CmdAction.set, params, "龙门架 z轴设置参数");
}
/**
* 龙门架 x轴回原点
*/
public static DeviceCommand hBotXOrigin() {
return controlMotorCmd(CmdDevice.hbot_x, CmdAction.origin, null, "龙门架x轴回原点");
public static DeviceCommand gantryXOrigin() {
return controlMotorCmd(CmdDevice.gantry_x, CmdAction.origin, null, "龙门架 x轴回原点");
}
/**
* 龙门架 y轴回原点
*/
public static DeviceCommand hBotYOrigin() {
return controlMotorCmd(CmdDevice.hbot_y, CmdAction.origin, null, "龙门架y轴回原点");
public static DeviceCommand gantryYOrigin() {
return controlMotorCmd(CmdDevice.gantry_y, CmdAction.origin, null, "龙门架 y轴回原点");
}
/**
* 龙门架 z轴回原点
*/
public static DeviceCommand hBotZOrigin() {
return controlMotorCmd(CmdDevice.hbot_z, CmdAction.origin, null, "龙门架z轴回原点");
public static DeviceCommand gantryZOrigin() {
return controlMotorCmd(CmdDevice.gantry_z, CmdAction.origin, null, "龙门架 z轴回原点");
}
/**
* 龙门架 x轴移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand hBotXMove(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand gantryXMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.hbot_z, CmdAction.move, params, "龙门架x轴移动");
return controlMotorCmd(CmdDevice.gantry_z, CmdAction.move, params, "龙门架 x轴移动");
}
/**
* 龙门架 y轴移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand hBotYMove(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand gantryYMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.hbot_y, CmdAction.move, params, "龙门架y轴移动");
return controlMotorCmd(CmdDevice.gantry_y, CmdAction.move, params, "龙门架 y轴移动");
}
/**
* 龙门架 z轴移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand hBotZMove(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand gantryZMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.hbot_z, CmdAction.move, params, "龙门架z轴移动");
return controlMotorCmd(CmdDevice.gantry_z, CmdAction.move, params, "龙门架 z轴移动");
}
/**
* 龙门架 x轴停止
*/
public static DeviceCommand hBotXStop() {
return controlMotorCmd(CmdDevice.hbot_x, CmdAction.stop, null, "龙门架x轴停止");
public static DeviceCommand gantryXStop() {
return controlMotorCmd(CmdDevice.gantry_x, CmdAction.stop, null, "龙门架 x轴停止");
}
/**
* 龙门架 y轴停止
*/
public static DeviceCommand hBotYStop() {
return controlMotorCmd(CmdDevice.hbot_y, CmdAction.stop, null, "龙门架y轴停止");
public static DeviceCommand gantryYStop() {
return controlMotorCmd(CmdDevice.gantry_y, CmdAction.stop, null, "龙门架 y轴停止");
}
/**
* 龙门架 z轴停止
*/
public static DeviceCommand hBotZStop() {
return controlMotorCmd(CmdDevice.hbot_z, CmdAction.stop, null, "龙门架z轴停止");
public static DeviceCommand gantryZStop() {
return controlMotorCmd(CmdDevice.gantry_z, CmdAction.stop, null, "龙门架 z轴停止");
}
/**
* 加热区顶升电机 加热位1设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand heaterMotor1Set(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor1Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.heater_motor_1, CmdAction.set, params, "加热区顶升电机 加热位1设置参数");
}
/**
* 加热区顶升电机 加热位2设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand heaterMotor2Set(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor2Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.heater_motor_2, CmdAction.set, params, "加热区顶升电机 加热位2设置参数");
}
/**
* 加热区顶升电机 加热位3设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand heaterMotor3Set(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor3Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.heater_motor_3, CmdAction.set, params, "加热区顶升电机 加热位3设置参数");
}
/**
* 加热区顶升电机 加热位4设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand heaterMotor4Set(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor4Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.heater_motor_4, CmdAction.set, params, "加热区顶升电机 加热位4设置参数");
}
/**
* 加热区顶升电机 加热位5设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand heaterMotor5Set(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor5Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.heater_motor_5, CmdAction.set, params, "加热区顶升电机 加热位5设置参数");
}
/**
* 加热区顶升电机 加热位6设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand heaterMotor6Set(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor6Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.heater_motor_6, CmdAction.set, params, "加热区顶升电机 加热位6设置参数");
}
@ -382,73 +455,67 @@ public class DeviceCommandGenerator {
/**
* 加热区顶升电机 加热位1移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand heaterMotor1Move(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor1Move(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.heater_motor_1, CmdAction.move, params, "加热区顶升电机 加热位1移动");
}
/**
* 加热区顶升电机 加热位2移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand heaterMotor2Move(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor2Move(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.heater_motor_2, CmdAction.move, params, "加热区顶升电机 加热位2移动");
}
/**
* 加热区顶升电机 加热位3移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand heaterMotor3Move(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor3Move(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.heater_motor_3, CmdAction.move, params, "加热区顶升电机 加热位3移动");
}
/**
* 加热区顶升电机 加热位4移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand heaterMotor4Move(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor4Move(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.heater_motor_4, CmdAction.move, params, "加热区顶升电机 加热位4移动");
}
/**
* 加热区顶升电机 加热位5移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand heaterMotor5Move(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor5Move(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.heater_motor_5, CmdAction.move, params, "加热区顶升电机 加热位5移动");
}
/**
* 加热区顶升电机 加热位6移动
*
* @param position 位置 单位 mm
*/
public static DeviceCommand heaterMotor6Move(Double current, CmdDirection direction, Double position, Double speed) {
public static DeviceCommand heaterMotor6Move(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setCurrent(current);
params.setDirection(direction);
params.setPosition(position);
params.setSpeed(speed);
return controlMotorCmd(CmdDevice.heater_motor_6, CmdAction.move, params, "加热区顶升电机 加热位6移动");
}
@ -498,99 +565,117 @@ public class DeviceCommandGenerator {
/**
* 加液泵 泵1设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand acidPump1Set(Double current, CmdDirection direction, Double speed) {
public static DeviceCommand acidPump1Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.acid_pump1, CmdAction.set, params, "加液泵1 设置参数");
}
/**
* 加液泵 泵2设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand acidPump2Set(Double current, CmdDirection direction, Double speed) {
public static DeviceCommand acidPump2Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.acid_pump2, CmdAction.set, params, "加液泵2 设置参数");
}
/**
* 加液泵 泵3设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand acidPump3Set(Double current, CmdDirection direction, Double speed) {
public static DeviceCommand acidPump3Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.acid_pump3, CmdAction.set, params, "加液泵3 设置参数");
}
/**
* 加液泵 泵4设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand acidPump4Set(Double current, CmdDirection direction, Double speed) {
public static DeviceCommand acidPump4Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.acid_pump4, CmdAction.set, params, "加液泵4 设置参数");
}
/**
* 加液泵 泵5设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand acidPump5Set(Double current, CmdDirection direction, Double speed) {
public static DeviceCommand acidPump5Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.acid_pump5, CmdAction.set, params, "加液泵5 设置参数");
}
/**
* 加液泵 泵6设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand acidPump6Set(Double current, CmdDirection direction, Double speed) {
public static DeviceCommand acidPump6Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.acid_pump6, CmdAction.set, params, "加液泵6 设置参数");
}
/**
* 加液泵 泵7设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand acidPump7Set(Double current, CmdDirection direction, Double speed) {
public static DeviceCommand acidPump7Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.acid_pump7, CmdAction.set, params, "加液泵7 设置参数");
}
/**
* 加液泵 泵8设置参数
*
* @param current 电流 [0-31]
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand acidPump8Set(Double current, CmdDirection direction, Double speed) {
public static DeviceCommand acidPump8Set(Integer current, Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setCurrent(current);
params.setSpeed(speed);
return setInfoCmd(CmdDevice.acid_pump8, CmdAction.set, params, "加液泵8 设置参数");
}
/**
* 加液泵 泵1移动
*
* @param direction 方向 forward | backward
* @param volume 加液量 单位mL
*/
public static DeviceCommand acidPump1Move(CmdDirection direction, Double volume, Double speed) {
public static DeviceCommand acidPump1Move(CmdDirection direction, Double volume) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setVolume(volume);
return setInfoCmd(CmdDevice.acid_pump1, CmdAction.move, params, "加液泵1 移动");
}
@ -598,10 +683,9 @@ public class DeviceCommandGenerator {
/**
* 加液泵 泵2移动
*/
public static DeviceCommand acidPump2Move(CmdDirection direction, Double volume, Double speed) {
public static DeviceCommand acidPump2Move(CmdDirection direction, Double volume) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setVolume(volume);
return setInfoCmd(CmdDevice.acid_pump2, CmdAction.move, params, "加液泵2 移动");
}
@ -609,10 +693,9 @@ public class DeviceCommandGenerator {
/**
* 加液泵 泵3移动
*/
public static DeviceCommand acidPump3Move(CmdDirection direction, Double volume, Double speed) {
public static DeviceCommand acidPump3Move(CmdDirection direction, Double volume) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setVolume(volume);
return setInfoCmd(CmdDevice.acid_pump3, CmdAction.move, params, "加液泵3 移动");
}
@ -620,10 +703,9 @@ public class DeviceCommandGenerator {
/**
* 加液泵 泵4移动
*/
public static DeviceCommand acidPump4Move(CmdDirection direction, Double volume, Double speed) {
public static DeviceCommand acidPump4Move(CmdDirection direction, Double volume) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setVolume(volume);
return setInfoCmd(CmdDevice.acid_pump4, CmdAction.move, params, "加液泵4 移动");
}
@ -631,10 +713,9 @@ public class DeviceCommandGenerator {
/**
* 加液泵 泵5移动
*/
public static DeviceCommand acidPump5Move(CmdDirection direction, Double volume, Double speed) {
public static DeviceCommand acidPump5Move(CmdDirection direction, Double volume) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setVolume(volume);
return setInfoCmd(CmdDevice.acid_pump5, CmdAction.move, params, "加液泵5 移动");
}
@ -642,10 +723,9 @@ public class DeviceCommandGenerator {
/**
* 加液泵 泵6移动
*/
public static DeviceCommand acidPump6Move(CmdDirection direction, Double volume, Double speed) {
public static DeviceCommand acidPump6Move(CmdDirection direction, Double volume) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setVolume(volume);
return setInfoCmd(CmdDevice.acid_pump6, CmdAction.move, params, "加液泵6 移动");
}
@ -653,10 +733,9 @@ public class DeviceCommandGenerator {
/**
* 加液泵 泵7移动
*/
public static DeviceCommand acidPump7Move(CmdDirection direction, Double volume, Double speed) {
public static DeviceCommand acidPump7Move(CmdDirection direction, Double volume) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setVolume(volume);
return setInfoCmd(CmdDevice.acid_pump7, CmdAction.move, params, "加液泵7 移动");
}
@ -664,10 +743,9 @@ public class DeviceCommandGenerator {
/**
* 加液泵 泵8移动
*/
public static DeviceCommand acidPump8Move(CmdDirection direction, Double volume, Double speed) {
public static DeviceCommand acidPump8Move(CmdDirection direction, Double volume) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDirection(direction);
params.setSpeed(speed);
params.setVolume(volume);
return setInfoCmd(CmdDevice.acid_pump8, CmdAction.move, params, "加液泵8 移动");
}
@ -731,6 +809,8 @@ public class DeviceCommandGenerator {
/**
* 夹爪 设置参数
*
* @param speed 速度 单位 mm/s
*/
public static DeviceCommand clawSet(Double speed) {
DeviceCommandParams params = new DeviceCommandParams();
@ -739,26 +819,21 @@ public class DeviceCommandGenerator {
}
/**
* 夹爪 夹紧
* 夹爪 移动
*
* @param position 位置 0-100
*/
public static DeviceCommand clawTight(Double distance) {
public static DeviceCommand clawMove(Double position) {
DeviceCommandParams params = new DeviceCommandParams();
params.setDistance(distance);
return controlCmd(CmdDevice.claw, CmdAction.tight, params, "夹爪夹紧");
}
/**
* 夹爪 松开
*/
public static DeviceCommand clawTight() {
return controlCmd(CmdDevice.claw, CmdAction.loose, null, "夹爪松开");
params.setPosition(position);
return controlCmd(CmdDevice.claw, CmdAction.tight, params, "夹爪 移动");
}
/**
* 夹爪 停止
*/
public static DeviceCommand clawStop() {
return controlCmd(CmdDevice.claw, CmdAction.stop, null, "夹爪松开");
return controlCmd(CmdDevice.claw, CmdAction.stop, null, "夹爪停止");
}
@ -918,6 +993,8 @@ public class DeviceCommandGenerator {
/**
* 加热棒1 开启加热
*
* @param temperature 目标温度
*/
public static DeviceCommand heatRod1Open(Double temperature) {
DeviceCommandParams params = new DeviceCommandParams();
@ -927,6 +1004,8 @@ public class DeviceCommandGenerator {
/**
* 加热棒2 开启加热
*
* @param temperature 目标温度
*/
public static DeviceCommand heatRod2Open(Double temperature) {
DeviceCommandParams params = new DeviceCommandParams();
@ -936,6 +1015,8 @@ public class DeviceCommandGenerator {
/**
* 加热棒3 开启加热
*
* @param temperature 目标温度
*/
public static DeviceCommand heatRod3Open(Double temperature) {
DeviceCommandParams params = new DeviceCommandParams();
@ -945,6 +1026,8 @@ public class DeviceCommandGenerator {
/**
* 加热棒4 开启加热
*
* @param temperature 目标温度
*/
public static DeviceCommand heatRod4Open(Double temperature) {
DeviceCommandParams params = new DeviceCommandParams();
@ -954,6 +1037,8 @@ public class DeviceCommandGenerator {
/**
* 加热棒5 开启加热
*
* @param temperature 目标温度
*/
public static DeviceCommand heatRod5Open(Double temperature) {
DeviceCommandParams params = new DeviceCommandParams();
@ -963,6 +1048,8 @@ public class DeviceCommandGenerator {
/**
* 加热棒6 开启加热
*
* @param temperature 目标温度
*/
public static DeviceCommand heatRod6Open(Double temperature) {
DeviceCommandParams params = new DeviceCommandParams();
@ -1015,6 +1102,8 @@ public class DeviceCommandGenerator {
/**
* 三色灯开启
*
* @param color red | green | blue
*/
public static DeviceCommand tricolorLightOpen(CmdColor color) {
DeviceCommandParams params = new DeviceCommandParams();
@ -1031,21 +1120,22 @@ public class DeviceCommandGenerator {
/**
* 相机补灯光 开启
*
* @param brightness 亮度 0-100
*/
public static DeviceCommand fillLightOpen(Double brightness) {
DeviceCommandParams params = new DeviceCommandParams();
params.setBrightness(brightness);
return controlCmd(CmdDevice.fill_light, CmdAction.open, params, "相机补灯光开启");
return controlCmd(CmdDevice.fill_light, CmdAction.open, params, "相机补光灯 开启");
}
/**
* 相机补灯光关闭
* 相机补光灯 关闭
*/
public static DeviceCommand fillLightClose() {
return controlCmd(CmdDevice.fill_light, CmdAction.close, null, "相机补灯光关闭");
return controlCmd(CmdDevice.fill_light, CmdAction.close, null, "相机补光灯 关闭");
}
/**
* 冷阱开启电源
*/
@ -1062,6 +1152,8 @@ public class DeviceCommandGenerator {
/**
* 冷阱设置温度
*
* @param temperature 温度
*/
public static DeviceCommand coldTrapSet(Double temperature) {
DeviceCommandParams params = new DeviceCommandParams();
@ -1084,6 +1176,21 @@ public class DeviceCommandGenerator {
}
/**
* 冷阱开启制冷
*/
public static DeviceCommand coldTrapOpenCool() {
return controlCmd(CmdDevice.cold_trap, CmdAction.open_cool, null, "冷阱 开启制冷");
}
/**
* 冷阱关闭制冷
*/
public static DeviceCommand coldTrapCloseCool() {
return controlCmd(CmdDevice.cold_trap, CmdAction.close_cool, null, "冷阱 关闭制冷");
}
/**
* 冷阱开启加热
*/
public static DeviceCommand coldTrapOpenHeart() {
@ -1101,7 +1208,7 @@ public class DeviceCommandGenerator {
* 拍照
*/
public static DeviceCommand takePhoto() {
return controlCmd(CmdDevice.photo, CmdAction.take_photo, null, "冷阱关闭加热");
return controlCmd(CmdDevice.photo, CmdAction.take_photo, null, "拍照");
}

3
src/main/java/com/iflytop/gd/common/cmd/DeviceCommandParams.java

@ -20,4 +20,7 @@ public class DeviceCommandParams {
private CmdAxis axis;
private CmdColor color;
private Double brightness;
private Double x;
private Double y;
private Double z;
}

29
src/main/java/com/iflytop/gd/common/enums/AcidPumpDevice.java

@ -0,0 +1,29 @@
package com.iflytop.gd.common.enums;
import lombok.Getter;
/**
* 泵设备id枚举
*/
@Getter
public enum AcidPumpDevice {
PUMP_01("acid_pump1"),
PUMP_02("acid_pump2"),
PUMP_03("acid_pump3"),
PUMP_04("acid_pump4"),
PUMP_05("acid_pump5"),
PUMP_06("acid_pump6"),
PUMP_07("acid_pump7"),
PUMP_08("acid_pump8");
private final String id;
AcidPumpDevice(String id) {
this.id = id;
}
@Override
public String toString() {
return id;
}
}

12
src/main/java/com/iflytop/gd/common/enums/HeatModuleId.java

@ -1,9 +1,12 @@
package com.iflytop.gd.common.enums;
import lombok.Getter;
/**
* 加热模块id枚举
* 格式为 "heat_module_01" ~ "heat_module_06"
*/
@Getter
public enum HeatModuleId {
MODULE_01("heat_module_01"),
MODULE_02("heat_module_02"),
@ -18,15 +21,6 @@ public enum HeatModuleId {
this.id = id;
}
/**
* 获取对应的加热模块 ID
*
* @return 模块唯一标识
*/
public String getId() {
return id;
}
@Override
public String toString() {
return id;

2
src/main/java/com/iflytop/gd/common/enums/cmd/CmdAction.java

@ -1,6 +1,6 @@
package com.iflytop.gd.common.enums.cmd;
public enum CmdAction {
open, close, stop, start, origin, move, move_x_joint, move_y_joint, move_joint, move_point, set, get, tight, loose,
open, close, stop, start, origin, move, move_joint, move_point, set, get, tight, loose,
open_power, close_power, open_circle, close_circle, open_heart, close_heart, open_cool, close_cool, take_photo
}

46
src/main/java/com/iflytop/gd/common/enums/cmd/CmdDevice.java

@ -1,10 +1,44 @@
package com.iflytop.gd.common.enums.cmd;
public enum CmdDevice {
door, shake_motor, tray_motor, dual_robot, hbot_x, hbot_y, hbot_z,
heater_motor_1, heater_motor_2, heater_motor_3, heater_motor_4, heater_motor_5, heater_motor_6,
acid_pump1, acid_pump2, acid_pump3, acid_pump4, acid_pump5, acid_pump6, acid_pump7, acid_pump8,
claw, fan1, fan2, fan3, fan4, fan5, fan6, water_pump_power, ventilator_power,
heat_rod_1, heat_rod_2, heat_rod_3, heat_rod_4, heat_rod_5, heat_rod_6,
tricolor_light, fill_light, cold_trap, photo
door_motor,
shake_motor,
tray_motor,
dual_robot,
gantry_x,
gantry_y,
gantry_z,
heater_motor_1,
heater_motor_2,
heater_motor_3,
heater_motor_4,
heater_motor_5,
heater_motor_6,
acid_pump1,
acid_pump2,
acid_pump3,
acid_pump4,
acid_pump5,
acid_pump6,
acid_pump7,
acid_pump8,
claw,
fan1,
fan2,
fan3,
fan4,
fan5,
fan6,
water_pump_power,
ventilator_power,
heat_rod_1,
heat_rod_2,
heat_rod_3,
heat_rod_4,
heat_rod_5,
heat_rod_6,
tricolor_light,
fill_light,
cold_trap,
photo
}

5
src/main/java/com/iflytop/gd/common/result/ResultCode.java

@ -44,8 +44,9 @@ public enum ResultCode implements IResultCode, Serializable {
SERVICE_UNAVAILABLE("5001", "服务暂不可用"),
EXTERNAL_API_ERROR("5002", "第三方服务调用失败"),
COMMAND_EXEC_TIMEOUT("5003", "命令执行超时"),
HARDWARE_ERROR("5004", "硬件错误");
HARDWARE_ERROR("5004", "硬件错误"),
//============================ 6xxx指令相关 ============================
COMMAND_NOT_FOUND("6000", "指令未找到");
/** 状态码 */
private final String code;
/** 提示信息 */

Loading…
Cancel
Save