diff --git a/proto/src/model.proto b/proto/src/model.proto index 87563b2..c3f19a4 100644 --- a/proto/src/model.proto +++ b/proto/src/model.proto @@ -98,8 +98,8 @@ message PhysicalSection { repeated string turnoutIds = 2; //道岔物理区段关联的道岔 DevicePort aDevicePort = 3; //非道岔物理区段A端关联的设备端口 DevicePort bDevicePort = 4; - //物理区段所属集中站 - string centralizedStation = 5; + //物理区段所属集中站uid + repeated string centralizedStation = 5; repeated ElectronicComponentGroup electronicComponentGroups = 6; } diff --git a/repository/model/proto/model.pb.go b/repository/model/proto/model.pb.go index d6366c8..a7afeeb 100644 --- a/repository/model/proto/model.pb.go +++ b/repository/model/proto/model.pb.go @@ -1872,8 +1872,8 @@ type PhysicalSection struct { TurnoutIds []string `protobuf:"bytes,2,rep,name=turnoutIds,proto3" json:"turnoutIds,omitempty"` //道岔物理区段关联的道岔 ADevicePort *DevicePort `protobuf:"bytes,3,opt,name=aDevicePort,proto3" json:"aDevicePort,omitempty"` //非道岔物理区段A端关联的设备端口 BDevicePort *DevicePort `protobuf:"bytes,4,opt,name=bDevicePort,proto3" json:"bDevicePort,omitempty"` - // 物理区段所属集中站 - CentralizedStation string `protobuf:"bytes,5,opt,name=centralizedStation,proto3" json:"centralizedStation,omitempty"` + // 物理区段所属集中站uid + CentralizedStation []string `protobuf:"bytes,5,rep,name=centralizedStation,proto3" json:"centralizedStation,omitempty"` ElectronicComponentGroups []*ElectronicComponentGroup `protobuf:"bytes,6,rep,name=electronicComponentGroups,proto3" json:"electronicComponentGroups,omitempty"` } @@ -1937,11 +1937,11 @@ func (x *PhysicalSection) GetBDevicePort() *DevicePort { return nil } -func (x *PhysicalSection) GetCentralizedStation() string { +func (x *PhysicalSection) GetCentralizedStation() []string { if x != nil { return x.CentralizedStation } - return "" + return nil } func (x *PhysicalSection) GetElectronicComponentGroups() []*ElectronicComponentGroup { @@ -6195,7 +6195,7 @@ var file_model_proto_rawDesc = []byte{ 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x0b, 0x62, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x7a, 0x65, - 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, + 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5d, 0x0a, 0x19, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x72, 0x6f, 0x6e, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, diff --git a/repository/physical_section.go b/repository/physical_section.go index c756795..76c7cee 100644 --- a/repository/physical_section.go +++ b/repository/physical_section.go @@ -33,8 +33,8 @@ type PhysicalSection struct { //在Link上的区间(start小于end) linkRanges []*LinkRange - //物理区段所属集中站编号(code) - centralizedStation string + //物理区段所属集中站uid + centralizedStation []*Station // 所属站台 platform *Platform @@ -109,7 +109,7 @@ func (p *PhysicalSection) IsAxleSection() (bool, error) { return false, fmt.Errorf("物理区段没有检测点") } } -func (p *PhysicalSection) CentralizedStation() string { +func (p *PhysicalSection) CentralizedStation() []*Station { return p.centralizedStation } func (p *PhysicalSection) bindDevicePort(port proto.Port, devicePort DevicePort) error { diff --git a/repository/repository_manager.go b/repository/repository_manager.go index 13d253e..872aab0 100644 --- a/repository/repository_manager.go +++ b/repository/repository_manager.go @@ -700,7 +700,9 @@ func buildPhysicalSectionRelationShip(source *proto.Repository, repo *Repository turnout.section = section } //关联联锁集中站 - section.centralizedStation = protoData.CentralizedStation + for _, stationId := range protoData.CentralizedStation { + section.centralizedStation = append(section.centralizedStation, repo.stationMap[stationId]) + } //关联电子元件 for _, group := range protoData.ElectronicComponentGroups { var components []IGroupedElectronicComponent