新增主页接口,然后中译英

This commit is contained in:
2025-12-26 16:49:41 +08:00
parent de333aaf5c
commit 6e85b45d7c
3 changed files with 16 additions and 16 deletions

View File

@@ -86,7 +86,7 @@ public class MessageSubscriptionRunner implements ApplicationRunner {
EntryMovementMessage msg =new EntryMovementMessage(); EntryMovementMessage msg =new EntryMovementMessage();
writeMessage( msg,entryMoveIds); writeMessage( msg,entryMoveIds);
log.info("接收入口移动信号:从 {} 移动到 {} ", msg.getMaterialPlaceSource(), msg.getMaterialPlaceDestination()); log.info("接收入口移动信号:从 {} 移动到 {} ", msg.getMaterialPlaceSource(), msg.getMaterialPlaceDestination());
logDataService.logInfo("TRACK","接收入口移动信号:从 {} 移动到 {} ", msg.getMaterialPlaceSource(), msg.getMaterialPlaceDestination()); logDataService.logInfo("TRACK","Received entry movement signal: from {} to {}", msg.getMaterialPlaceSource(), msg.getMaterialPlaceDestination());
opcReceiverHandler.onMessageReceived(OpcMessageType.ENTRY_MOVEMENT,msg); opcReceiverHandler.onMessageReceived(OpcMessageType.ENTRY_MOVEMENT,msg);
} catch (Exception e) { } catch (Exception e) {
} }
@@ -98,7 +98,7 @@ public class MessageSubscriptionRunner implements ApplicationRunner {
ExitCutMessage msg = new ExitCutMessage(); ExitCutMessage msg = new ExitCutMessage();
writeMessage( msg,exitCutIds); writeMessage( msg,exitCutIds);
log.info("接收到出口剪切信号:剪切类型 {},剪切长度{} ", msg.getCutType().toString(), msg.getCutLength()); log.info("接收到出口剪切信号:剪切类型 {},剪切长度{} ", msg.getCutType().toString(), msg.getCutLength());
logDataService.logInfo("TRACK","接收到出口剪切信号:剪切类型 {},剪切长度{} ", msg.getCutType().toString(), msg.getCutLength()); logDataService.logInfo("TRACK","Received exit cut signal: cut type {}, cut length {}", msg.getCutType().toString(), msg.getCutLength());
opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_CUT,msg); opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_CUT,msg);
} catch (Exception e) { } catch (Exception e) {
} }
@@ -110,7 +110,7 @@ public class MessageSubscriptionRunner implements ApplicationRunner {
ExitMovementMessage msg = new ExitMovementMessage(); ExitMovementMessage msg = new ExitMovementMessage();
writeMessage( msg,exitMoveIds); writeMessage( msg,exitMoveIds);
log.info("接收出口移动信号:从 {} 移动到 {} ", msg.getExSrc(), msg.getExDesc()); log.info("接收出口移动信号:从 {} 移动到 {} ", msg.getExSrc(), msg.getExDesc());
logDataService.logInfo("TRACK","接收出口移动信号:从 {} 移动到 {} ", msg.getExSrc(), msg.getExDesc()); logDataService.logInfo("TRACK","Received exit movement signal: from {} to {}", msg.getExSrc(), msg.getExDesc());
opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_MOVEMENT,msg); opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_MOVEMENT,msg);
} catch (Exception e) { } catch (Exception e) {
} }
@@ -122,7 +122,7 @@ public class MessageSubscriptionRunner implements ApplicationRunner {
ExitMeasureMessage msg = new ExitMeasureMessage(); ExitMeasureMessage msg = new ExitMeasureMessage();
writeMessage(msg,exitMeasureIds); writeMessage(msg,exitMeasureIds);
log.info("接收出口称重信号:重量 {} ", msg.getWeight()); log.info("接收出口称重信号:重量 {} ", msg.getWeight());
logDataService.logInfo("TRACK","接收出口称重信号:重量 {} ", msg.getWeight()); logDataService.logInfo("TRACK","Received exit weight signal: weight {}", msg.getWeight());
opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_MEASURE,msg); opcReceiverHandler.onMessageReceived(OpcMessageType.EXIT_MEASURE,msg);
} catch (Exception e) { } catch (Exception e) {
} }

View File

