|
@@ -10,8 +10,8 @@ import com.sckj.common.eventbus.EventListener;
|
|
|
import com.sckj.common.manager.ScheduledTaskManager;
|
|
|
import com.sckj.common.socketio.SocketUtil;
|
|
|
import com.sckj.common.util.RedisUtils;
|
|
|
-import com.sckj.iron.constant.L1TagConstants;
|
|
|
import com.sckj.iron.constant.ParamsConstants;
|
|
|
+import com.sckj.iron.constant.SubscribeTagConstants;
|
|
|
import com.sckj.iron.constant.TaskNameConstants;
|
|
|
import com.sckj.iron.dto.IronStepDTO;
|
|
|
import com.sckj.iron.dto.IronTimeNoDTO;
|
|
@@ -24,7 +24,6 @@ import com.sckj.iron.entity.TIronStepLog;
|
|
|
import com.sckj.iron.service.impl.*;
|
|
|
import com.sckj.iron.util.LocalDateUtils;
|
|
|
import com.sckj.iron.vo.IronStepVO;
|
|
|
-import com.sckj.l2.dto.L2Data;
|
|
|
import com.sckj.l2.entity.TL2Data;
|
|
|
import com.sckj.l2.service.impl.L2DataServiceImpl;
|
|
|
import com.sckj.l2.service.impl.TL2DataServiceImpl;
|
|
@@ -399,9 +398,9 @@ public class DeviceEventListener extends EventListener { //
|
|
|
|
|
|
//实时数据
|
|
|
taskExecutor.submit(() -> {
|
|
|
- setRealtimeDataAndStatus(opcData, null);
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
|
+ setRealtimeDataAndStatus(opcData, null);
|
|
|
}
|
|
|
|
|
|
//出铁次数编号
|
|
@@ -729,13 +728,13 @@ public class DeviceEventListener extends EventListener { //
|
|
|
scheduledTaskManager.addTask(scheduleTappingTest.getName(), scheduleTappingTest.getDelay(), scheduleTappingTest.getPeriod(), TimeUnit.SECONDS, () -> {
|
|
|
//堵口预警
|
|
|
log.info("出铁结束,定时任务:{},出铁诊断", TaskNameConstants.TASKNAME_TAPPING_TEST);
|
|
|
- L2Data fixedLatestElement = (L2Data) RedisUtils.getFixedLatestElement(IRON_ELEMENT);
|
|
|
+ TL2Data fixedLatestElement = (TL2Data) RedisUtils.getFixedLatestElement(IRON_ELEMENT);
|
|
|
//平均温度
|
|
|
- String mudWeight = fixedLatestElement.getAvgTemp();
|
|
|
+ Double mudWeight = fixedLatestElement.getAvgTemp();
|
|
|
//出铁时间
|
|
|
//String ironCosttime = fixedLatestElement.getI
|
|
|
//实际出铁量
|
|
|
- String ironWeight = fixedLatestElement.getIronWeight();
|
|
|
+ Double ironWeight = fixedLatestElement.getIronWeight();
|
|
|
|
|
|
// TIronData ironData = new TIronData();
|
|
|
// BeanUtils.copyProperties(ironData, fixedLatestElement);
|
|
@@ -801,7 +800,7 @@ public class DeviceEventListener extends EventListener { //
|
|
|
/***
|
|
|
* 设置实时数据值和状态
|
|
|
*/
|
|
|
- private synchronized void setRealtimeDataAndStatus(OPCData opcData, L2Data l2Data) {
|
|
|
+ private synchronized void setRealtimeDataAndStatus(OPCData opcData, TL2Data l2Data) {
|
|
|
//铁水温度
|
|
|
//铁水流速
|
|
|
//铁水成分
|
|
@@ -809,7 +808,7 @@ public class DeviceEventListener extends EventListener { //
|
|
|
//WI5401.PV 1TH-1号车总重
|
|
|
//WI5402.PV 1TH-2号车TPC总重
|
|
|
if (ObjectUtils.isNotEmpty(opcData)) {
|
|
|
- if (opcData.getPointName().contains(L1TagConstants.TAG_IRON_TEMP)) {
|
|
|
+ if (opcData.getPointName().contains(SubscribeTagConstants.TAG_IRON_TEMP(opcData.getServerType()))) {
|
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
|
realtimeData.setValue(opcData.getData());
|
|
|
realtimeData.setUnit("℃");
|
|
@@ -828,7 +827,7 @@ public class DeviceEventListener extends EventListener { //
|
|
|
}
|
|
|
|
|
|
|
|
|
- } else if (opcData.getPointName().contains(L1TagConstants.TAG_CAR11) || opcData.getPointName().contains(L1TagConstants.TAG_CAR12)) {
|
|
|
+ } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_CAR11(opcData.getServerType())) || opcData.getPointName().contains(SubscribeTagConstants.TAG_CAR12(opcData.getServerType()))) {
|
|
|
//1TH-1号车受铁速度
|
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
|
realtimeData.setValue(opcData.getData());
|
|
@@ -846,7 +845,7 @@ public class DeviceEventListener extends EventListener { //
|
|
|
speeds = (RealtimeData[]) ironSpeed.getValue();
|
|
|
}
|
|
|
|
|
|
- if (opcData.getPointName().contains(L1TagConstants.TAG_CAR11)) {
|
|
|
+ if (opcData.getPointName().contains(SubscribeTagConstants.TAG_CAR11(opcData.getServerType()))) {
|
|
|
realtimeData.setDesc("1号车");
|
|
|
speeds[0] = realtimeData;
|
|
|
speed1 = new AtomicDouble(Double.parseDouble(opcData.getData().toString()));
|
|
@@ -864,7 +863,7 @@ public class DeviceEventListener extends EventListener { //
|
|
|
ironSpeed.setTime(LocalDateUtils.formatDate(opcData.getServerTime()));
|
|
|
|
|
|
}
|
|
|
- } else if (opcData.getPointName().contains(L1TagConstants.TAG_TAPHOLE1_STATUS)) {
|
|
|
+ } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_TAPHOLE1_STATUS(opcData.getServerType()))) {
|
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
|
realtimeData.setValue(opcData.getData());
|
|
|
realtimeData.setDesc("出铁状态");
|
|
@@ -878,16 +877,16 @@ public class DeviceEventListener extends EventListener { //
|
|
|
taphole1End();
|
|
|
}
|
|
|
|
|
|
- } else if (opcData.getPointName().contains(L1TagConstants.TAG_TAPHOLE2_STATUS)) {
|
|
|
+ } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_TAPHOLE2_STATUS(opcData.getServerType()))) {
|
|
|
ironLoading2.set(Integer.parseInt(opcData.getData().toString()));
|
|
|
|
|
|
- } else if (opcData.getPointName().contains(L1TagConstants.TAG_TAPHOLE3_STATUS)) {
|
|
|
+ } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_TAPHOLE3_STATUS(opcData.getServerType()))) {
|
|
|
ironLoading3.set(Integer.parseInt(opcData.getData().toString()));
|
|
|
|
|
|
- } else if (opcData.getPointName().contains(L1TagConstants.TAG_TAPHOLE4_STATUS)) {
|
|
|
+ } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_TAPHOLE4_STATUS(opcData.getServerType()))) {
|
|
|
ironLoading4.set(Integer.parseInt(opcData.getData().toString()));
|
|
|
|
|
|
- } else if (opcData.getPointName().contains(L1TagConstants.TAG_IRON_WEIGHT11) || opcData.getPointName().contains(L1TagConstants.TAG_IRON_WEIGHT12)) {
|
|
|
+ } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_IRON_WEIGHT11(opcData.getServerType())) || opcData.getPointName().contains(SubscribeTagConstants.TAG_IRON_WEIGHT12(opcData.getServerType()))) {
|
|
|
//铁水流量
|
|
|
RealtimeData ironWeight = new RealtimeData();
|
|
|
ironWeight.setDesc("铁水流量");
|
|
@@ -897,11 +896,8 @@ public class DeviceEventListener extends EventListener { //
|
|
|
ironWeight.setValue(mTotalWeight);
|
|
|
mRealtimeData.put(IRON_WEIGHT, ironWeight);
|
|
|
// log.info(">>>>>>>>>>>>>{}:{},total:{}", opcData.getPointName(), opcData.getData(), totalWeight.toPlainString());
|
|
|
-
|
|
|
ironWeight.setTime(LocalDateUtils.formatDate(opcData.getServerTime()));
|
|
|
-
|
|
|
-
|
|
|
- } else if (opcData.getPointName().contains(L1TagConstants.TAG_FLUSH_STATUS)) {
|
|
|
+ } else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_FLUSH_STATUS(opcData.getServerType()))) {
|
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
|
realtimeData.setValue(opcData.getData());
|
|
|
realtimeData.setDesc("冲渣状态");
|
|
@@ -910,7 +906,7 @@ public class DeviceEventListener extends EventListener { //
|
|
|
|
|
|
}
|
|
|
|
|
|
- L2Data fixedLatestElement = (L2Data) RedisUtils.getFixedLatestElement(IRON_ELEMENT);
|
|
|
+ TL2Data fixedLatestElement = (TL2Data) RedisUtils.getFixedLatestElement(IRON_ELEMENT);
|
|
|
|
|
|
if (ObjectUtils.isNotEmpty(fixedLatestElement)) {
|
|
|
//铁水成分
|
|
@@ -1212,6 +1208,7 @@ public class DeviceEventListener extends EventListener { //
|
|
|
return;
|
|
|
}
|
|
|
if (ObjectUtils.isNotEmpty(message)) {
|
|
|
+ log.info("取消预警:{}", message);
|
|
|
scheduledTaskManager.cancelTask(message.getType());
|
|
|
}
|
|
|
}
|