列车动力学添加车组,仿真内添加列车添加车组
This commit is contained in:
parent
150aa24307
commit
2f7e505437
@ -88,6 +88,7 @@ message StopPosition{
|
||||
Kilometer km = 4;
|
||||
string sectionId = 5; //关联的区段
|
||||
DevicePort turnoutPort = 6; //关联的区段端口
|
||||
uint32 coachNum = 7;//列车编组信息
|
||||
}
|
||||
// 信号布置数据
|
||||
message SignalLayout {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -68,9 +68,9 @@ func buildModels(source *proto.Repository, repository *Repository) error {
|
||||
repository.stationMap[m.Id()] = m
|
||||
}
|
||||
for _, sp := range source.StopPosition {
|
||||
calibrationKilometer(sp.Km, repository)
|
||||
//calibrationKilometer(sp.Km, repository)
|
||||
tid := strconv.Itoa(int(sp.Id))
|
||||
t := NewStopPosition(tid, sp.Km)
|
||||
t := NewStopPosition(tid, sp.Km, sp.CoachNum)
|
||||
repository.StopPosition[tid] = t
|
||||
}
|
||||
for _, protoData := range source.PhysicalSections {
|
||||
@ -1043,6 +1043,9 @@ func relateDevicesAndLink(repo *Repository, link *Link, startKm *proto.Kilometer
|
||||
if visitedModelMap[device.Id()] {
|
||||
continue
|
||||
}
|
||||
if device.Id() == "508" {
|
||||
fmt.Println("aaaaaaaaaaaaaaaaa")
|
||||
}
|
||||
linkPositionDevice, ok := device.(LinkPositionDevice)
|
||||
if !ok {
|
||||
return fmt.Errorf("device [%s:%s] not implements LinkPositionDevice", device.Id(), device.Type().String())
|
||||
|
@ -9,12 +9,13 @@ type StopPosition struct {
|
||||
dir proto.Platform_Direction
|
||||
km *proto.Kilometer
|
||||
linkPosition LinkPosition
|
||||
coachNum uint32
|
||||
}
|
||||
|
||||
func NewStopPosition(id string, km *proto.Kilometer) *StopPosition {
|
||||
func NewStopPosition(id string, km *proto.Kilometer, coachNum uint32) *StopPosition {
|
||||
return &StopPosition{
|
||||
Identity: identity{id, proto.DeviceType_deviceType_Stop_position},
|
||||
km: km,
|
||||
km: km, coachNum: coachNum,
|
||||
}
|
||||
}
|
||||
func (t *StopPosition) bindLinkPosition(position LinkPosition) {
|
||||
@ -23,3 +24,6 @@ func (t *StopPosition) bindLinkPosition(position LinkPosition) {
|
||||
func (t *StopPosition) LinkPosition() LinkPosition {
|
||||
return t.linkPosition
|
||||
}
|
||||
func (t *StopPosition) CoachNum() int32 {
|
||||
return int32(t.coachNum)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user