Browse Source

加热时间bug

master
王梦远 2 months ago
parent
commit
3904343d1c
  1. 14
      src/main/java/com/iflytop/sgs/app/service/crafts/CraftsStepService.java

14
src/main/java/com/iflytop/sgs/app/service/crafts/CraftsStepService.java

@ -476,15 +476,18 @@ public class CraftsStepService {
delay(1);
}
log.info("工艺{},温度达到", heatModuleCode);
log.info("工艺{},恒温时间", time);
webSocketService.pushCraftsDebug(CraftsDebugGenerator.generateJson(heatModuleCode.toString(), "温度达到", temperature));
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.constant); //恒温中 todo 前端显示
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setStartHeatTime(LocalDateTime.now());//开始加热时间
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTime(time);//加热器目标加热时间
int clock = 0;
int cycle = time / 60;
int seconds = cycle % 60;
delay(time);
int seconds = time % 60;
log.info("工艺{},恒温时间分钟:", cycle);
log.info("工艺{},恒温时间秒数:", seconds);
while (cycle > 0) {
log.info("工艺,恒温第{}分:", cycle);
delay(60);
cycle--;
clock = clock + 60;
@ -496,6 +499,7 @@ public class CraftsStepService {
/*保存到工艺监控*/
}
delay(seconds);
log.info("工艺,恒温结束:");
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setStartHeatTime(null);//开始加热时间
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTargetTime(null);//加热器目标加热时间
deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setHeatingType(HeatingType.finish); //加热完成
@ -711,8 +715,7 @@ public class CraftsStepService {
craftMonitor.setCurrentStepResult(String.valueOf(result));
craftMonitorService.saveOrUpdate(craftMonitor);//保存到监控
int cycle = time / 60;
int seconds = cycle % 60;
delay(time);
int seconds = time % 60;
while (cycle > 0) {
delay(60);
cycle--;
@ -801,8 +804,7 @@ public class CraftsStepService {
craftMonitor.setCurrentStepResult(String.valueOf(result));
craftMonitorService.saveOrUpdate(craftMonitor);//保存到监控
int cycle = time / 60;
int seconds = cycle % 60;
delay(time);
int seconds = time % 60;
while (cycle > 0) {
delay(60);
cycle--;

Loading…
Cancel
Save