Browse Source

fix:修改业务指令

master
王梦远 2 months ago
parent
commit
b149f4d92f
  1. 5
      src/main/java/com/iflytop/sgs/app/cmd/control/AnnealStopCommand.java
  2. 5
      src/main/java/com/iflytop/sgs/app/cmd/control/DryStartCommand.java
  3. 5
      src/main/java/com/iflytop/sgs/app/cmd/control/DryStopCommand.java
  4. 3
      src/main/java/com/iflytop/sgs/app/cmd/control/HeatStartCommand.java
  5. 7
      src/main/java/com/iflytop/sgs/app/cmd/control/HeatStopCommand.java
  6. 6
      src/main/java/com/iflytop/sgs/app/cmd/control/MoveToHeatAreaCommand.java

5
src/main/java/com/iflytop/sgs/app/cmd/control/AnnealStopCommand.java

@ -9,6 +9,7 @@ import com.iflytop.sgs.app.service.device.DeviceStateService;
import com.iflytop.sgs.app.service.device.module.HeatModuleService;
import com.iflytop.sgs.common.annotation.CommandMapping;
import com.iflytop.sgs.common.enums.HeatModuleCode;
import com.iflytop.sgs.common.enums.HeatingType;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@ -37,11 +38,11 @@ public class AnnealStopCommand extends BaseCommandHandler {
//获取当前加热区状态
HeatModuleState heatModuleState = deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId);
//判断当前加热区是否处于退火状态
Assert.isTrue(heatModuleState.isAnnealing(), heatModuleId + "加热区目前不在退火状态");
Assert.isTrue(heatModuleState.getHeatingType().equals(HeatingType.annealing), heatModuleId + "加热区目前不在退火状态");
//关闭加热
heatModuleService.heatRodClose(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId);
//设置加热区状态 退火结束
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setAnnealing(false);
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setHeatingType(HeatingType.stop);
}
});
}

5
src/main/java/com/iflytop/sgs/app/cmd/control/DryStartCommand.java

@ -9,6 +9,7 @@ import com.iflytop.sgs.app.service.device.DeviceStateService;
import com.iflytop.sgs.app.service.device.module.HeatModuleService;
import com.iflytop.sgs.common.annotation.CommandMapping;
import com.iflytop.sgs.common.enums.HeatModuleCode;
import com.iflytop.sgs.common.enums.HeatingType;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@ -21,7 +22,7 @@ import java.util.concurrent.CompletableFuture;
@Slf4j
@Component
@RequiredArgsConstructor
@CommandMapping("dry_start")//业务指令注解
@CommandMapping("_start")//业务指令注解
public class DryStartCommand extends BaseCommandHandler {
private final HeatModuleService deviceCommandUtilService;
private final DeviceStateService deviceStateService;
@ -44,7 +45,7 @@ public class DryStartCommand extends BaseCommandHandler {
//开启烘干
deviceCommandUtilService.heatRodOpen(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, temperature);
//设置加热区状态 正在烘干
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setDrying(true);
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setHeatingType(HeatingType.drying);
}
});

5
src/main/java/com/iflytop/sgs/app/cmd/control/DryStopCommand.java

@ -9,6 +9,7 @@ import com.iflytop.sgs.app.service.device.DeviceStateService;
import com.iflytop.sgs.app.service.device.module.HeatModuleService;
import com.iflytop.sgs.common.annotation.CommandMapping;
import com.iflytop.sgs.common.enums.HeatModuleCode;
import com.iflytop.sgs.common.enums.HeatingType;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@ -36,11 +37,11 @@ public class DryStopCommand extends BaseCommandHandler {
//获取当前加热区状态
HeatModuleState heatModuleState = deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId);
//判断当前加热区是否处于烘干状态
Assert.isTrue(heatModuleState.isDrying(), heatModuleId + "加热区目前不在烘干状态");
Assert.isTrue(heatModuleState.getHeatingType().equals(HeatingType.drying), heatModuleId + "加热区目前不在烘干状态");
//关闭烘干
heatModuleService.heatRodClose(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId);
//设置加热区状态 烘干结束
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setDrying(false);
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setHeatingType(HeatingType.stop);
}
});

