This commit is contained in:
xzb 2023-11-06 14:35:33 +08:00
parent 0a73d0b899
commit 3fcb286e05
1 changed files with 3 additions and 4 deletions

View File

@ -144,12 +144,11 @@ func handlerSectionState(w ecs.World, uid string) *state.SectionState {
//fmt.Printf("id=%s的信号机不存在", uid)
return nil
}
if entry.HasComponent(component.AxleSectionType) { //计轴区段
if entry.HasComponent(component.PhysicalSectionStateType) { //计轴区段
sectionState := &state.SectionState{}
axleState := component.AxleSectionType.Get(entry)
sectionFault := component.AxleSectionFaultType.Get(entry)
axleState := component.PhysicalSectionStateType.Get(entry)
sectionState.Occupied = axleState.Occ
sectionState.AxleFault = sectionFault.SectionFault
sectionState.AxleFault = entry.HasComponent(component.AxleSectionFaultTag)
return sectionState
}
return nil