From 09e1ad68f903265567147c8f315354a8739c55c3 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Thu, 23 Nov 2023 13:30:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=AD=94=E5=99=A8=E5=AE=9E=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wayside/memory/wayside_simulation.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ts/simulation/wayside/memory/wayside_simulation.go b/ts/simulation/wayside/memory/wayside_simulation.go index 92eac3a..f65e111 100644 --- a/ts/simulation/wayside/memory/wayside_simulation.go +++ b/ts/simulation/wayside/memory/wayside_simulation.go @@ -1036,6 +1036,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi SectionId: sectionId, TurnoutPort: turnoutPort, FixedTelegram: data.FixedTelegram, + Type: convertToProtoBaliseType(data.Type), } repo.Transponders = append(repo.Transponders, converTransponderUid(responder, uidsMap)) for _, stationName := range data.CentralizedStations { @@ -1484,3 +1485,19 @@ func convertToProtoSignalModel(gSmt graphicData.Signal_Model) proto.Signal_Model panic(fmt.Sprintf("graphicData.Signal_Model[%d]无法映射到proto.Signal_Model", gSmt)) } } +func convertToProtoBaliseType(bt graphicData.Transponder_TransponderTypeEnum) proto.Transponder_Type { + switch bt { + case graphicData.Transponder_FB: + return proto.Transponder_FB + case graphicData.Transponder_WB: + return proto.Transponder_WB + case graphicData.Transponder_DB: + return proto.Transponder_DB + case graphicData.Transponder_VB: + return proto.Transponder_VB + case graphicData.Transponder_IB: + return proto.Transponder_IB + default: + panic(fmt.Sprintf("graphicData.Transponder_TransponderTypeEnum[%d]无法映射到proto.Transponder_Type", bt)) + } +}