diff --git a/ats/verify/simulation/wayside/memory/wayside_memory_map.go b/ats/verify/simulation/wayside/memory/wayside_memory_map.go index 9c274a9..18a7330 100644 --- a/ats/verify/simulation/wayside/memory/wayside_memory_map.go +++ b/ats/verify/simulation/wayside/memory/wayside_memory_map.go @@ -140,6 +140,7 @@ func turnoutMapToEcsLink(repo *repository.Repository, id string, port string, of } // 岔心公里标 crossKm = turnout.GetTurnoutKm(proto2.Port_None) + portKm = repo.ConvertKilometer(portKm, crossKm.CoordinateSystem) // 关联link link := portPosition.Link() isStart := link.ARelation().Device().Id() == id @@ -173,7 +174,7 @@ func QueryDeviceByCalcLink(repo *repository.Repository, id string, offset int64, // 判断是否在道岔上 onTurnout, isA := isOnLinkTurnout(link, offset) if onTurnout { - return ecsLinkMapToTurnout(isA, offset, up, link) + return ecsLinkMapToTurnout(repo, isA, offset, up, link) } else { return ecsLinkMapToSection(offset, up, link) } @@ -198,7 +199,7 @@ func isOnLinkTurnout(link *repository.Link, offset int64) (bool, bool) { } // 处理在道岔上link映射 -func ecsLinkMapToTurnout(isA bool, offset int64, up bool, link *repository.Link) ( +func ecsLinkMapToTurnout(repo *repository.Repository, isA bool, offset int64, up bool, link *repository.Link) ( deviceId, port string, deviceOffset int64, runDirection, pointTo bool, km int64) { tp := link.ARelation() if !isA { @@ -206,7 +207,9 @@ func ecsLinkMapToTurnout(isA bool, offset int64, up bool, link *repository.Link) } deviceId = tp.Turnout().Id() tpOffset := tp.Turnout().FindLinkPositionByPort(tp.Port()).Offset() - crossKm, portKm := tp.Turnout().GetTurnoutKm(proto2.Port_None).Value, tp.Turnout().GetTurnoutKm(tp.Port()).Value + crossKmInfo, portKmInfo := tp.Turnout().GetTurnoutKm(proto2.Port_None), tp.Turnout().GetTurnoutKm(tp.Port()) + portKmInfo = repo.ConvertKilometer(portKmInfo, crossKmInfo.CoordinateSystem) + crossKm, portKm := crossKmInfo.Value, portKmInfo.Value if isA { deviceOffset = tpOffset - (tpOffset - offset) pointTo = !up @@ -217,10 +220,13 @@ func ecsLinkMapToTurnout(isA bool, offset int64, up bool, link *repository.Link) // 查询公里标大于端口公里标 if crossKm > portKm { km = crossKm - deviceOffset - runDirection = pointTo } else { km = crossKm + deviceOffset - runDirection = !pointTo + } + if up { + runDirection = (crossKm > portKm) == !isA + } else { + runDirection = (crossKm < portKm) == !isA } switch tp.Port() { case proto2.Port_A: diff --git a/rtss_simulation b/rtss_simulation index d36ba6f..b8db433 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit d36ba6fc7dfe5235ace72be522566e55aadd34e1 +Subproject commit b8db4336fb78c17fe179b7927929808a5793f0dc