【修改代码】
This commit is contained in:
parent
4aa811614d
commit
82454b4e01
@ -113,7 +113,7 @@ func sectionMapToEcsLink(repo *repository.Repository, id string, offset int64, r
|
|||||||
abDirection = ak > bk
|
abDirection = ak > bk
|
||||||
}
|
}
|
||||||
linkId, _ := strconv.Atoi(section.ALinkPosition().Link().Identity.Id())
|
linkId, _ := strconv.Atoi(section.ALinkPosition().Link().Identity.Id())
|
||||||
trainKilometer := concertTrainKilometer(section.AKilometer().Value, offset, up)
|
trainKilometer := concertTrainKilometer(ak, offset, up)
|
||||||
if abDirection {
|
if abDirection {
|
||||||
return int32(linkId), ao + offset, up, abDirection, trainKilometer
|
return int32(linkId), ao + offset, up, abDirection, trainKilometer
|
||||||
} else {
|
} else {
|
||||||
@ -243,7 +243,7 @@ func ecsLinkMapToSection(offset int64, up bool, link *repository.Link) (
|
|||||||
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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user