3
src/main/java/com/iflytop/sgs/app/cmd/control/HeatStartCommand.java

@ -9,6 +9,7 @@ import com.iflytop.sgs.app.service.device.DeviceStateService;
import com.iflytop.sgs.app.service.device.module.HeatModuleService;
import com.iflytop.sgs.common.annotation.CommandMapping;
import com.iflytop.sgs.common.enums.HeatModuleCode;
import com.iflytop.sgs.common.enums.HeatingType;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@ -44,7 +45,7 @@ public class HeatStartCommand extends BaseCommandHandler {
//开启加热
heatModuleService.heatRodOpen(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, temperature);
//设置加热区状态 正在加热
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setHeating(true);
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setHeatingType(HeatingType.heating);
}
});

7
src/main/java/com/iflytop/sgs/app/cmd/control/HeatStopCommand.java

@ -9,6 +9,7 @@ import com.iflytop.sgs.app.service.device.DeviceStateService;
import com.iflytop.sgs.app.service.device.module.HeatModuleService;
import com.iflytop.sgs.common.annotation.CommandMapping;
import com.iflytop.sgs.common.enums.HeatModuleCode;
import com.iflytop.sgs.common.enums.HeatingType;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@ -35,11 +36,11 @@ public class HeatStopCommand extends BaseCommandHandler {
HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId);
//获取当前加热区状态
HeatModuleState heatModuleState = deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId);
//判断当前加热区是否处于退火状态
Assert.isTrue(heatModuleState.isHeating(), heatModuleId + "加热区目前不在加热状态");
//判断当前加热区是否处于加热状态
Assert.isTrue(heatModuleState.getHeatingType().equals(HeatingType.heating), heatModuleId + "加热区目前不在加热状态");
//关闭加热
heatModuleService.heatRodClose(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId);
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setHeating(false);
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId).setHeatingType(HeatingType.stop);
}
});
}

6
src/main/java/com/iflytop/sgs/app/cmd/control/MoveToHeatAreaCommand.java

@ -4,7 +4,7 @@ import cn.hutool.core.lang.Assert;
import com.iflytop.sgs.app.core.BaseCommandHandler;
import com.iflytop.sgs.app.model.bo.Point3D;
import com.iflytop.sgs.app.model.bo.status.device.HeatModuleState;
import com.iflytop.sgs.app.model.bo.status.device.PumpState;
import com.iflytop.sgs.app.model.bo.status.device.SolutionModuleState;
import com.iflytop.sgs.app.model.dto.CmdDTO;
import com.iflytop.sgs.app.service.api.DevicePositionService;
import com.iflytop.sgs.app.service.device.DeviceStateService;
@ -55,11 +55,11 @@ public class MoveToHeatAreaCommand extends BaseCommandHandler {
String heatId = cmdDTO.getStringParam("heatId");
HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId);
HeatModuleState heatModuleState=deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleId);
PumpState pumpState=deviceStateService.getDeviceState().getPumpState();
SolutionModuleState solutionModuleState=deviceStateService.getDeviceState().getSolutionModule();
//判断是否有托盘
Assert.isTrue(heatModuleState.getTrayStatus()==0,heatModuleId+"此加热位已存在托盘");
//判断泵现在处于关闭状态
Assert.isTrue(pumpState.equals(PumpStateCode.close),"蠕动泵正在运行,无法转移");
Assert.isTrue(solutionModuleState.isPumping(),"蠕动泵正在运行,无法转移");
//加液电机升起的安全高度
double liquidMotorSafeDistance = devicePositionService.getPosition(DevicePositionCode.clawTrayGrip).getDistance();
//获取机械臂夹取托盘的横向距离

Loading…
Cancel
Save