From 23c1b2dc6e8612172650a7d6d8aa1bb1b1c79fb5 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Fri, 20 Oct 2023 09:14:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ats/verify/simulation/wayside/memory/wayside_simulation.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index c15b065..24a3484 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -656,6 +656,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi Km: convertKm(data.KilometerSystem), SectionId: sectionId, TurnoutPort: turnoutPort, + Mt: int32(data.Mt), } repo.Signals = append(repo.Signals, converSignalUid(signal, uidsMap)) } From 4d7a2ee67074b3f05cdd36afff697ee208ac9495 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Fri, 20 Oct 2023 09:38:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wayside/memory/wayside_simulation.go | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index 7288d28..628491a 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -658,7 +658,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi Km: convertKm(data.KilometerSystem), SectionId: sectionId, TurnoutPort: turnoutPort, - Mt: int32(data.Mt), + Model: convertToProtoSignalModel(data.Mt), } repo.Signals = append(repo.Signals, converSignalUid(signal, uidsMap)) } @@ -1085,3 +1085,22 @@ func initWorldPhysicalSectionState(status *VerifyStatus, repo *repository.Reposi status.PhysicalSectionStateMap.Store(id, &state.SectionState{Id: id, Occupied: false, Type: state.SectionType_Physic}) } } + +func convertToProtoSignalModel(gSmt graphicData.Signal_Model) proto.Signal_Model { + switch gSmt { + case graphicData.Signal_HLU: + return proto.Signal_HLU + case graphicData.Signal_HL: + return proto.Signal_HL + case graphicData.Signal_HLU_FU: + return proto.Signal_HLU_FU + case graphicData.Signal_HLU_FL: + return proto.Signal_HLU_FL + case graphicData.Signal_AB: + return proto.Signal_AB + case graphicData.Signal_HBU: + return proto.Signal_HBU + default: + panic(fmt.Sprintf("graphicData.Signal_Model[%d]无法映射到proto.Signal_Model", gSmt)) + } +}