From 43ddc57d8b61e5eb7b821d283d38ca587b21bac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Thu, 20 Mar 2025 18:56:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E5=81=9C=E6=AD=A2?= =?UTF-8?q?=E6=8E=A8=E6=B3=A8=E5=B0=84=E6=B3=B5=E8=B0=83=E8=AF=95=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ms/app/front/cmd/debug/SyringePumpStop.java | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/java/com/qyft/ms/app/front/cmd/debug/SyringePumpStop.java 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); + }); + } +}