|
|
@ -29,6 +29,7 @@ import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
@ -388,6 +389,9 @@ public class CraftsStepService { |
|
|
|
} |
|
|
|
log.info("工艺{},温度达到", heatModuleCode); |
|
|
|
webSocketService.pushCraftsDebug(CraftsDebugGenerator.generateJson(heatModuleCode.toString(), "温度达到", temperature)); |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.constant); //恒温中 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setStartHeatTime(LocalDateTime.now());//开始加热时间 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTime(time);//加热器目标加热时间 |
|
|
|
int clock = 0; |
|
|
|
int cycle = time / 60; |
|
|
|
int seconds = cycle % 60; |
|
|
@ -404,6 +408,7 @@ public class CraftsStepService { |
|
|
|
/*保存到工艺监控*/ |
|
|
|
} |
|
|
|
delay(seconds); |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.finish); //加热完成 |
|
|
|
log.info("工艺{},加热结束", heatModuleCode); |
|
|
|
craftMonitor.setCurrentStepResult(String.valueOf(result)); |
|
|
|
craftMonitor.setDeviceState(JSONUtil.toJsonStr(deviceStateService.getDeviceState())); |
|
|
@ -586,7 +591,7 @@ public class CraftsStepService { |
|
|
|
//Assert.isTrue(temperature != null && time != null, () -> new AppException(ResultCode.CRAFT_PARAMS_MISTAKE));//参数错误 |
|
|
|
webSocketService.pushCraftsDebug(CraftsDebugGenerator.generateJson(heatModuleCode.toString(), "打开加热棒", temperature)); |
|
|
|
heatModuleService.heatRodOpen(heatModuleCode, temperature);//打开加热棒 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.drying); //设置加热区状态 加热中 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.heating); //设置加热区状态 烘干中 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTemperature(temperature);//将加热温度设定为目标温度 |
|
|
|
log.info("工艺{},开始加热", heatModuleCode); |
|
|
|
heatModuleService.heatRodOpen(heatModuleCode, temperature); |
|
|
@ -594,6 +599,9 @@ public class CraftsStepService { |
|
|
|
while (!heatIsSuitable(heatModuleCode, temperature)) { //判断当前温度是否在设置温度范围内 |
|
|
|
delay(1); |
|
|
|
} |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.drying); //烘干中 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setStartHeatTime(LocalDateTime.now());//开始加热时间 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTime(time);//加热器目标加热时间 |
|
|
|
int clock = 0; |
|
|
|
result.set("time", clock);//添加到结果 |
|
|
|
craftMonitor.setCurrentStepResult(String.valueOf(result)); |
|
|
@ -615,7 +623,7 @@ public class CraftsStepService { |
|
|
|
log.info("工艺{},关闭加热棒", heatModuleCode); |
|
|
|
webSocketService.pushCraftsDebug(CraftsDebugGenerator.generateJson(heatModuleCode.toString(), "关闭加热棒", "")); |
|
|
|
heatModuleService.heatRodClose(heatModuleCode);//关闭加热棒 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.stop); //设置加热区状态 加热中 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.stop); //设置加热区状态 |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
@ -672,15 +680,17 @@ public class CraftsStepService { |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setTrayStatus(true); |
|
|
|
|
|
|
|
webSocketService.pushCraftsDebug(CraftsDebugGenerator.generateJson(HeatModuleCode.heat_module_04.name(), "打开加热棒", temperature)); |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setHeatingType(HeatingType.annealing); //设置加热区状态 加热中 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setHeatingType(HeatingType.heating); //设置加热区状态 加热中 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setTargetTemperature(temperature);//将加热温度设定为目标温度 |
|
|
|
log.info("工艺{},开始加热", heatModuleCode); |
|
|
|
heatModuleService.heatRodOpen(HeatModuleCode.heat_module_04, temperature);//打开加热棒 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setHeatingType(HeatingType.annealing); //设置加热区状态 加热中 |
|
|
|
//判断当前温度是否在设置温度范围内 |
|
|
|
while (!heatIsSuitable(HeatModuleCode.heat_module_04, temperature)) { |
|
|
|
delay(1); |
|
|
|
} |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setHeatingType(HeatingType.annealing); //设置加热区状态退火中 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setStartHeatTime(LocalDateTime.now());//开始加热时间 |
|
|
|
deviceStateService.getDeviceState().getHeatModuleByCode(HeatModuleCode.heat_module_04).setTargetTime(time);//加热器目标加热时间 |
|
|
|
int clock = 0; |
|
|
|
result.set("time", clock);//添加到结果 |
|
|
|
craftMonitor.setCurrentStepResult(String.valueOf(result)); |
|
|
@ -699,6 +709,8 @@ public class CraftsStepService { |
|
|
|
} |
|
|
|
log.info("工艺{},恒温中", HeatModuleCode.heat_module_04); |
|
|
|
delay(seconds); |
|
|
|
|
|
|
|
|
|
|
|
log.info("工艺{},加热完毕", heatModuleCode); |
|
|
|
log.info("工艺{},获取转运模组锁", heatModuleCode); |
|
|
|
transferModuleService.requestTransferModule(CraftsTransferTypeCode.move_heat);//获取转运模组锁 |
|
|
|