5 changed files with 152 additions and 0 deletions
-
31src/main/java/com/iflytop/gd/app/cmd/debug/DebugDoorClose.java
-
31src/main/java/com/iflytop/gd/app/cmd/debug/DebugDoorOpen.java
-
29src/main/java/com/iflytop/gd/app/cmd/debug/DebugDoorOrigin.java
-
32src/main/java/com/iflytop/gd/app/cmd/debug/DebugDoorSet.java
-
29src/main/java/com/iflytop/gd/app/cmd/debug/DebugDoorStop.java
@ -0,0 +1,31 @@ |
|||
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.app.service.DeviceCommandService; |
|||
import com.iflytop.gd.common.annotation.CommandMapping; |
|||
import com.iflytop.gd.common.cmd.CommandFuture; |
|||
import com.iflytop.gd.common.cmd.DeviceCommand; |
|||
import com.iflytop.gd.common.cmd.DeviceCommandGenerator; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 门电机 关门 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RequiredArgsConstructor |
|||
@CommandMapping("debug_door_close") |
|||
public class DebugDoorClose extends BaseCommandHandler { |
|||
private final DeviceCommandService deviceCommandService; |
|||
|
|||
@Override |
|||
public void handle(CmdDTO cmdDTO) throws Exception { |
|||
Double position = cmdDTO.getDoubleParam("position"); |
|||
DeviceCommand deviceCommand = DeviceCommandGenerator.doorMove(position); |
|||
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|||
commandWait(deviceCommandFuture); |
|||
} |
|||
} |
@ -0,0 +1,31 @@ |
|||
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.app.service.DeviceCommandService; |
|||
import com.iflytop.gd.common.annotation.CommandMapping; |
|||
import com.iflytop.gd.common.cmd.CommandFuture; |
|||
import com.iflytop.gd.common.cmd.DeviceCommand; |
|||
import com.iflytop.gd.common.cmd.DeviceCommandGenerator; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 门电机 开门 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RequiredArgsConstructor |
|||
@CommandMapping("debug_door_open") |
|||
public class DebugDoorOpen extends BaseCommandHandler { |
|||
private final DeviceCommandService deviceCommandService; |
|||
|
|||
@Override |
|||
public void handle(CmdDTO cmdDTO) throws Exception { |
|||
Double position = cmdDTO.getDoubleParam("position"); |
|||
DeviceCommand deviceCommand = DeviceCommandGenerator.doorMove(position); |
|||
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|||
commandWait(deviceCommandFuture); |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
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.app.service.DeviceCommandService; |
|||
import com.iflytop.gd.common.annotation.CommandMapping; |
|||
import com.iflytop.gd.common.cmd.CommandFuture; |
|||
import com.iflytop.gd.common.cmd.DeviceCommand; |
|||
import com.iflytop.gd.common.cmd.DeviceCommandGenerator; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 门电机 回原点 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RequiredArgsConstructor |
|||
@CommandMapping("debug_door_stop") |
|||
public class DebugDoorOrigin extends BaseCommandHandler { |
|||
private final DeviceCommandService deviceCommandService; |
|||
@Override |
|||
public void handle(CmdDTO cmdDTO) throws Exception { |
|||
DeviceCommand deviceCommand = DeviceCommandGenerator.doorOrigin(); |
|||
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|||
commandWait(deviceCommandFuture); |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
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.app.service.DeviceCommandService; |
|||
import com.iflytop.gd.common.annotation.CommandMapping; |
|||
import com.iflytop.gd.common.cmd.CommandFuture; |
|||
import com.iflytop.gd.common.cmd.DeviceCommand; |
|||
import com.iflytop.gd.common.cmd.DeviceCommandGenerator; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 门电机 设置参数 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RequiredArgsConstructor |
|||
@CommandMapping("debug_door_set") |
|||
public class DebugDoorSet extends BaseCommandHandler { |
|||
private final DeviceCommandService deviceCommandService; |
|||
|
|||
@Override |
|||
public void handle(CmdDTO cmdDTO) throws Exception { |
|||
Integer current = cmdDTO.getIntegerParam("current"); |
|||
Double speed = cmdDTO.getDoubleParam("speed"); |
|||
DeviceCommand deviceCommand = DeviceCommandGenerator.doorSet(current, speed); |
|||
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|||
commandWait(deviceCommandFuture); |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
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.app.service.DeviceCommandService; |
|||
import com.iflytop.gd.common.annotation.CommandMapping; |
|||
import com.iflytop.gd.common.cmd.CommandFuture; |
|||
import com.iflytop.gd.common.cmd.DeviceCommand; |
|||
import com.iflytop.gd.common.cmd.DeviceCommandGenerator; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 门电机 停止移动 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
@RequiredArgsConstructor |
|||
@CommandMapping("debug_door_stop") |
|||
public class DebugDoorStop extends BaseCommandHandler { |
|||
private final DeviceCommandService deviceCommandService; |
|||
@Override |
|||
public void handle(CmdDTO cmdDTO) throws Exception { |
|||
DeviceCommand deviceCommand = DeviceCommandGenerator.doorStop(); |
|||
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|||
commandWait(deviceCommandFuture); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue