diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index 107e9f7..7de74ea 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -658,6 +658,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi Km: convertKm(data.KilometerSystem), SectionId: sectionId, TurnoutPort: turnoutPort, + Model: convertToProtoSignalModel(data.Mt), } repo.Signals = append(repo.Signals, converSignalUid(signal, uidsMap)) } @@ -1092,3 +1093,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)) + } +}