diff --git a/src/main/java/com/qyft/ms/app/front/cmd/debug/SyringePumpStop.java b/src/main/java/com/qyft/ms/app/front/cmd/debug/SyringePumpStop.java new file mode 100644 index 0000000..759a7ac --- /dev/null +++ b/src/main/java/com/qyft/ms/app/front/cmd/debug/SyringePumpStop.java @@ -0,0 +1,34 @@ +package com.qyft.ms.app.front.cmd.debug; + +import com.qyft.ms.system.common.annotation.CommandMapping; +import com.qyft.ms.system.common.device.command.CommandFuture; +import com.qyft.ms.system.common.device.command.DeviceCommandGenerator; +import com.qyft.ms.system.core.handler.BaseCommandHandler; +import com.qyft.ms.system.model.bo.DeviceCommand; +import com.qyft.ms.system.model.form.FrontCmdControlForm; +import com.qyft.ms.system.service.device.DeviceCommandService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.concurrent.CompletableFuture; + +/** + * 停止推送注射泵 + */ +@Slf4j +@Component +@RequiredArgsConstructor +@CommandMapping("syringe_pump_stop") +public class SyringePumpStop extends BaseCommandHandler { + private final DeviceCommandService deviceCommandService; + + @Override + public CompletableFuture handle(FrontCmdControlForm form) { + return runAsync(() -> { + DeviceCommand syringePumpStopCommand = DeviceCommandGenerator.syringePumpStop(); //停止推动注射泵 + CommandFuture syringePumpStopCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), syringePumpStopCommand); + commandWait(syringePumpStopCommandFuture); + }); + } +}