diff --git a/src/main/java/com/iflytop/sgs/app/cmd/control/CleanStartCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/control/CleanStartCommand.java index 83d7799..03f53d4 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/control/CleanStartCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/control/CleanStartCommand.java @@ -8,10 +8,12 @@ import com.iflytop.sgs.app.model.bo.status.device.TubeState; import com.iflytop.sgs.app.model.dto.CmdDTO; import com.iflytop.sgs.app.service.api.DevicePositionService; import com.iflytop.sgs.app.service.api.SystemConfigService; +import com.iflytop.sgs.app.service.device.DeviceSensorService; import com.iflytop.sgs.app.service.device.DeviceStateService; import com.iflytop.sgs.app.service.device.module.SolutionModuleService; import com.iflytop.sgs.app.service.device.module.TransferModuleService; import com.iflytop.sgs.common.annotation.CommandMapping; +import com.iflytop.sgs.common.enums.DeviceSensorCode; import com.iflytop.sgs.common.enums.SystemConfigCode; import com.iflytop.sgs.common.enums.ValveStateCode; import com.iflytop.sgs.common.enums.data.DevicePositionCode; @@ -37,11 +39,10 @@ public class CleanStartCommand extends BaseCommandHandler { private final TransferModuleService transferModuleService; private final DeviceStateService deviceStateService; private final SystemConfigService systemConfigService; + private final DeviceSensorService deviceSensorService; @Override public CompletableFuture handle(CmdDTO cmdDTO) { - //TODO 需要先更新一下传感器状态 - Assert.isTrue(deviceStateService.getDeviceState().getTransferModule().isTrayStatus(), () -> new AppException(ResultCode.TRANSFER_MODULE_NO_TRAY));//判断转运模块托盘状态 double cleanWaterVolume = Double.parseDouble(systemConfigService.getSystemConfigValueByCode(SystemConfigCode.volume_clean));//清洁时加水的量 double waterScale = Double.parseDouble(systemConfigService.getSystemConfigValueByCode(SystemConfigCode.scale_water));//水转换系数 @@ -56,6 +57,8 @@ public class CleanStartCommand extends BaseCommandHandler { TrayState trayState = trayStates.stream().filter(TrayState::isInSolutionPositon).findFirst().get();//加液位的托盘 return runAsync(() -> { transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D.getX());//将X轴移动至加液时托盘位置点 + boolean LIQUID_TRAY_EXIST=deviceSensorService.getSensorStatus(DeviceSensorCode.LIQUID_TRAY_EXIST);//监测加液位是否有托盘 + Assert.isTrue(LIQUID_TRAY_EXIST, () -> new AppException(ResultCode.TARGET_HEAT_MODULE_NO_TRAY));//机械臂是否有托盘 solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.waste);//电磁阀对应通道打开 solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), solutionModuleMotorDownInTubeExtPositon);//加液模块下降进入试管抽取位置 solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), pumpPosition); diff --git a/src/main/java/com/iflytop/sgs/app/cmd/control/LiquidAddCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/control/LiquidAddCommand.java index 74d4935..1570ad2 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/control/LiquidAddCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/control/LiquidAddCommand.java @@ -41,7 +41,7 @@ public class LiquidAddCommand extends BaseCommandHandler { @Override public CompletableFuture handle(CmdDTO cmdDTO) { - //todo 更新阀的状态 + //todo 获取阀门的状态 return runAsync(() -> { diff --git a/src/main/java/com/iflytop/sgs/app/cmd/control/LiquidReduceCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/control/LiquidReduceCommand.java index c47c9b6..db2a62a 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/control/LiquidReduceCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/control/LiquidReduceCommand.java @@ -8,10 +8,12 @@ import com.iflytop.sgs.app.model.bo.status.device.TubeState; import com.iflytop.sgs.app.model.dto.CmdDTO; import com.iflytop.sgs.app.service.api.DevicePositionService; import com.iflytop.sgs.app.service.api.SystemConfigService; +import com.iflytop.sgs.app.service.device.DeviceSensorService; import com.iflytop.sgs.app.service.device.DeviceStateService; import com.iflytop.sgs.app.service.device.module.SolutionModuleService; import com.iflytop.sgs.app.service.device.module.TransferModuleService; import com.iflytop.sgs.common.annotation.CommandMapping; +import com.iflytop.sgs.common.enums.DeviceSensorCode; import com.iflytop.sgs.common.enums.SystemConfigCode; import com.iflytop.sgs.common.enums.ValveStateCode; import com.iflytop.sgs.common.enums.data.DevicePositionCode; @@ -37,11 +39,10 @@ public class LiquidReduceCommand extends BaseCommandHandler { private final DevicePositionService devicePositionService; private final TransferModuleService transferModuleService; private final SystemConfigService systemConfigService; + private final DeviceSensorService deviceSensorService; @Override public CompletableFuture handle(CmdDTO cmdDTO) { - //todo 需要更新一下传感器的状态 - Assert.isTrue(deviceStateService.getDeviceState().getTransferModule().isTrayStatus(), () -> new AppException(ResultCode.TARGET_HEAT_MODULE_NO_TRAY));//机械臂是否有托盘 Point3D liquidAreaTrayPoint3D = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D();//获取加液时托盘位置点 Double trayTubeHorizontalSpacingDistance = devicePositionService.getPosition(DevicePositionCode.trayTubeHorizontalSpacingDistance).getDistance();//获取托盘试管水平间距 Double solutionModuleMotorDownInTubeExtPositon = devicePositionService.getPosition(DevicePositionCode.solutionModuleMotorDownInTubeExtPositon).getPositon();//加液模块电机下降进入试管抽取位置 @@ -49,10 +50,12 @@ public class LiquidReduceCommand extends BaseCommandHandler { TrayState trayState = trayStates.stream().filter(TrayState::isInSolutionPositon).findFirst().get();//加液位的托盘 double reduceNumber= Double.parseDouble(systemConfigService.getSystemConfigValueByCode(SystemConfigCode.number_reduce)); return runAsync(() -> { + transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D.getX());//将X轴移动至加液时托盘位置点 + boolean LIQUID_TRAY_EXIST=deviceSensorService.getSensorStatus(DeviceSensorCode.LIQUID_TRAY_EXIST);//监测加液位是否有托盘 + Assert.isTrue(LIQUID_TRAY_EXIST, () -> new AppException(ResultCode.TARGET_HEAT_MODULE_NO_TRAY));//机械臂是否有托盘 deviceStateService.getDeviceState().getSolutionModule().setIdle(true);//设置占用 deviceStateService.getDeviceState().getSolutionModule().setPumping(true);//设置正在加液 solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0.0);//加液模块上升 - transferModuleService.transferXMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D.getX());//将X轴移动至加液时托盘位置点 solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.waste);//电磁阀对应通道打开 for (TubeState tubeState : trayState.getTubes()) { if (tubeState.isAddSolution() && tubeState.isExists()) { diff --git a/src/main/java/com/iflytop/sgs/app/cmd/control/MoveToFeedAreaCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/control/MoveToFeedAreaCommand.java index 78c2ebf..3953da1 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/control/MoveToFeedAreaCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/control/MoveToFeedAreaCommand.java @@ -5,10 +5,12 @@ import com.iflytop.sgs.app.core.BaseCommandHandler; import com.iflytop.sgs.app.model.bo.Point3D; import com.iflytop.sgs.app.model.dto.CmdDTO; import com.iflytop.sgs.app.service.api.DevicePositionService; +import com.iflytop.sgs.app.service.device.DeviceSensorService; import com.iflytop.sgs.app.service.device.DeviceStateService; import com.iflytop.sgs.app.service.device.module.HeatModuleService; import com.iflytop.sgs.app.service.device.module.TransferModuleService; import com.iflytop.sgs.common.annotation.CommandMapping; +import com.iflytop.sgs.common.enums.DeviceSensorCode; import com.iflytop.sgs.common.enums.HeatModuleCode; import com.iflytop.sgs.common.enums.data.DevicePositionCode; import com.iflytop.sgs.common.exception.AppException; @@ -32,6 +34,7 @@ public class MoveToFeedAreaCommand extends BaseCommandHandler { private final DevicePositionService devicePositionService; private final DeviceStateService deviceStateService; + private final DeviceSensorService deviceSensorService; @Override public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { @@ -42,9 +45,6 @@ public class MoveToFeedAreaCommand extends BaseCommandHandler { } else { targetHeatModuleCode = null; Assert.isTrue(deviceStateService.getDeviceState().getTransferModule().isTrayStatus(),()->new AppException(ResultCode.TRANSFER_MODULE_NO_TRAY));//转运模块是否有托盘 - - - } Point3D targetHeatModuleTrayClawPoint3D = heatModuleService.getHeatModuleTrayClawPoint3D(targetHeatModuleCode);//获取目标加热模块托盘夹取点 diff --git a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugHeaterStopCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugHeaterStopCommand.java index cf813c7..d82083e 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugHeaterStopCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugHeaterStopCommand.java @@ -16,7 +16,7 @@ import org.springframework.stereotype.Component; import java.util.concurrent.CompletableFuture; /** - * 处理停止加热器指令 todo 小何确定次序 + * 处理停止加热器指令 */ @Slf4j @Component diff --git a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpAddCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpAddCommand.java index a5230e1..f579562 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpAddCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpAddCommand.java @@ -31,14 +31,11 @@ public class DebugLiquidPumpAddCommand extends BaseCommandHandler { @Override public CompletableFuture handle(CmdDTO cmdDTO) { Double volume = cmdDTO.getDoubleParam("volume"); - //todo 监测阀门开启状态 将加液量转换成电机转数 - - Double scale = Double.valueOf(systemConfigService.getSystemConfigValueByCode(SystemConfigCode.scale_thin)); + Double scale = Double.valueOf(systemConfigService.getSystemConfigValueByCode(SystemConfigCode.scale_water)); Double position = volume * scale; Double speed = cmdDTO.getDoubleParam("speed"); return runAsync(() -> { - CmdDirection cmdDirection = CmdDirection.forward; DeviceCommandBundle deviceCommand; if (speed != null) { deviceCommand = DeviceCommandGenerator.liquidPumpMoveBy(position); diff --git a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpReduceCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpReduceCommand.java index f5b48d4..776cdd7 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpReduceCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidPumpReduceCommand.java @@ -2,11 +2,13 @@ package com.iflytop.sgs.app.cmd.debug; import com.iflytop.sgs.app.core.BaseCommandHandler; import com.iflytop.sgs.app.model.dto.CmdDTO; +import com.iflytop.sgs.app.service.api.SystemConfigService; import com.iflytop.sgs.app.service.device.DeviceCommandService; import com.iflytop.sgs.common.annotation.CommandDebugMapping; import com.iflytop.sgs.common.cmd.CommandFuture; import com.iflytop.sgs.common.cmd.DeviceCommandBundle; import com.iflytop.sgs.common.cmd.DeviceCommandGenerator; +import com.iflytop.sgs.common.enums.SystemConfigCode; import com.iflytop.sgs.common.enums.cmd.CmdDirection; import com.iflytop.sgs.common.utils.CommandUtil; import lombok.RequiredArgsConstructor; @@ -24,12 +26,13 @@ import java.util.concurrent.CompletableFuture; @CommandDebugMapping("liquid_pump_reduce") public class DebugLiquidPumpReduceCommand extends BaseCommandHandler { private final DeviceCommandService deviceCommandService; + private final SystemConfigService systemConfigService; @Override public CompletableFuture handle(CmdDTO cmdDTO) { Double volume = cmdDTO.getDoubleParam("volume"); - //todo 量转换成转数 - Double position = Double.valueOf(1000); + double scale = Double.parseDouble(systemConfigService.getSystemConfigValueByCode(SystemConfigCode.scale_water)); + double position = volume * scale; Double speed = cmdDTO.getDoubleParam("speed"); return runAsync(() -> { diff --git a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThickCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThickCommand.java index 090ed9c..ac66007 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThickCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThickCommand.java @@ -7,6 +7,7 @@ import com.iflytop.sgs.common.annotation.CommandDebugMapping; import com.iflytop.sgs.common.cmd.CommandFuture; import com.iflytop.sgs.common.cmd.DeviceCommandBundle; import com.iflytop.sgs.common.cmd.DeviceCommandGenerator; +import com.iflytop.sgs.common.enums.ValveStateCode; import com.iflytop.sgs.common.utils.CommandUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -15,7 +16,7 @@ import org.springframework.stereotype.Component; import java.util.concurrent.CompletableFuture; /** - * 阀转换到浓硝酸通道 todo 需要与小何确定次序 + * 阀转换到浓硝酸通道 */ @Slf4j @Component @@ -27,7 +28,7 @@ public class DebugLiquidValveOpenThickCommand extends BaseCommandHandler { @Override public CompletableFuture handle(CmdDTO cmdDTO) { return runAsync(() -> { - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.valveTurn(1); + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.valveTurn(ValveStateCode.thin.getChannel()); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandUtil.wait(deviceCommandFuture); }); diff --git a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThinCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThinCommand.java index ce86a5f..d65f124 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThinCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenThinCommand.java @@ -7,6 +7,7 @@ import com.iflytop.sgs.common.annotation.CommandDebugMapping; import com.iflytop.sgs.common.cmd.CommandFuture; import com.iflytop.sgs.common.cmd.DeviceCommandBundle; import com.iflytop.sgs.common.cmd.DeviceCommandGenerator; +import com.iflytop.sgs.common.enums.ValveStateCode; import com.iflytop.sgs.common.utils.CommandUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -27,7 +28,7 @@ public class DebugLiquidValveOpenThinCommand extends BaseCommandHandler { @Override public CompletableFuture handle(CmdDTO cmdDTO) { return runAsync(() -> { - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.valveTurn(2); + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.valveTurn(ValveStateCode.thick.getChannel()); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandUtil.wait(deviceCommandFuture); }); diff --git a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWasteCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWasteCommand.java index 5a167ec..b5700b4 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWasteCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWasteCommand.java @@ -7,6 +7,7 @@ import com.iflytop.sgs.common.annotation.CommandDebugMapping; import com.iflytop.sgs.common.cmd.CommandFuture; import com.iflytop.sgs.common.cmd.DeviceCommandBundle; import com.iflytop.sgs.common.cmd.DeviceCommandGenerator; +import com.iflytop.sgs.common.enums.ValveStateCode; import com.iflytop.sgs.common.utils.CommandUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -15,7 +16,7 @@ import org.springframework.stereotype.Component; import java.util.concurrent.CompletableFuture; /** - * 阀转换到废液通道 todo 需要与小何确定次序 + * 阀转换到废液通道 */ @Slf4j @Component @@ -27,7 +28,7 @@ public class DebugLiquidValveOpenWasteCommand extends BaseCommandHandler { @Override public CompletableFuture handle(CmdDTO cmdDTO) { return runAsync(() -> { - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.valveTurn(4); + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.valveTurn(ValveStateCode.waste.getChannel()); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandUtil.wait(deviceCommandFuture); }); diff --git a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWaterCommand.java b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWaterCommand.java index 4823dec..1c7efc3 100644 --- a/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWaterCommand.java +++ b/src/main/java/com/iflytop/sgs/app/cmd/debug/DebugLiquidValveOpenWaterCommand.java @@ -7,6 +7,7 @@ import com.iflytop.sgs.common.annotation.CommandDebugMapping; import com.iflytop.sgs.common.cmd.CommandFuture; import com.iflytop.sgs.common.cmd.DeviceCommandBundle; import com.iflytop.sgs.common.cmd.DeviceCommandGenerator; +import com.iflytop.sgs.common.enums.ValveStateCode; import com.iflytop.sgs.common.utils.CommandUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -15,7 +16,7 @@ import org.springframework.stereotype.Component; import java.util.concurrent.CompletableFuture; /** - * 阀转换到蒸馏水通道 todo 需要与小何确定次序 + * 阀转换到蒸馏水通道 */ @Slf4j @Component @@ -27,7 +28,7 @@ public class DebugLiquidValveOpenWaterCommand extends BaseCommandHandler { @Override public CompletableFuture handle(CmdDTO cmdDTO) { return runAsync(() -> { - DeviceCommandBundle deviceCommand = DeviceCommandGenerator.valveTurn(3); + DeviceCommandBundle deviceCommand = DeviceCommandGenerator.valveTurn(ValveStateCode.water.getChannel()); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandUtil.wait(deviceCommandFuture); }); diff --git a/src/main/java/com/iflytop/sgs/app/service/device/DeviceInitService.java b/src/main/java/com/iflytop/sgs/app/service/device/DeviceInitService.java index 2fb5ed3..2a665d9 100644 --- a/src/main/java/com/iflytop/sgs/app/service/device/DeviceInitService.java +++ b/src/main/java/com/iflytop/sgs/app/service/device/DeviceInitService.java @@ -6,6 +6,7 @@ import com.iflytop.sgs.common.enums.HeatModuleCode; import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import java.util.List; @@ -43,4 +44,10 @@ public class DeviceInitService { heatArea.add(new HeatModuleState(code)); } } + @Scheduled(fixedRate = 1000) + public void initDeviceSensor() { + + + + } } diff --git a/src/main/java/com/iflytop/sgs/app/service/device/DeviceSensorService.java b/src/main/java/com/iflytop/sgs/app/service/device/DeviceSensorService.java new file mode 100644 index 0000000..80941f0 --- /dev/null +++ b/src/main/java/com/iflytop/sgs/app/service/device/DeviceSensorService.java @@ -0,0 +1,34 @@ +package com.iflytop.sgs.app.service.device; + +import com.iflytop.sgs.common.enums.DevicePartId; +import com.iflytop.sgs.common.enums.DeviceSensorCode; +import com.iflytop.sgs.common.service.GDDeviceStatusService; +import com.iflytop.sgs.hardware.exception.HardwareException; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@Service +@RequiredArgsConstructor +public class DeviceSensorService { + private final GDDeviceStatusService deviceStatusService; + + /* + * 获取传感器状态 + * */ + public boolean getSensorStatus(DeviceSensorCode sensorCode) throws HardwareException { + return deviceStatusService.getInputState(sensorCode.name()); + } + + /* + * 获取电机位置 + * */ + public Double getSensorStatus(DevicePartId devicePartId) throws HardwareException { + return deviceStatusService.getStepMotorPostion(devicePartId.name()); + } + + +} diff --git a/src/main/java/com/iflytop/sgs/common/enums/SensorStateCode.java b/src/main/java/com/iflytop/sgs/common/enums/DeviceSensorCode.java similarity index 90% rename from src/main/java/com/iflytop/sgs/common/enums/SensorStateCode.java rename to src/main/java/com/iflytop/sgs/common/enums/DeviceSensorCode.java index caa130b..2f3c2a8 100644 --- a/src/main/java/com/iflytop/sgs/common/enums/SensorStateCode.java +++ b/src/main/java/com/iflytop/sgs/common/enums/DeviceSensorCode.java @@ -7,7 +7,7 @@ import lombok.Getter; * */ @Getter -public enum SensorStateCode { +public enum DeviceSensorCode { E_STOP("急停"), HEATER_TRAY_1_EXIST("加热位1托盘存在状态"), HEATER_TRAY_2_EXIST("加热位2托盘存在状态"), @@ -23,7 +23,7 @@ public enum SensorStateCode { private String description; - SensorStateCode(String description) { + DeviceSensorCode(String description) { this.description = description; } } diff --git a/src/main/java/com/iflytop/sgs/common/service/GDDeviceStatusInterface.java b/src/main/java/com/iflytop/sgs/common/service/GDDeviceStatusService.java similarity index 97% rename from src/main/java/com/iflytop/sgs/common/service/GDDeviceStatusInterface.java rename to src/main/java/com/iflytop/sgs/common/service/GDDeviceStatusService.java index 429edb8..f90fa89 100644 --- a/src/main/java/com/iflytop/sgs/common/service/GDDeviceStatusInterface.java +++ b/src/main/java/com/iflytop/sgs/common/service/GDDeviceStatusService.java @@ -6,7 +6,7 @@ import com.iflytop.sgs.hardware.type.Servo.LeisaiServoMId; import com.iflytop.sgs.hardware.type.StepMotor.StepMotorMId; import com.iflytop.sgs.hardware.type.driver.HeaterRodSlavedId; -public interface GDDeviceStatusInterface { +public interface GDDeviceStatusService { /** * 获取步进电机的原点状态 diff --git a/src/main/java/com/iflytop/sgs/hardware/service/GDDeviceStatusService.java b/src/main/java/com/iflytop/sgs/hardware/service/GDDeviceStatusServiceImpl.java similarity index 94% rename from src/main/java/com/iflytop/sgs/hardware/service/GDDeviceStatusService.java rename to src/main/java/com/iflytop/sgs/hardware/service/GDDeviceStatusServiceImpl.java index c243a34..2989164 100644 --- a/src/main/java/com/iflytop/sgs/hardware/service/GDDeviceStatusService.java +++ b/src/main/java/com/iflytop/sgs/hardware/service/GDDeviceStatusServiceImpl.java @@ -1,7 +1,6 @@ package com.iflytop.sgs.hardware.service; -import com.iflytop.sgs.app.model.bo.Point3D; -import com.iflytop.sgs.common.service.GDDeviceStatusInterface; +import com.iflytop.sgs.common.service.GDDeviceStatusService; import com.iflytop.sgs.hardware.drivers.DIDriver.InputDetectDriver; import com.iflytop.sgs.hardware.drivers.HeaterRodDriver; import com.iflytop.sgs.hardware.drivers.LeisaiServoDriver; @@ -20,7 +19,7 @@ import org.springframework.stereotype.Component; @Slf4j @Component @RequiredArgsConstructor -public class GDDeviceStatusService implements GDDeviceStatusInterface { +public class GDDeviceStatusServiceImpl implements GDDeviceStatusService { private final InputDetectDriver inputDetectDriver; private final HeaterRodDriver heaterRodDriver; private final StepMotorCtrlDriver stepMotorCtrlDriver;