信号机模型类型

This commit is contained in:
xzb 2023-10-20 09:41:49 +08:00
parent 5d85a92dc4
commit 4e26ee104f
2 changed files with 4 additions and 2 deletions

View File

@ -64,7 +64,7 @@ func buildModels(source *proto.Repository, repository *Repository) {
repository.turnoutMap[m.Id()] = m
}
for _, protoData := range source.Signals {
m := NewSignal(protoData.Id, protoData.Km, protoData.Code)
m := NewSignal(protoData.Id, protoData.Km, protoData.Code, protoData.Model)
repository.signalMap[m.Id()] = m
}
for _, protoData := range source.Transponders {

View File

@ -11,13 +11,15 @@ type Signal struct {
linkPosition *LinkPosition
//信号机电路系统电子元器件
componentGroups []*ElectronicComponentGroup
model proto.Signal_Model
}
func NewSignal(id string, km *proto.Kilometer, code string) *Signal {
func NewSignal(id string, km *proto.Kilometer, code string, model proto.Signal_Model) *Signal {
return &Signal{
Identity: identity{id, proto.DeviceType_DeviceType_Signal},
km: km,
code: code,
model: model,
}
}