This commit is contained in:
walker 2023-11-09 14:26:12 +08:00
commit d8efe7c24c
2 changed files with 24 additions and 0 deletions

View File

@ -71,6 +71,21 @@ func (repo *Repository) FindById(id string) Identity {
if md, ok := repo.relayMap[id]; ok {
return md
}
if md, ok := repo.physicalSectionMap[id]; ok {
return md
}
if md, ok := repo.checkPointMap[id]; ok {
return md
}
if md, ok := repo.responderMap[id]; ok {
return md
}
if md, ok := repo.stationMap[id]; ok {
return md
}
if md, ok := repo.platformMap[id]; ok {
return md
}
return nil
}

View File

@ -3,6 +3,7 @@ package repository
import (
"errors"
"fmt"
"joylink.club/rtsssimulation/repository/model/proto"
)
@ -278,6 +279,14 @@ func (t *Turnout) FindRelay(groupCode, relayCode string) *Relay {
return nil
}
func (t *Turnout) GetPhysicalSection() *PhysicalSection {
return t.section
}
func (t *Turnout) GindDevicePortByPort(port proto.Port) DevicePort {
return t.findDevicePortByPort(port)
}
type TurnoutPort struct {
turnout *Turnout
port proto.Port