Merge branch 'local-test' into develop

This commit is contained in:
thesai 2024-08-13 11:01:02 +08:00
commit 98310f427b
2 changed files with 30 additions and 28 deletions

View File

@ -205,25 +205,23 @@ func makeTable(sim *memory.VerifySimulation, stationCode string) *StationDeviceI
}
}
}
////计轴区段
//for _, data := range stationGi.LianSuoData.AcSections {
// if data.Index <= 0 {
// continue
// }
// if data.Index == 0 { //这是其它线的区段
// continue
// }
// for _, station := range uids.AxleCountingSectionIds[data.Id].CentralizedStations {
// if station.StationName == stationCode {
// table.AxleSectionMap[uint16(data.Id)] = &Row{
// commonId: data.Id,
// uid: uids.PhysicalSectionIds[data.Id].Uid,
// index: uint16(data.Index),
// relateDeviceMap: nil,
// }
// }
// }
//}
//计轴区段
for _, data := range stationGi.LianSuoData.AcSections {
if data.Index <= 0 {
continue
}
sectionModule := sim.Repo.FindAxleCountingSection(uids.AxleCountingSectionIds[data.Id].Uid)
for _, station := range sectionModule.PhysicalSection().CentralizedStation() {
if station.GetCode() == stationCode {
table.AxleSectionMap[uint16(data.Id)] = &Row{
commonId: data.Id,
uid: uids.AxleCountingSectionIds[data.Id].Uid,
index: uint16(data.Index),
relateDeviceMap: nil,
}
}
}
}
//无人折返实际数据中数量为0
//防淹门实际数据中数量为0
//人员防护
@ -360,10 +358,10 @@ func (s *serviceContext) collectDeviceState() *ToInterlockFrame {
//计轴区段
for _, row := range s.deviceTable.AxleSectionMap {
entry := wd.EntityMap[row.uid]
axleManager := component.PhysicalSectionManagerType.Get(entry)
sectionState := component.AxleCountingSectionStateType.Get(entry)
frame.AxleSectionStates = append(frame.AxleSectionStates, &AxleSectionState{
Id: row.index,
State: GetStateByte(axleManager.Occupied),
State: GetStateByte(sectionState.Occupied),
})
}
//SPKS

View File

@ -1125,19 +1125,23 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic
turnoutUids = append(turnoutUids, uidsMap.TurnoutIds[tid].Uid)
}
}
var centralizedStation string
if len(data.CentralizedStations) > 0 {
s := uidsMap.StationIds[data.CentralizedStations[0]]
if s != nil {
centralizedStation = s.Code
}
var centralizedStationIds []string
for _, station := range uidsMap.PhysicalSectionIds[data.Common.Id].CentralizedStations {
centralizedStationIds = append(centralizedStationIds, uidsMap.StationIds[station.Common.Id].Uid)
}
//var centralizedStation string
//if len(data.CentralizedStations) > 0 {
// s := uidsMap.StationIds[data.CentralizedStations[0]]
// if s != nil {
// centralizedStation = s.Code
// }
//}
physicalSection := &proto.PhysicalSection{
Id: uidsMap.PhysicalSectionIds[GetMapElementId(data.Common)].Uid,
ADevicePort: convertDevicePort(data.PaRef, uidsMap),
BDevicePort: convertDevicePort(data.PbRef, uidsMap),
TurnoutIds: turnoutUids,
CentralizedStation: centralizedStation,
CentralizedStation: centralizedStationIds,
}
repo.PhysicalSections = append(repo.PhysicalSections, physicalSection)
}