|
@@ -10,10 +10,8 @@ import com.sckj.common.eventbus.EventListener;
|
|
import com.sckj.common.manager.ScheduledTaskManager;
|
|
import com.sckj.common.manager.ScheduledTaskManager;
|
|
import com.sckj.common.socketio.SocketUtil;
|
|
import com.sckj.common.socketio.SocketUtil;
|
|
import com.sckj.common.util.RedisUtils;
|
|
import com.sckj.common.util.RedisUtils;
|
|
-import com.sckj.iron.constant.ExpressionConstants;
|
|
|
|
-import com.sckj.iron.constant.ParamsConstants;
|
|
|
|
-import com.sckj.iron.constant.SubscribeTagConstants;
|
|
|
|
-import com.sckj.iron.constant.TaskNameConstants;
|
|
|
|
|
|
+import com.sckj.common.util.ToolUtils;
|
|
|
|
+import com.sckj.iron.constant.*;
|
|
import com.sckj.iron.dto.IronStepDTO;
|
|
import com.sckj.iron.dto.IronStepDTO;
|
|
import com.sckj.iron.dto.IronTimeNoDTO;
|
|
import com.sckj.iron.dto.IronTimeNoDTO;
|
|
import com.sckj.iron.dto.RealtimeData;
|
|
import com.sckj.iron.dto.RealtimeData;
|
|
@@ -36,7 +34,6 @@ import com.sckj.warn.service.impl.TExceptionLogServiceImpl;
|
|
import com.sckj.warn.validate.TExceptionLogCreateValidate;
|
|
import com.sckj.warn.validate.TExceptionLogCreateValidate;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.expression.Expression;
|
|
import org.springframework.expression.Expression;
|
|
@@ -122,14 +119,6 @@ public class DeviceEventListener extends EventListener { //
|
|
@Resource
|
|
@Resource
|
|
TIronTestServiceImpl iTIronTestService;
|
|
TIronTestServiceImpl iTIronTestService;
|
|
|
|
|
|
- //炉前申请出铁
|
|
|
|
- private static final String STEP_LQSQCT = "lqsqct";
|
|
|
|
-
|
|
|
|
- //预判和确认出铁
|
|
|
|
- private static final String STEP_YPQRCT = "ypqrct";
|
|
|
|
-
|
|
|
|
- //铁量差计算
|
|
|
|
- private static final String STEP_TLC = "tlc";
|
|
|
|
|
|
|
|
//铁水成分
|
|
//铁水成分
|
|
private static final String IRON_ELEMENT = "ironElement";
|
|
private static final String IRON_ELEMENT = "ironElement";
|
|
@@ -240,6 +229,9 @@ public class DeviceEventListener extends EventListener { //
|
|
//上次出铁量
|
|
//上次出铁量
|
|
private OPCData mIronOPCData;
|
|
private OPCData mIronOPCData;
|
|
|
|
|
|
|
|
+ //实时出铁数据
|
|
|
|
+ private TIronData mTIronData;
|
|
|
|
+
|
|
@PostConstruct
|
|
@PostConstruct
|
|
public void init() {
|
|
public void init() {
|
|
taskExecutor.submit(() -> {
|
|
taskExecutor.submit(() -> {
|
|
@@ -257,9 +249,9 @@ public class DeviceEventListener extends EventListener { //
|
|
taskExecutor.submit(() -> {
|
|
taskExecutor.submit(() -> {
|
|
getModels();
|
|
getModels();
|
|
});
|
|
});
|
|
- taskExecutor.submit(() -> {
|
|
|
|
- getIronTimeNo();
|
|
|
|
- });
|
|
|
|
|
|
+// taskExecutor.submit(() -> {
|
|
|
|
+// getIronTimeNo();
|
|
|
|
+// });
|
|
taskExecutor.submit(() -> {
|
|
taskExecutor.submit(() -> {
|
|
getSchedules();
|
|
getSchedules();
|
|
if ("1".equals(scheduleOpcdasubscribe.getStatus())) {
|
|
if ("1".equals(scheduleOpcdasubscribe.getStatus())) {
|
|
@@ -410,9 +402,19 @@ public class DeviceEventListener extends EventListener { //
|
|
*/
|
|
*/
|
|
@Subscribe
|
|
@Subscribe
|
|
public void onMessageEvent(OPCData opcData) {
|
|
public void onMessageEvent(OPCData opcData) {
|
|
- log.debug("subscribe info:{}",opcData);
|
|
|
|
|
|
+ log.debug("subscribe info:{}", opcData);
|
|
|
|
+
|
|
|
|
+ if (ObjectUtils.isNotEmpty(opcData) && ObjectUtils.isNotEmpty(opcData.getIdentifier())) {
|
|
|
|
+ //将每一个opc配置的唯一编号添加到环境变量中
|
|
|
|
+ mContext.setVariable(opcData.getIdentifier(), opcData.getData());
|
|
|
|
+ }
|
|
|
|
+
|
|
//异步保存OPC数据
|
|
//异步保存OPC数据
|
|
taskExecutor.submit(() -> {
|
|
taskExecutor.submit(() -> {
|
|
|
|
+ if (ObjectUtils.isNotEmpty(mTIronData)) {
|
|
|
|
+ //关联实时出铁信息
|
|
|
|
+ opcData.setIronDataId(mTIronData.getId());
|
|
|
|
+ }
|
|
opcDataService.save(opcData);
|
|
opcDataService.save(opcData);
|
|
});
|
|
});
|
|
//出铁操作
|
|
//出铁操作
|
|
@@ -425,33 +427,11 @@ public class DeviceEventListener extends EventListener { //
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- //出铁次数编号
|
|
|
|
- private String mIronNo;
|
|
|
|
-
|
|
|
|
-// /***
|
|
|
|
-// * L2数据项
|
|
|
|
-// * @param l2Data
|
|
|
|
-// */
|
|
|
|
-// @Subscribe
|
|
|
|
-// public void onL2DataMessageEvent(L2Data l2Data) {
|
|
|
|
-// if (ObjectUtils.isNotEmpty(l2Data.getIronNo())) {
|
|
|
|
-// //只要是新的出铁次数编号,后续都一直用这个编号,直到有新的出铁编号
|
|
|
|
-// mIronNo = l2Data.getIronNo();
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// taskExecutor.submit(() -> {
|
|
|
|
-// getIronTimeNo();
|
|
|
|
-// });
|
|
|
|
-//
|
|
|
|
-//
|
|
|
|
-// //推送实时数据
|
|
|
|
-// taskExecutor.submit(() -> {
|
|
|
|
-// setRealtimeDataAndStatus(null, l2Data);
|
|
|
|
-// });
|
|
|
|
-// }
|
|
|
|
|
|
+ private double mLastSpeed;
|
|
|
|
+
|
|
|
|
|
|
/***
|
|
/***
|
|
- * 记录出铁日期和次数,并返回给前端
|
|
|
|
|
|
+ * 记录出铁次数,并返回给前端
|
|
*/
|
|
*/
|
|
private void getIronTimeNo() {
|
|
private void getIronTimeNo() {
|
|
IronTimeNoDTO ironTimeNoDTO = new IronTimeNoDTO();
|
|
IronTimeNoDTO ironTimeNoDTO = new IronTimeNoDTO();
|
|
@@ -461,7 +441,7 @@ public class DeviceEventListener extends EventListener { //
|
|
if (ObjectUtils.isNotEmpty(latestData)) {
|
|
if (ObjectUtils.isNotEmpty(latestData)) {
|
|
ironTimeNoDTO.setIronNo(latestData.getIronNo());
|
|
ironTimeNoDTO.setIronNo(latestData.getIronNo());
|
|
}
|
|
}
|
|
- ironTimeNoDTO.setDesc(String.format("第%s次出铁", ironTimeNoDTO.getIronNo()));
|
|
|
|
|
|
+ ironTimeNoDTO.setDesc(String.format("四高炉第%s次出铁(1号铁口)", ironTimeNoDTO.getIronNo()));
|
|
PushData.send2IronTimeNo(ironTimeNoDTO);
|
|
PushData.send2IronTimeNo(ironTimeNoDTO);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -475,54 +455,38 @@ public class DeviceEventListener extends EventListener { //
|
|
if (NODE.equalsIgnoreCase(stepDTO.getNodeType())) {
|
|
if (NODE.equalsIgnoreCase(stepDTO.getNodeType())) {
|
|
//处理子项
|
|
//处理子项
|
|
for (IronStepVO child : stepDTO.getChilds()) {
|
|
for (IronStepVO child : stepDTO.getChilds()) {
|
|
- if (STEP_TLC.equals(child.getIdentifier())) {
|
|
|
|
|
|
+ if (StepConstans.STEP_TLC.equals(child.getIdentifier())) {
|
|
if (latest2DataList.size() >= 2) {
|
|
if (latest2DataList.size() >= 2) {
|
|
HashMap[] hashMaps = new HashMap[6];
|
|
HashMap[] hashMaps = new HashMap[6];
|
|
child.setExtraInfo(hashMaps);
|
|
child.setExtraInfo(hashMaps);
|
|
//理论出铁量 = 矿批 × 综合品位 × 1.06
|
|
//理论出铁量 = 矿批 × 综合品位 × 1.06
|
|
//铁量差 = 理论出铁量 - 实际出铁量
|
|
//铁量差 = 理论出铁量 - 实际出铁量
|
|
TL2Data tl2Data1Last = latest2DataList.get(0);
|
|
TL2Data tl2Data1Last = latest2DataList.get(0);
|
|
- BigDecimal llLast = new BigDecimal(tl2Data1Last.getCalcWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
+ BigDecimal theoryWeightLast = new BigDecimal(tl2Data1Last.getTheoryWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
BigDecimal ironWeightLast = new BigDecimal(tl2Data1Last.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
BigDecimal ironWeightLast = new BigDecimal(tl2Data1Last.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
- BigDecimal tlcLast = llLast.subtract(ironWeightLast).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
-
|
|
|
|
- TL2Data tl2Data1GrandLast = latest2DataList.get(1);
|
|
|
|
- BigDecimal llGrandLast = new BigDecimal(tl2Data1GrandLast.getCalcWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
- BigDecimal ironWeightGrandLast = new BigDecimal(tl2Data1GrandLast.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
- BigDecimal tlcGrandLast = llGrandLast.subtract(ironWeightGrandLast).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
-
|
|
|
|
- //铁量差在合理范围内
|
|
|
|
- // 上一次铁量差:-30 上上次铁量差:20 t
|
|
|
|
- // 理论出铁量:1500 t 理论出铁量:1400 t
|
|
|
|
- // 实际出铁量:1530 t 实际出铁量: 1380 t
|
|
|
|
- final String sctlc = "sctlc";
|
|
|
|
- final String ssctlc = "ssctlc";
|
|
|
|
- final String scll = "scll";
|
|
|
|
- final String sscll = "sscll";
|
|
|
|
- final String scsj = "scsj";
|
|
|
|
- final String sscsj = "sscsj";
|
|
|
|
|
|
+ BigDecimal tlcLast = theoryWeightLast.subtract(ironWeightLast).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
+
|
|
|
|
+ TL2Data tl2Data1Grand = latest2DataList.get(1);
|
|
|
|
+ BigDecimal theoryWeightGrand = new BigDecimal(tl2Data1Grand.getTheoryWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
+ BigDecimal ironWeightGrand = new BigDecimal(tl2Data1Grand.getIronWeight()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
+ BigDecimal tlcGrand = theoryWeightGrand.subtract(ironWeightGrand).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
for (IronStepVO grandChild : child.getChilds()) {
|
|
for (IronStepVO grandChild : child.getChilds()) {
|
|
- if (sctlc.equals(grandChild.getIdentifier())) {
|
|
|
|
|
|
+ if (StepConstans.sctlc.equals(grandChild.getIdentifier())) {
|
|
grandChild.setData(tlcLast);
|
|
grandChild.setData(tlcLast);
|
|
- grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
|
- } else if (ssctlc.equals(grandChild.getIdentifier())) {
|
|
|
|
- grandChild.setData(tlcGrandLast);
|
|
|
|
- grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
|
- } else if (scll.equals(grandChild.getIdentifier())) {
|
|
|
|
- grandChild.setData(llLast);
|
|
|
|
- grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
|
- } else if (sscll.equals(grandChild.getIdentifier())) {
|
|
|
|
- grandChild.setData(llGrandLast);
|
|
|
|
- grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
|
- } else if (scsj.equals(grandChild.getIdentifier())) {
|
|
|
|
|
|
+ } else if (StepConstans.ssctlc.equals(grandChild.getIdentifier())) {
|
|
|
|
+ grandChild.setData(tlcGrand);
|
|
|
|
+ } else if (StepConstans.scll.equals(grandChild.getIdentifier())) {
|
|
|
|
+ grandChild.setData(theoryWeightLast);
|
|
|
|
+ } else if (StepConstans.sscll.equals(grandChild.getIdentifier())) {
|
|
|
|
+ grandChild.setData(theoryWeightGrand);
|
|
|
|
+ } else if (StepConstans.scsj.equals(grandChild.getIdentifier())) {
|
|
grandChild.setData(ironWeightLast);
|
|
grandChild.setData(ironWeightLast);
|
|
- grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
|
- } else if (sscsj.equals(grandChild.getIdentifier())) {
|
|
|
|
- grandChild.setData(ironWeightGrandLast);
|
|
|
|
- grandChild.setStepName(StringUtils.substringBefore(grandChild.getStepName(), ":") + ":" + grandChild.getData());
|
|
|
|
|
|
+ } else if (StepConstans.sscsj.equals(grandChild.getIdentifier())) {
|
|
|
|
+ grandChild.setData(ironWeightGrand);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -562,14 +526,31 @@ public class DeviceEventListener extends EventListener { //
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //代表要减去的时间,非剩余时间
|
|
|
|
+ private AtomicInteger mDiffCloseTime = new AtomicInteger(0);
|
|
|
|
+
|
|
|
|
+ private void getCloseTime() {
|
|
|
|
+ RealtimeData realtimeData = new RealtimeData();
|
|
|
|
+ realtimeData.setValue(200 - getIronElapsedMinute() - mDiffCloseTime.get());
|
|
|
|
+ realtimeData.setDesc("距离堵口预计还剩");
|
|
|
|
+ realtimeData.setUnit("分钟");
|
|
|
|
+ PushData.send2CloseTime(realtimeData);
|
|
|
|
+ }
|
|
|
|
+
|
|
//1号铁口正在出铁的操作项目
|
|
//1号铁口正在出铁的操作项目
|
|
private void taphole1Start() {
|
|
private void taphole1Start() {
|
|
//关闭定时任务:出铁预警、开口预警
|
|
//关闭定时任务:出铁预警、开口预警
|
|
//开启定时任务:出铁超时报警、堵口预警、打泥量选择计算、
|
|
//开启定时任务:出铁超时报警、堵口预警、打泥量选择计算、
|
|
|
|
|
|
|
|
+ mTIronData = new TIronData();
|
|
|
|
+ mTIronData.setId(ToolUtils.makeUUID());
|
|
|
|
+ mTIronData.setIronStarttime(LocalDateUtils.formatDate(new Date()));
|
|
|
|
+ ironDataService.saveOrUpdate(mTIronData);
|
|
|
|
+
|
|
//清空出铁总量、出铁计时
|
|
//清空出铁总量、出铁计时
|
|
mTotalWeight = BigDecimal.ZERO;
|
|
mTotalWeight = BigDecimal.ZERO;
|
|
mSecondsElapsed.set(0);
|
|
mSecondsElapsed.set(0);
|
|
|
|
+ //生成 170 到 210 的随机数
|
|
|
|
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_WARN);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_WARN);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN);
|
|
@@ -579,6 +560,8 @@ public class DeviceEventListener extends EventListener { //
|
|
scheduledTaskManager.addTask(scheduleTappingConsttime.getName(), scheduleTappingConsttime.getDelay(), scheduleTappingConsttime.getPeriod(), TimeUnit.SECONDS, () -> {
|
|
scheduledTaskManager.addTask(scheduleTappingConsttime.getName(), scheduleTappingConsttime.getDelay(), scheduleTappingConsttime.getPeriod(), TimeUnit.SECONDS, () -> {
|
|
getIronTime();
|
|
getIronTime();
|
|
mSecondsElapsed.incrementAndGet();
|
|
mSecondsElapsed.incrementAndGet();
|
|
|
|
+
|
|
|
|
+ getCloseTime();
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
@@ -691,22 +674,38 @@ public class DeviceEventListener extends EventListener { //
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ scheduledTaskManager.addTask(TaskNameConstants.TASKNAME_CLOSETIME, 0, 1 * 60, TimeUnit.SECONDS, () -> {
|
|
|
|
+ // log.info("已出铁时间(秒):{},标准出铁时间(秒):{}", seconds, STANDARD_IRON_TIME.get());
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//1号铁口结束出铁的操作项目
|
|
//1号铁口结束出铁的操作项目
|
|
private void taphole1End() {
|
|
private void taphole1End() {
|
|
//由 1-> 0 表明1号铁口结束出铁
|
|
//由 1-> 0 表明1号铁口结束出铁
|
|
|
|
+ if (null != mTIronData) {
|
|
|
|
+ mTIronData.setIronCosttime(getIronElapsedMinute());
|
|
|
|
+ mTIronData.setIronWeight(mTotalWeight.doubleValue());
|
|
|
|
+ mTIronData.setIronEndtime(LocalDateUtils.formatDate(new Date()));
|
|
|
|
+ ironDataService.saveOrUpdate(mTIronData);
|
|
|
|
+ }
|
|
|
|
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_CLOSURE_WARN);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_CLOSURE_WARN);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_HIT_MUD);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_HIT_MUD);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_CONSTTIME);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_CONSTTIME);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN);
|
|
scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_TAPPING_TIMEOUT_WARN);
|
|
|
|
+ scheduledTaskManager.cancelTask(TaskNameConstants.TASKNAME_CLOSETIME);
|
|
|
|
+
|
|
|
|
+ PushData.send2CostTime(new RealtimeData());
|
|
|
|
+ PushData.send2CloseTime(new RealtimeData());
|
|
|
|
|
|
- getIronTime();
|
|
|
|
|
|
+ //尝试重新获取一次新的铁次号码
|
|
getIronTimeNo();
|
|
getIronTimeNo();
|
|
mSteps = ironStepService.getTreeSteps();
|
|
mSteps = ironStepService.getTreeSteps();
|
|
|
|
|
|
|
|
+
|
|
//开口
|
|
//开口
|
|
// PushData.send2CancelWarn(WarnData.warnOpen("", ""));
|
|
// PushData.send2CancelWarn(WarnData.warnOpen("", ""));
|
|
//堵口
|
|
//堵口
|
|
@@ -744,30 +743,30 @@ public class DeviceEventListener extends EventListener { //
|
|
boolean ironTimeBool = mParser.parseExpression(split[0]).getValue(mContext, Boolean.class);
|
|
boolean ironTimeBool = mParser.parseExpression(split[0]).getValue(mContext, Boolean.class);
|
|
|
|
|
|
if (ironTimeBool) {
|
|
if (ironTimeBool) {
|
|
- testResultStr += "出铁时间正常,";
|
|
|
|
|
|
+ testResultStr += "出铁时间符合预期,";
|
|
} else {
|
|
} else {
|
|
- testResultStr += "出铁时间异常,";
|
|
|
|
|
|
+ testResultStr += "出铁时间不符合预期,";
|
|
}
|
|
}
|
|
|
|
|
|
boolean ironWeightBool = mParser.parseExpression(split[1]).getValue(mContext, Boolean.class);
|
|
boolean ironWeightBool = mParser.parseExpression(split[1]).getValue(mContext, Boolean.class);
|
|
if (ironWeightBool) {
|
|
if (ironWeightBool) {
|
|
- testResultStr += "出铁量正常,";
|
|
|
|
|
|
+ testResultStr += "出铁量符合预期,";
|
|
} else {
|
|
} else {
|
|
- testResultStr += "出铁量异常,";
|
|
|
|
|
|
+ testResultStr += "出铁量不符合预期,";
|
|
}
|
|
}
|
|
|
|
|
|
boolean ironSpeedBool = mParser.parseExpression(split[2]).getValue(mContext, Boolean.class);
|
|
boolean ironSpeedBool = mParser.parseExpression(split[2]).getValue(mContext, Boolean.class);
|
|
if (ironSpeedBool) {
|
|
if (ironSpeedBool) {
|
|
- testResultStr += "出铁流速正常,";
|
|
|
|
|
|
+ testResultStr += "出铁流速符合预期,";
|
|
} else {
|
|
} else {
|
|
- testResultStr += "出铁流速异常,";
|
|
|
|
|
|
+ testResultStr += "出铁流速不符合预期,";
|
|
}
|
|
}
|
|
|
|
|
|
boolean ironTempChangeBool = mParser.parseExpression(split[3]).getValue(mContext, Boolean.class);
|
|
boolean ironTempChangeBool = mParser.parseExpression(split[3]).getValue(mContext, Boolean.class);
|
|
if (ironTempChangeBool) {
|
|
if (ironTempChangeBool) {
|
|
- testResultStr += "铁水温度变化正常。";
|
|
|
|
|
|
+ testResultStr += "铁水温度变化符合预期。";
|
|
} else {
|
|
} else {
|
|
- testResultStr += "铁水温度变化异常。";
|
|
|
|
|
|
+ testResultStr += "铁水温度变化不符合预期。";
|
|
}
|
|
}
|
|
TIronTest ironTest = new TIronTest();
|
|
TIronTest ironTest = new TIronTest();
|
|
String testStatus = (ironTimeBool && ironWeightBool && ironSpeedBool && ironTempChangeBool) ? "1" : "0";
|
|
String testStatus = (ironTimeBool && ironWeightBool && ironSpeedBool && ironTempChangeBool) ? "1" : "0";
|
|
@@ -875,7 +874,22 @@ public class DeviceEventListener extends EventListener { //
|
|
speeds[1] = realtimeData;
|
|
speeds[1] = realtimeData;
|
|
speed2 = new AtomicDouble(Double.parseDouble(opcData.getData().toString()));
|
|
speed2 = new AtomicDouble(Double.parseDouble(opcData.getData().toString()));
|
|
}
|
|
}
|
|
- mContext.setVariable(ExpressionConstants.rtIronSpeed, speed1.get() > speed2.get() ? speed1.get() : speed2.get());
|
|
|
|
|
|
+ double maxSpeed = Math.max(speed1.get(), speed2.get());
|
|
|
|
+ mContext.setVariable(ExpressionConstants.rtIronSpeed, maxSpeed);
|
|
|
|
+
|
|
|
|
+ if (maxSpeed != 0 && ironLoading1.get() > 0) {
|
|
|
|
+ if (this.mLastSpeed == 0) {
|
|
|
|
+ this.mLastSpeed = maxSpeed;
|
|
|
|
+ } else if (maxSpeed > this.mLastSpeed) {
|
|
|
|
+ mDiffCloseTime.set(Math.max(mDiffCloseTime.get() + 1, 0));
|
|
|
|
+ this.mLastSpeed = maxSpeed;
|
|
|
|
+ } else if (maxSpeed < this.mLastSpeed) {
|
|
|
|
+ mDiffCloseTime.set(Math.max(mDiffCloseTime.get() - 1, 0));
|
|
|
|
+ this.mLastSpeed = maxSpeed;
|
|
|
|
+ }
|
|
|
|
+ getCloseTime();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//只在两个都有数据的时候才添加
|
|
//只在两个都有数据的时候才添加
|
|
if (ObjectUtils.isNotEmpty(speeds)
|
|
if (ObjectUtils.isNotEmpty(speeds)
|
|
@@ -884,6 +898,8 @@ public class DeviceEventListener extends EventListener { //
|
|
) {
|
|
) {
|
|
ironSpeed.setTime(LocalDateUtils.formatDate(opcData.getServerTime()));
|
|
ironSpeed.setTime(LocalDateUtils.formatDate(opcData.getServerTime()));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
} else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_TAPHOLE1_STATUS(opcData.getServerType()))) {
|
|
} else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_TAPHOLE1_STATUS(opcData.getServerType()))) {
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
realtimeData.setValue(opcData.getData());
|
|
realtimeData.setValue(opcData.getData());
|
|
@@ -915,7 +931,7 @@ public class DeviceEventListener extends EventListener { //
|
|
RealtimeData ironWeight = new RealtimeData();
|
|
RealtimeData ironWeight = new RealtimeData();
|
|
ironWeight.setDesc("铁水流量");
|
|
ironWeight.setDesc("铁水流量");
|
|
ironWeight.setUnit("t");
|
|
ironWeight.setUnit("t");
|
|
- if(ObjectUtils.isEmpty(mIronOPCData) || !opcData.getData().equals(mIronOPCData.getData())){
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(mIronOPCData) || !opcData.getData().equals(mIronOPCData.getData())) {
|
|
mIronOPCData = opcData;
|
|
mIronOPCData = opcData;
|
|
}
|
|
}
|
|
BigDecimal bigDecimalNew = new BigDecimal(mIronOPCData.getData().toString());
|
|
BigDecimal bigDecimalNew = new BigDecimal(mIronOPCData.getData().toString());
|
|
@@ -926,7 +942,6 @@ public class DeviceEventListener extends EventListener { //
|
|
ironWeight.setTime(LocalDateUtils.formatDate(opcData.getServerTime()));
|
|
ironWeight.setTime(LocalDateUtils.formatDate(opcData.getServerTime()));
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
mContext.setVariable(ExpressionConstants.rtIronWeight, mTotalWeight.doubleValue());
|
|
mContext.setVariable(ExpressionConstants.rtIronWeight, mTotalWeight.doubleValue());
|
|
|
|
|
|
} else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_FLUSH_STATUS(opcData.getServerType()))) {
|
|
} else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_FLUSH_STATUS(opcData.getServerType()))) {
|
|
@@ -986,13 +1001,11 @@ public class DeviceEventListener extends EventListener { //
|
|
String pointName = mOPCData.getPointName();
|
|
String pointName = mOPCData.getPointName();
|
|
Object data = mOPCData.getData();
|
|
Object data = mOPCData.getData();
|
|
for (IronStepVO stepDTO : mSteps) {
|
|
for (IronStepVO stepDTO : mSteps) {
|
|
- //log.info("nodetype:{},pointname:{},opc pointname:{}",stepDTO.getNodeType(),stepDTO.getPointName(),pointName);
|
|
|
|
if (NODE.equalsIgnoreCase(stepDTO.getNodeType())) {
|
|
if (NODE.equalsIgnoreCase(stepDTO.getNodeType())) {
|
|
//处理子项
|
|
//处理子项
|
|
for (IronStepVO child : stepDTO.getChilds()) {
|
|
for (IronStepVO child : stepDTO.getChilds()) {
|
|
for (IronStepVO childchild : child.getChilds()) {
|
|
for (IronStepVO childchild : child.getChilds()) {
|
|
|
|
|
|
-
|
|
|
|
//plc的point和step的point一致
|
|
//plc的point和step的point一致
|
|
String newPointName = childchild.getPointName();
|
|
String newPointName = childchild.getPointName();
|
|
|
|
|
|
@@ -1168,11 +1181,11 @@ public class DeviceEventListener extends EventListener { //
|
|
PushData.send2Operation(mSteps, ironLoading1.get());
|
|
PushData.send2Operation(mSteps, ironLoading1.get());
|
|
|
|
|
|
for (IronStepVO stepDTO : mSteps) {
|
|
for (IronStepVO stepDTO : mSteps) {
|
|
- if (STEP_LQSQCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
|
|
|
|
|
|
+ if (StepConstans.STEP_LQSQCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
|
|
//
|
|
//
|
|
List<TL2Data> tl2DataList = tl2DataService.getTappedLatest2Datas();
|
|
List<TL2Data> tl2DataList = tl2DataService.getTappedLatest2Datas();
|
|
getTheoryWeight(tl2DataList);
|
|
getTheoryWeight(tl2DataList);
|
|
- } else if (STEP_YPQRCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
|
|
|
|
|
|
+ } else if (StepConstans.STEP_YPQRCT.equals(stepDTO.getIdentifier()) && stepDTO.getPassResult() == 1) {
|
|
//炉前在接受到炉内出铁要求后,10分钟内打开铁口,未打开系统告警并记录
|
|
//炉前在接受到炉内出铁要求后,10分钟内打开铁口,未打开系统告警并记录
|
|
|
|
|
|
if ("1".equals(scheduleOpenWarn.getStatus())) {
|
|
if ("1".equals(scheduleOpenWarn.getStatus())) {
|
|
@@ -1277,6 +1290,7 @@ public class DeviceEventListener extends EventListener { //
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
setStepResult(mSteps);
|
|
setStepResult(mSteps);
|
|
|
|
+ //推送炼铁步骤
|
|
PushData.send2Operation(mSteps, ironLoading1.get());
|
|
PushData.send2Operation(mSteps, ironLoading1.get());
|
|
//推送实时数据
|
|
//推送实时数据
|
|
PushData.send2RealtimeData(mRealtimeData);
|
|
PushData.send2RealtimeData(mRealtimeData);
|