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)) + } +}