【列车位置处理逻辑】

This commit is contained in:
weizhihong 2023-10-19 18:04:21 +08:00
parent 035daffb3b
commit a82728e09e
2 changed files with 5 additions and 3 deletions

View File

@ -291,7 +291,7 @@ func ecsLinkMapToSection(repo *repository.Repository, offset int64, up bool, lin
var section *repository.PhysicalSection
for _, s := range link.PhysicalSections() {
ao, bo := s.ALinkPosition().Offset(), s.BLinkPosition().Offset()
if (ao <= offset && offset < bo) || (bo <= offset && offset < ao) {
if (ao < offset && offset <= bo) || (bo < offset && offset <= ao) {
section = s
break
}

View File

@ -2,8 +2,6 @@ package memory
import (
"fmt"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
"log/slog"
"math"
"sort"
@ -12,6 +10,9 @@ import (
"sync"
"time"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
rtss_simulation "joylink.club/rtsssimulation"
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
@ -588,6 +589,7 @@ func convertRelayModel(modelType graphicData.Relay_ModelType) proto.Relay_Model
}
func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphicStorage, mapId int32) {
repo.MainCoordinateSystem = storage.UniqueIdPrefix.MainCoordinateSystem
axleCountingMap := make(map[string]*graphicData.AxleCounting)
uidsMap := queryUidStructure[*stationUidStructure](mapId)
for _, data := range storage.AxleCountings {