From 43cd1bffb0e7e8219b194a56f55426fac29479d2 Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Wed, 19 Jul 2023 15:24:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=97occ=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E8=AE=BE=E5=A4=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ats/message/line3/rep/DeviceStatusBitmapResponse.java | 4 ++++ .../ats/message/line3/rep/DeviceStatusChangeResponse.java | 2 ++ .../ats/message/line3/rep/TrainIndicationInitResponse.java | 3 +++ .../ats/message/line3/rep/TrainIndicationRemoveResponse.java | 2 ++ .../ats/message/line3/rep/TrainIndicationUpdateResponse.java | 3 +++ 5 files changed, 14 insertions(+) diff --git a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/DeviceStatusBitmapResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/DeviceStatusBitmapResponse.java index 7d6cd63..ba4867d 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/DeviceStatusBitmapResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/DeviceStatusBitmapResponse.java @@ -2,6 +2,7 @@ package club.joylink.xiannccda.ats.message.line3.rep; import club.joylink.xiannccda.ats.message.MessageResponse; import club.joylink.xiannccda.ats.message.convertor.DeviceStatusConvertor; +import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage; import club.joylink.xiannccda.ats.message.line3.device.DeviceStatus; import club.joylink.xiannccda.ats.message.line3.device.DeviceType; import club.joylink.xiannccda.ats.message.line3.rep.EntityParseUtil.ReadData; @@ -116,6 +117,9 @@ public class DeviceStatusBitmapResponse extends MessageResponse { entity.type = DeviceType.of(buf.readShort()); entity.objCount = buf.readShort(); entity.deviceList = EntityParseUtil.collect(entity.objCount, buf, DeviceEntity.class); + for (DeviceEntity de : entity.deviceList) { + de.devName = DeviceNameChangerManage.findMatch(entity.type, de.devName); + } return entity; } } diff --git a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/DeviceStatusChangeResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/DeviceStatusChangeResponse.java index fad679e..570144d 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/DeviceStatusChangeResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/DeviceStatusChangeResponse.java @@ -3,6 +3,7 @@ package club.joylink.xiannccda.ats.message.line3.rep; import club.joylink.xiannccda.ats.message.MessageId; import club.joylink.xiannccda.ats.message.MessageResponse; import club.joylink.xiannccda.ats.message.convertor.DeviceStatusConvertor; +import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage; import club.joylink.xiannccda.ats.message.line3.device.DeviceStatus; import club.joylink.xiannccda.ats.message.line3.device.DeviceType; import club.joylink.xiannccda.dto.protos.DeviceStatusProto; @@ -81,6 +82,7 @@ public class DeviceStatusChangeResponse extends MessageResponse { this.devName = EntityParseUtil.convertStr(buf, 24); this.deviceStatus = buf.readInt(); this.spare = buf.readInt(); + this.devName = DeviceNameChangerManage.findMatch(this.type, this.devName); } @Override diff --git a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationInitResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationInitResponse.java index e8dd8dc..5ec4005 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationInitResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationInitResponse.java @@ -4,6 +4,7 @@ import club.joylink.xiannccda.ats.message.MessageResponse; import club.joylink.xiannccda.ats.message.convertor.DeviceStatusConvertor; import club.joylink.xiannccda.ats.message.line3.DateTimeUtil; import club.joylink.xiannccda.ats.message.line3.MessageCons; +import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage; import club.joylink.xiannccda.ats.message.line3.device.DeviceStatus; import club.joylink.xiannccda.ats.message.line3.device.DeviceType; import club.joylink.xiannccda.dto.protos.DeviceStatusProto; @@ -223,6 +224,8 @@ public class TrainIndicationInitResponse extends MessageResponse { // this.devType = DeviceType.of(devType); this.devName = new String(devName, MessageCons.STRING_CHARSET).trim(); + + this.devName = DeviceNameChangerManage.findMatch(this.devType, this.devName); this.trainIndex = new String(trainIndex, MessageCons.STRING_CHARSET).trim(); this.groupId = new String(groupId, MessageCons.STRING_CHARSET).trim(); this.trainId = new String(trainId, MessageCons.STRING_CHARSET).trim(); diff --git a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationRemoveResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationRemoveResponse.java index b2da0b5..83f2353 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationRemoveResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationRemoveResponse.java @@ -2,6 +2,7 @@ package club.joylink.xiannccda.ats.message.line3.rep; import club.joylink.xiannccda.ats.message.MessageResponse; import club.joylink.xiannccda.ats.message.line3.MessageCons; +import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage; import club.joylink.xiannccda.ats.message.line3.device.DeviceType; import club.joylink.xiannccda.dto.protos.DeviceStatusProto; import club.joylink.xiannccda.dto.protos.TrainProto.NccWindow; @@ -72,6 +73,7 @@ public class TrainIndicationRemoveResponse extends MessageResponse { // this.devType = DeviceType.of(devType); this.devName = new String(devName, MessageCons.STRING_CHARSET).trim(); + this.devName = DeviceNameChangerManage.findMatch(this.devType, this.devName); this.trainIndex = new String(trainIndex, MessageCons.STRING_CHARSET).trim(); this.groupId = new String(groupId, MessageCons.STRING_CHARSET).trim(); } diff --git a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationUpdateResponse.java b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationUpdateResponse.java index f5ef2f8..f1c9a01 100644 --- a/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationUpdateResponse.java +++ b/src/main/java/club/joylink/xiannccda/ats/message/line3/rep/TrainIndicationUpdateResponse.java @@ -4,6 +4,7 @@ import club.joylink.xiannccda.ats.message.MessageResponse; import club.joylink.xiannccda.ats.message.convertor.DeviceStatusConvertor; import club.joylink.xiannccda.ats.message.line3.DateTimeUtil; import club.joylink.xiannccda.ats.message.line3.MessageCons; +import club.joylink.xiannccda.ats.message.line3.changer.DeviceNameChangerManage; import club.joylink.xiannccda.ats.message.line3.device.DeviceStatus; import club.joylink.xiannccda.ats.message.line3.device.DeviceType; import club.joylink.xiannccda.dto.protos.DeviceStatusProto; @@ -211,6 +212,8 @@ public class TrainIndicationUpdateResponse extends MessageResponse { // this.devType = DeviceType.of(devType); this.devName = new String(devName, MessageCons.STRING_CHARSET).trim(); + + this.devName = DeviceNameChangerManage.findMatch(this.devType, this.devName); this.trainIndex = new String(trainIndex, MessageCons.STRING_CHARSET).trim(); this.groupId = new String(groupId, MessageCons.STRING_CHARSET).trim(); this.trainId = new String(trainId, MessageCons.STRING_CHARSET).trim();