@@ -67,7 +67,7 @@ public class AppMeasureHandler implements OpcMessageHandler<AppMeasureMessage> {
int count = LOG_COUNTER.incrementAndGet(); int count = LOG_COUNTER.incrementAndGet();
if (count % 10 == 0) { if (count % 10 == 0) {
logDataService.logInfo("WELDER", logDataService.logInfo("WELDER",
"接收到钢卷焊缝跟踪信号:当前焊缝长度 lengthAtWelder{} 当前钢卷信息 coilId{}", "Received weld tracking signal: lengthAtWelder={}, coilId={}",
lengthAtWelder, coilId); lengthAtWelder, coilId);
} }

View File

@@ -88,7 +88,7 @@ public class SegmentTrackerService {
if (lastTime == null || now - lastTime > intervalTime) { if (lastTime == null || now - lastTime > intervalTime) {
lastLogTimeMap.put(coilId, now); lastLogTimeMap.put(coilId, now);
log.info("【TRACK-START】接收到测量数据 -> CoilId: {}, LengthAtWelder: {}", coilId, entryLengthAtWelder); log.info("【TRACK-START】接收到测量数据 -> CoilId: {}, LengthAtWelder: {}", coilId, entryLengthAtWelder);
logDataService.logInfo("WELDER", "接收到测量数据 -> CoilId: " + coilId + ", LengthAtWelder: " + entryLengthAtWelder); logDataService.logInfo("WELDER", "Received measurement data -> CoilId: " + coilId + ", LengthAtWelder: " + entryLengthAtWelder);
} }
// 4. trackCoilHeadPosition 同步执行 // 4. trackCoilHeadPosition 同步执行
@@ -107,7 +107,7 @@ public class SegmentTrackerService {
if (lastTime1 == null || now1 - lastTime1 > intervalTime) { if (lastTime1 == null || now1 - lastTime1 > intervalTime) {
lastNewCoilLogTimeMap.put(coilId, now1); lastNewCoilLogTimeMap.put(coilId, now1);
log.info("【WELDER】检测到新钢卷或初始化 -> CoilId: {}", coilId); log.info("【WELDER】检测到新钢卷或初始化 -> CoilId: {}", coilId);
logDataService.logInfo("WELDER", "检测到新钢卷或初始化 -> CoilId: " + coilId); logDataService.logInfo("WELDER", "Detected new coil or initialized -> CoilId: " + coilId);
} }
} else { } else {
weldDev = entryLengthAtWelder.subtract(weldLength); weldDev = entryLengthAtWelder.subtract(weldLength);
@@ -122,7 +122,7 @@ public class SegmentTrackerService {
listSegment.addLast(newSeg); listSegment.addLast(newSeg);
if (listSegment.size() > MAX_SEG_COUNT) listSegment.removeFirst(); if (listSegment.size() > MAX_SEG_COUNT) listSegment.removeFirst();
log.info("【TRACK】新段生成 -> CoilId: {}, SegmentNo: {}, StartLen: {}", coilId, coilSegNum, entryLengthAtWelder); log.info("【TRACK】新段生成 -> CoilId: {}, SegmentNo: {}, StartLen: {}", coilId, coilSegNum, entryLengthAtWelder);
logDataService.logInfo("WELDER", "新段生成 -> CoilId: " + coilId + ", SegmentNo: " + coilSegNum + ", StartLen: " + entryLengthAtWelder); logDataService.logInfo("WELDER", "New segment created -> CoilId: " + coilId + ", SegmentNo: " + coilSegNum + ", StartLen: " + entryLengthAtWelder);
coilSegNum++; coilSegNum++;
} }
@@ -132,7 +132,7 @@ public class SegmentTrackerService {
// 5. 完成日志 // 5. 完成日志
log.info("【TRACK-END】CoilId: {}, 当前长度: {}, 已生成段数: {}", coilId, entryLengthAtWelder, coilSegNum); log.info("【TRACK-END】CoilId: {}, 当前长度: {}, 已生成段数: {}", coilId, entryLengthAtWelder, coilSegNum);
logDataService.logInfo("TRACK", "处理完成 -> CoilId: " + coilId + ", 当前长度: " + entryLengthAtWelder + ", 已生成段数: " + coilSegNum); logDataService.logInfo("TRACK", "Process completed -> CoilId: " + coilId + ", CurrentLength: " + entryLengthAtWelder + ", SegmentCount: " + coilSegNum);
} }
@@ -158,7 +158,7 @@ public class SegmentTrackerService {
// === 【处理开始日志】=== // === 【处理开始日志】===
log.info("【TRACK-TREAT】开始处理段数据共 {} 段weldDev={}celLength = {}cxlLength = {}。 ", listSegment.size(), weldDev, celLength, cxlLength); log.info("【TRACK-TREAT】开始处理段数据共 {} 段weldDev={}celLength = {}cxlLength = {}。 ", listSegment.size(), weldDev, celLength, cxlLength);
logDataService.logInfo("TRACK", "开始处理段数据,共 " + listSegment.size() + " 段,weldDev=" + weldDev); logDataService.logInfo("TRACK", "Start processing segments: count=" + listSegment.size() + ", weldDev=" + weldDev);
Iterator<SegmentDTO> iterator = listSegment.descendingIterator(); Iterator<SegmentDTO> iterator = listSegment.descendingIterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -186,12 +186,12 @@ public class SegmentTrackerService {
log.info("【TRACK-TREAT】段 {} 进入设备区域 [{}],当前设备长度:{}", segment.getSegNo(), device.name(), currentDevicePos); log.info("【TRACK-TREAT】段 {} 进入设备区域 [{}],当前设备长度:{}", segment.getSegNo(), device.name(), currentDevicePos);
logDataService.logInfo("TRACK", logDataService.logInfo("TRACK",
" " + segment.getSegNo() + " 进入设备区域 [" + device.name() + "],当前设备长度:" + currentDevicePos); "Segment " + segment.getSegNo() + " entered device area [" + device.name() + "], devicePos=" + currentDevicePos);
double currentSpeed = getSpeedForDevice(device, entry, coat, exit); double currentSpeed = getSpeedForDevice(device, entry, coat, exit);
if (currentSpeed > LOWSPEEDLIMIT) { if (currentSpeed > LOWSPEEDLIMIT) {
log.info("【TRACK-TREAT】段 {} 速度大于基准速度, 进入设备区域 [{}],当前速度:{}", segment.getSegNo(), device.name(), currentSpeed); log.info("【TRACK-TREAT】段 {} 速度大于基准速度, 进入设备区域 [{}],当前速度:{}", segment.getSegNo(), device.name(), currentSpeed);
logDataService.logInfo("TRACK", logDataService.logInfo("TRACK",
" " + segment.getSegNo() + " 进入设备区域 [" + device.name() + "],当前速度:" + currentSpeed); "Segment " + segment.getSegNo() + " entered device area [" + device.name() + "], speed=" + currentSpeed);
for (String fieldName : device.getParamFields()) { for (String fieldName : device.getParamFields()) {
Object message = getMessageForDevice(device, entry, furnace, coat, exit); Object message = getMessageForDevice(device, entry, furnace, coat, exit);
if (message != null) { if (message != null) {
@@ -209,7 +209,7 @@ public class SegmentTrackerService {
log.info("【TRACK-END】钢卷 {} 的段号 {} 已离开产线,开始持久化数据{}。", log.info("【TRACK-END】钢卷 {} 的段号 {} 已离开产线,开始持久化数据{}。",
segment.getEnCoilID(), segment.getSegNo(), JSONUtil.toJsonStr(segment.getTotalValues())); segment.getEnCoilID(), segment.getSegNo(), JSONUtil.toJsonStr(segment.getTotalValues()));
logDataService.logInfo("SEGMENT", logDataService.logInfo("SEGMENT",
"钢卷 " + segment.getEnCoilID() + " 的段号 " + segment.getSegNo() + " 已离开产线,开始持久化数据。"); "Coil " + segment.getEnCoilID() + " segment " + segment.getSegNo() + " left the line, start persisting data.");
segmentService.saveTotalSegment(segment); // 调用服务进行持久化 segmentService.saveTotalSegment(segment); // 调用服务进行持久化
iterator.remove(); iterator.remove();
} }
@@ -384,7 +384,7 @@ public class SegmentTrackerService {
} }
if (LogRateLimiter.shouldLog("TRACK:" + coilId, 5000)) { if (LogRateLimiter.shouldLog("TRACK:" + coilId, 5000)) {
logDataService.logInfo("MATMAP-TRACK", "构建的本地matmap缓存为=" + JSONUtil.toJsonStr(prevReached) + " ..."); logDataService.logInfo("MATMAP-TRACK", "Built local matmap cache=" + JSONUtil.toJsonStr(prevReached) + " ...");
} }
BigDecimal celLength = entry != null ? entry.getCelLength() : BigDecimal.ZERO; BigDecimal celLength = entry != null ? entry.getCelLength() : BigDecimal.ZERO;
@@ -400,7 +400,7 @@ public class SegmentTrackerService {
MatmapUtil.setMatId(d.getIdx(), coilId,matmap.getPlanId()); MatmapUtil.setMatId(d.getIdx(), coilId,matmap.getPlanId());
if (d == DeviceEnum.WELDER) { if (d == DeviceEnum.WELDER) {
logDataService.logInfo("MATMAP-TRACK", "钢卷到达焊机,更新钢卷计划状态coil=" + coilId + "当前长度为:" + headPos); logDataService.logInfo("MATMAP-TRACK", "Coil reached welder, update plan status. coil=" + coilId + ", headPos=" + headPos);
log.info("matmap.planid={},coilid={}", matmap.getPlanId(), coilId); log.info("matmap.planid={},coilid={}", matmap.getPlanId(), coilId);
trackService.l1OperateMat(L1OperateMatForm.builder() trackService.l1OperateMat(L1OperateMatForm.builder()
.entryMatId(coilId) .entryMatId(coilId)
@@ -409,7 +409,7 @@ public class SegmentTrackerService {
.operation(L1OperateMatEnum.PRODUCING) .operation(L1OperateMatEnum.PRODUCING)
.build()); .build());
} else { } else {
logDataService.logInfo("MATMAP-TRACK", "钢卷:" + coilId + "到达设备:" + d.getDesc() + "当前长度为:" + headPos); logDataService.logInfo("MATMAP-TRACK", "Coil " + coilId + " reached device: " + d.getDesc() + ", headPos=" + headPos);
proMatmapService.flushMatmap(); proMatmapService.flushMatmap();
WebSocketUtil.sendMatmapMsg(); WebSocketUtil.sendMatmapMsg();
} }