This commit is contained in:
weizhihong 2023-10-20 10:59:34 +08:00
commit 0c9816a1ce

View File

@ -658,6 +658,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi
Km: convertKm(data.KilometerSystem), Km: convertKm(data.KilometerSystem),
SectionId: sectionId, SectionId: sectionId,
TurnoutPort: turnoutPort, TurnoutPort: turnoutPort,
Model: convertToProtoSignalModel(data.Mt),
} }
repo.Signals = append(repo.Signals, converSignalUid(signal, uidsMap)) 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}) 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))
}
}