[修改]11号线联锁通信,区段状态从物理区段改为计轴区段

This commit is contained in:
thesai 2024-08-13 11:00:26 +08:00
parent 73e7f83cfa
commit 12df28cc37
4 changed files with 13 additions and 11 deletions

View File

@ -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;
}

View File

@ -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,

View File

@ -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 {

View File

@ -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