|
@@ -307,7 +307,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
scheduledTaskManager.addTask(opcdasubscribe.getName(), opcdasubscribe.getDelay(), opcdasubscribe.getPeriod(), TimeUnit.SECONDS, () -> {
|
|
|
if ("prod".equals(activeProfiles)) {
|
|
|
log.info("HDC subscribe available");
|
|
|
- hdService.subscribeAvailable();
|
|
|
+ hdService.subscribeAvailable();
|
|
|
} else if ("test".equals(activeProfiles)) {
|
|
|
log.info("DA subscribe available");
|
|
|
opcuaService.subscribeAvailable();
|
|
@@ -801,7 +801,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
/***
|
|
|
* 剩余出铁时间 = (理论铁量(1300)-累计出铁量)/流速
|
|
|
*/
|
|
|
- private void getCloseTime() {
|
|
|
+ private void getCloseTime(BigDecimal totalWeight) {
|
|
|
log.info("开始计算预计剩余出铁时间");
|
|
|
|
|
|
RealtimeData realtimeData = new RealtimeData();
|
|
@@ -833,7 +833,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
//最大出铁标准量
|
|
|
double stdIronWeightMax = Double.parseDouble(mContext.lookupVariable(ExpressionConstants.stdIronWeightMax).toString());
|
|
|
//实时总铁量
|
|
|
- BigDecimal totalWeight = mTotalWeight;
|
|
|
+ // BigDecimal totalWeight = rtTotalWeight;
|
|
|
//平均流速
|
|
|
BigDecimal avgSpeed = totalWeight.divide(BigDecimal.valueOf(ironElapsedMinute), 2, RoundingMode.HALF_UP);
|
|
|
//剩余重量
|
|
@@ -1057,6 +1057,15 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
log.info("🛑 ====== 开始执行 taphole1End - 出铁结束处理 ======");
|
|
|
|
|
|
synchronized (scheduledTaskManager) {
|
|
|
+ log.info(" ├─ ⏸️ 出铁结束,1号罐车有余存铁量进行记录");
|
|
|
+ mTotalWeight = mTotalWeight.add(ironWeight1Pre);
|
|
|
+ log.info("出铁结束,铁水总流量:{},1号线剩余铁水流量:{}",
|
|
|
+ mTotalWeight, ironWeight1Pre);
|
|
|
+ log.info(" ├─ ⏸️ 出铁结束,2号罐车有余存铁量进行记录");
|
|
|
+ mTotalWeight = mTotalWeight.add(ironWeight2Pre);
|
|
|
+ log.info("出铁结束,铁水总流量:{},2号线剩余铁水流量:{}",
|
|
|
+ mTotalWeight, ironWeight2Pre);
|
|
|
+
|
|
|
// 记录当前出铁统计信息
|
|
|
log.info("📊 出铁结束统计: 总时长={}分钟, 总重量={}吨",
|
|
|
getIronElapsedMinute(),
|
|
@@ -1101,8 +1110,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
|
|
|
// 4. 取消相关预警
|
|
|
log.info("🚨 取消相关预警信息...");
|
|
|
- PushData.send2CancelWarn(WarnData.warnClose("出铁结束", ""));
|
|
|
- PushData.send2CancelWarn(WarnData.warnTapping("出铁结束", ""));
|
|
|
+ PushData.send2CancelWarn(new TAudioDTO());
|
|
|
log.info("✅ 预警信息已取消");
|
|
|
|
|
|
// 5. 清空打泥量
|
|
@@ -1233,7 +1241,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
}
|
|
|
} else {
|
|
|
mWarnCountMap.put(modelKey1, 0);
|
|
|
- PushData.send2CancelWarn(WarnData.warnClose("取消堵口告警1", ""));
|
|
|
+ PushData.send2CancelWarn(new TAudioDTO());
|
|
|
}
|
|
|
|
|
|
String modelExpression2 = modelClosureWarn2.getModelExpression();
|
|
@@ -1262,7 +1270,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
}
|
|
|
} else {
|
|
|
mWarnCountMap.put(modelKey2, 0);
|
|
|
- PushData.send2CancelWarn(WarnData.warnClose("取消堵口告警2", ""));
|
|
|
+ PushData.send2CancelWarn(new TAudioDTO());
|
|
|
}
|
|
|
|
|
|
String modelExpression3 = modelClosureWarn3.getModelExpression();
|
|
@@ -1290,7 +1298,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
}
|
|
|
} else {
|
|
|
mWarnCountMap.put(modelKey3, 0);
|
|
|
- PushData.send2CancelWarn(WarnData.warnClose("取消堵口告警3", ""));
|
|
|
+ PushData.send2CancelWarn(new TAudioDTO());
|
|
|
}
|
|
|
} else {
|
|
|
log.info("使用实时速度预警模式");
|
|
@@ -1638,7 +1646,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
log.info("预警条件不满足,重置计数器,原计数: {}", oldCount);
|
|
|
}
|
|
|
mWarnCountMap.put(modelKey, 0);
|
|
|
- PushData.send2CancelWarn(WarnData.warnTapping("压差正常", ""));
|
|
|
+ PushData.send2CancelWarn(new TAudioDTO());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("执行急需出铁预警表达式时发生异常", e);
|
|
@@ -2260,7 +2268,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
}
|
|
|
|
|
|
//剩余铁量计算-流速
|
|
|
- getCloseTime();
|
|
|
+ //getCloseTime();
|
|
|
|
|
|
}
|
|
|
} else if (opcData.getPointName().contains(SubscribeTagConstants.TAG_TAPHOLE2_STATUS(opcData.getServerType()))) {
|
|
@@ -2311,7 +2319,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
BigDecimal diff = ironWeight1Pre.subtract(bigDecimalNew);
|
|
|
log.info(" ├─ 计算差值: {} - {} = {}", ironWeight1Pre, bigDecimalNew, diff);
|
|
|
|
|
|
- if (diff.compareTo(new BigDecimal("130")) > 0) {
|
|
|
+ if (diff.compareTo(new BigDecimal("70")) > 0) {
|
|
|
log.info(" ├─ 🔄 检测到满载流量变化 (差值 > 130t)");
|
|
|
log.info(" ├─ 累加前总流量: {} t", mTotalWeight);
|
|
|
|
|
@@ -2324,11 +2332,15 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
|
|
|
log.info("铁水总流量:{},1号线铁水满载流量:{},下一个流量:{}",
|
|
|
mTotalWeight, ironWeight1Pre, bigDecimalNew);
|
|
|
+
|
|
|
+ getCloseTime(mTotalWeight);
|
|
|
+
|
|
|
} else {
|
|
|
log.info(" ├─ ⏭️ 未达到满载阈值 (差值 ≤ 130t),跳过累加");
|
|
|
log.info(" ├─ 当前差值: {} t ≤ 130 t", diff);
|
|
|
- }
|
|
|
|
|
|
+ getCloseTime(mTotalWeight.add(bigDecimalNew));
|
|
|
+ }
|
|
|
|
|
|
// 更新上次流量值
|
|
|
log.info(" ├─ 📝 更新上次流量值: {} → {}", ironWeight1Pre, bigDecimalNew);
|
|
@@ -2338,15 +2350,13 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
log.info(" ├─ 📍 检测到 TAG_IRON_WEIGHT12 - 2号车铁水流量");
|
|
|
realtimeData.setValue(2);
|
|
|
|
|
|
-
|
|
|
BigDecimal diff = ironWeight2Pre.subtract(bigDecimalNew);
|
|
|
log.info(" ├─ 计算差值: {} - {} = {}", ironWeight2Pre, bigDecimalNew, diff);
|
|
|
|
|
|
- if (diff.compareTo(new BigDecimal("130")) > 0) {
|
|
|
+ if (diff.compareTo(new BigDecimal("70")) > 0) {
|
|
|
log.info(" ├─ 🔄 检测到满载流量变化 (差值 > 130t)");
|
|
|
log.info(" ├─ 累加前总流量: {} t", mTotalWeight);
|
|
|
|
|
|
-
|
|
|
mTotalWeight = mTotalWeight.add(ironWeight2Pre);
|
|
|
|
|
|
log.info(" ├─ ✅ 累加后总流量: {} t", mTotalWeight);
|
|
@@ -2355,9 +2365,15 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
|
|
|
log.info("铁水总流量:{},2号线铁水满载流量:{},下一个流量:{}",
|
|
|
mTotalWeight, ironWeight2Pre, bigDecimalNew);
|
|
|
+
|
|
|
+ getCloseTime(mTotalWeight);
|
|
|
+
|
|
|
} else {
|
|
|
log.info(" ├─ ⏭️ 未达到满载阈值 (差值 ≤ 130t),跳过累加");
|
|
|
log.info(" ├─ 当前差值: {} t ≤ 130 t", diff);
|
|
|
+
|
|
|
+ getCloseTime(mTotalWeight.add(bigDecimalNew));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 更新上次流量值
|
|
@@ -2366,19 +2382,11 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- log.info(" ├─ ⏸️ 出铁状态未激活,流量值设为0");
|
|
|
- mTotalWeight = mTotalWeight.add(ironWeight1Pre);
|
|
|
- log.info("出铁结束,铁水总流量:{},1号线剩余铁水流量:{}",
|
|
|
- mTotalWeight, ironWeight1Pre);
|
|
|
- mTotalWeight = mTotalWeight.add(ironWeight2Pre);
|
|
|
- log.info("出铁结束,铁水总流量:{},2号线剩余铁水流量:{}",
|
|
|
- mTotalWeight, ironWeight2Pre);
|
|
|
-
|
|
|
realtimeData.setValue(0);
|
|
|
}
|
|
|
|
|
|
//剩余铁量计算-流量
|
|
|
- getCloseTime();
|
|
|
+
|
|
|
|
|
|
log.info("📋 【实时数据构建】");
|
|
|
realtimeData.setDesc("摆动溜嘴的摆动方向");
|
|
@@ -3051,7 +3059,7 @@ public class DeviceEventListener extends AbstractEventListener { //
|
|
|
* @param message
|
|
|
*/
|
|
|
@OnEvent(value = PushData.IRON_CANCEL_WARN)
|
|
|
- public void cancelWarn(SocketIOClient client, WarnData message) {
|
|
|
+ public void cancelWarn(SocketIOClient client, String message) {
|
|
|
if (null == validateClientOnline(client)) {
|
|
|
return;
|
|
|
}
|