【列车位置处理逻辑】
This commit is contained in:
parent
035daffb3b
commit
a82728e09e
@ -291,7 +291,7 @@ func ecsLinkMapToSection(repo *repository.Repository, offset int64, up bool, lin
|
|||||||
var section *repository.PhysicalSection
|
var section *repository.PhysicalSection
|
||||||
for _, s := range link.PhysicalSections() {
|
for _, s := range link.PhysicalSections() {
|
||||||
ao, bo := s.ALinkPosition().Offset(), s.BLinkPosition().Offset()
|
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
|
section = s
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@ package memory
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"joylink.club/rtsssimulation/component"
|
|
||||||
"joylink.club/rtsssimulation/entity"
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"math"
|
"math"
|
||||||
"sort"
|
"sort"
|
||||||
@ -12,6 +10,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"joylink.club/rtsssimulation/component"
|
||||||
|
"joylink.club/rtsssimulation/entity"
|
||||||
|
|
||||||
rtss_simulation "joylink.club/rtsssimulation"
|
rtss_simulation "joylink.club/rtsssimulation"
|
||||||
|
|
||||||
"joylink.club/bj-rtsts-server/ats/verify/protos/graphicData"
|
"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) {
|
func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphicStorage, mapId int32) {
|
||||||
|
repo.MainCoordinateSystem = storage.UniqueIdPrefix.MainCoordinateSystem
|
||||||
axleCountingMap := make(map[string]*graphicData.AxleCounting)
|
axleCountingMap := make(map[string]*graphicData.AxleCounting)
|
||||||
uidsMap := queryUidStructure[*stationUidStructure](mapId)
|
uidsMap := queryUidStructure[*stationUidStructure](mapId)
|
||||||
for _, data := range storage.AxleCountings {
|
for _, data := range storage.AxleCountings {
|
||||||
|
Loading…
Reference in New Issue
Block a user