This commit is contained in:
walker 2023-11-07 14:37:17 +08:00
commit a5d0ae994d
7 changed files with 310 additions and 85 deletions

View File

@ -19,6 +19,8 @@ type PsdCircuit struct {
//屏蔽门表示继电器 //屏蔽门表示继电器
MGJ *ecs.Entry MGJ *ecs.Entry
MPLJ *ecs.Entry MPLJ *ecs.Entry
//一些不知道如何使用的继电器,为了使得采集、驱动逻辑正常,先构建出来
UnusedJ []*ecs.Entry
} }
var PsdInterlockDriveCircuitType = ecs.NewComponentType[PsdInterlockDriveCircuit]() var PsdInterlockDriveCircuitType = ecs.NewComponentType[PsdInterlockDriveCircuit]()

View File

@ -59,6 +59,8 @@ func loadPsdCircuit(world ecs.World, entry *ecs.Entry, psd *repository.Psd, entr
circuit.MGJ = NewRelayEntity(world, relay, entryMap) circuit.MGJ = NewRelayEntity(world, relay, entryMap)
case "XMPLJ", "SMPLJ": case "XMPLJ", "SMPLJ":
circuit.MPLJ = NewRelayEntity(world, relay, entryMap) circuit.MPLJ = NewRelayEntity(world, relay, entryMap)
default:
circuit.UnusedJ = append(circuit.UnusedJ, NewRelayEntity(world, relay, entryMap))
} }
} }
} }

View File

@ -5,6 +5,7 @@ import (
"joylink.club/ecs" "joylink.club/ecs"
"joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity" "joylink.club/rtsssimulation/entity"
"strings"
) )
// AxleSectionDrstDrive 计轴直接复位操作 // AxleSectionDrstDrive 计轴直接复位操作
@ -122,3 +123,103 @@ func AxleSectionTrainDrive(w ecs.World, sectionId string, trainIn bool) error {
}) })
return r.Err return r.Err
} }
// FindAxleSectionsStatus 获取计轴区段的相关状态
func FindAxleSectionsStatus(w ecs.World, sectionIds []string) ([]*AxleSectionState, error) {
r := <-ecs.Request[[]*AxleSectionState](w, func() ecs.Result[[]*AxleSectionState] {
wd := entity.GetWorldData(w)
var msg []*AxleSectionState
var esb = strings.Builder{} //收集未找到的区段的id
for _, sectionId := range sectionIds {
find := false
sectionModel := wd.Repo.FindPhysicalSection(sectionId)
if sectionModel != nil {
faDcAxleDeviceEntry := entity.FindAxleManageDevice(wd, sectionModel.CentralizedStation())
if faDcAxleDeviceEntry != nil {
faDcAxleDevice := component.AxleManageDeviceType.Get(faDcAxleDeviceEntry)
axleDevice := faDcAxleDevice.FindAdr(sectionId)
if axleDevice != nil {
sectionEntry, _ := entity.GetEntityByUid(w, sectionId)
if sectionEntry != nil {
if sectionEntry.HasComponent(component.AxlePhysicalSectionType) { //计轴物理区段实体
as := &AxleSectionState{}
state := component.PhysicalSectionStateType.Get(sectionEntry)
as.Clr = !state.Occ
as.Occ = state.Occ
as.Rac = axleDevice.Rac
as.Rjt = axleDevice.Rjt
as.Rjo = axleDevice.Rjo
//
msg = append(msg, as)
find = true
}
}
}
}
}
//
if !find {
esb.WriteString(fmt.Sprintf("%s,", sectionId))
}
} //for
if esb.Len() > 0 {
return ecs.NewResult(msg, fmt.Errorf("区段非计轴区段或计轴区段状态不存在:[%s]", esb.String()))
} else {
return ecs.NewResult(msg, nil)
}
})
return r.Val, r.Err
}
type AxleSectionState struct {
//0-bit7 计轴出清
Clr bool
//0-bit6 计轴占用
Occ bool
//1-bit6 计轴复位反馈
Rac bool
//1-bit5 运营原因拒绝计轴复位
Rjo bool
//1-bit4 技术原因拒绝计轴复位
Rjt bool
}
// AxleSectionRstDrive 复位(直接复位、预复位)
func AxleSectionRstDrive(w ecs.World, cmds []*AxleSectionCmd) error {
r := <-ecs.Request[ecs.EmptyType](w, func() ecs.Result[ecs.EmptyType] {
wd := entity.GetWorldData(w)
var esb = strings.Builder{} //收集未找到的区段的id
find := false
for _, cmd := range cmds {
sectionId := cmd.SectionId
sectionModel := wd.Repo.FindPhysicalSection(sectionId)
if sectionModel != nil {
faDcAxleDeviceEntry := entity.FindAxleManageDevice(wd, sectionModel.CentralizedStation())
if faDcAxleDeviceEntry != nil {
faDcAxleDevice := component.AxleManageDeviceType.Get(faDcAxleDeviceEntry)
axleRuntime := faDcAxleDevice.FindAdr(sectionId)
if axleRuntime != nil {
axleRuntime.Pdrst = cmd.Pdrst
axleRuntime.Drst = cmd.Drst
find = true
}
}
}
if !find {
esb.WriteString(fmt.Sprintf("%s,", sectionId))
}
} //for
if esb.Len() > 0 {
return ecs.NewErrResult(fmt.Errorf("计轴区段复位操作,失败列表[%s]", esb.String()))
} else {
return ecs.NewOkEmptyResult()
}
})
return r.Err
}
type AxleSectionCmd struct {
SectionId string
Drst bool
Pdrst bool
}

View File

@ -318,6 +318,8 @@ message CentralizedStationRef {
repeated CjData cjList = 3; // repeated CjData cjList = 3; //
repeated QdData qdList = 4; // repeated QdData qdList = 4; //
repeated CiSectionCodePoint sectionCodePoints = 5;//
} }
message CjData { message CjData {
@ -343,3 +345,9 @@ message AsdGroup {
int32 start = 2; // int32 start = 2; //
int32 end = 3; // int32 end = 3; //
} }
//
message CiSectionCodePoint{
int32 row = 1;//
string sectionId = 2;//id
}

View File

@ -2390,10 +2390,11 @@ type CentralizedStationRef struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
StationId string `protobuf:"bytes,1,opt,name=stationId,proto3" json:"stationId,omitempty"` // 集中站ID StationId string `protobuf:"bytes,1,opt,name=stationId,proto3" json:"stationId,omitempty"` // 集中站ID
TransponderId []string `protobuf:"bytes,2,rep,name=transponderId,proto3" json:"transponderId,omitempty"` // 应答器ID TransponderId []string `protobuf:"bytes,2,rep,name=transponderId,proto3" json:"transponderId,omitempty"` // 应答器ID
CjList []*CjData `protobuf:"bytes,3,rep,name=cjList,proto3" json:"cjList,omitempty"` // 采集继电器配置信息 CjList []*CjData `protobuf:"bytes,3,rep,name=cjList,proto3" json:"cjList,omitempty"` // 采集继电器配置信息
QdList []*QdData `protobuf:"bytes,4,rep,name=qdList,proto3" json:"qdList,omitempty"` // 驱动继电器配置信息 QdList []*QdData `protobuf:"bytes,4,rep,name=qdList,proto3" json:"qdList,omitempty"` // 驱动继电器配置信息
SectionCodePoints []*CiSectionCodePoint `protobuf:"bytes,5,rep,name=sectionCodePoints,proto3" json:"sectionCodePoints,omitempty"` //物理区段码表
} }
func (x *CentralizedStationRef) Reset() { func (x *CentralizedStationRef) Reset() {
@ -2456,6 +2457,13 @@ func (x *CentralizedStationRef) GetQdList() []*QdData {
return nil return nil
} }
func (x *CentralizedStationRef) GetSectionCodePoints() []*CiSectionCodePoint {
if x != nil {
return x.SectionCodePoints
}
return nil
}
type CjData struct { type CjData struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -2701,6 +2709,62 @@ func (x *AsdGroup) GetEnd() int32 {
return 0 return 0
} }
// 联锁物理区段码位
type CiSectionCodePoint struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Row int32 `protobuf:"varint,1,opt,name=row,proto3" json:"row,omitempty"` //所在行
SectionId string `protobuf:"bytes,2,opt,name=sectionId,proto3" json:"sectionId,omitempty"` //物理区段id
}
func (x *CiSectionCodePoint) Reset() {
*x = CiSectionCodePoint{}
if protoimpl.UnsafeEnabled {
mi := &file_model_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CiSectionCodePoint) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CiSectionCodePoint) ProtoMessage() {}
func (x *CiSectionCodePoint) ProtoReflect() protoreflect.Message {
mi := &file_model_proto_msgTypes[29]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CiSectionCodePoint.ProtoReflect.Descriptor instead.
func (*CiSectionCodePoint) Descriptor() ([]byte, []int) {
return file_model_proto_rawDescGZIP(), []int{29}
}
func (x *CiSectionCodePoint) GetRow() int32 {
if x != nil {
return x.Row
}
return 0
}
func (x *CiSectionCodePoint) GetSectionId() string {
if x != nil {
return x.SectionId
}
return ""
}
var File_model_proto protoreflect.FileDescriptor var File_model_proto protoreflect.FileDescriptor
var file_model_proto_rawDesc = []byte{ var file_model_proto_rawDesc = []byte{
@ -3004,7 +3068,7 @@ var file_model_proto_rawDesc = []byte{
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x65, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x65, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
0x04, 0x67, 0x65, 0x61, 0x72, 0x22, 0xa9, 0x01, 0x0a, 0x15, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x04, 0x67, 0x65, 0x61, 0x72, 0x22, 0xf2, 0x01, 0x0a, 0x15, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61,
0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x12, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x12,
0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x24, 0x0a,
@ -3015,68 +3079,77 @@ var file_model_proto_rawDesc = []byte{
0x74, 0x61, 0x52, 0x06, 0x63, 0x6a, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x71, 0x64, 0x74, 0x61, 0x52, 0x06, 0x63, 0x6a, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x71, 0x64,
0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x6d, 0x6f, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x6d, 0x6f, 0x64,
0x65, 0x6c, 0x2e, 0x51, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x71, 0x64, 0x4c, 0x69, 0x73, 0x65, 0x6c, 0x2e, 0x51, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x71, 0x64, 0x4c, 0x69, 0x73,
0x74, 0x22, 0x5d, 0x0a, 0x06, 0x43, 0x6a, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x74, 0x12, 0x47, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65,
0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x6f, 0x77, 0x12, 0x10, 0x0a, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d,
0x03, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x6f, 0x6c, 0x12, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x43, 0x69, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f,
0x2f, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x64, 0x65, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x11, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x43, 0x6a, 0x44, 0x61, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x5d, 0x0a, 0x06, 0x43, 0x6a,
0x61, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x09, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28,
0x22, 0x34, 0x0a, 0x0a, 0x43, 0x6a, 0x44, 0x61, 0x74, 0x61, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x18, 0x05, 0x52, 0x03, 0x72, 0x6f, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20,
0x0a, 0x07, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x6f, 0x6c, 0x12, 0x2f, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x52,
0x07, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x49, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x02, 0x20, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f,
0x01, 0x28, 0x08, 0x52, 0x01, 0x71, 0x22, 0x4a, 0x0a, 0x06, 0x51, 0x64, 0x44, 0x61, 0x74, 0x61, 0x64, 0x65, 0x6c, 0x2e, 0x43, 0x6a, 0x44, 0x61, 0x74, 0x61, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x09,
0x12, 0x10, 0x0a, 0x03, 0x72, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0x34, 0x0a, 0x0a, 0x43, 0x6a, 0x44,
0x6f, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x61, 0x74, 0x61, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x61, 0x79,
0x03, 0x63, 0x6f, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x49,
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x01, 0x71, 0x22,
0x79, 0x73, 0x22, 0x48, 0x0a, 0x08, 0x41, 0x73, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x4a, 0x0a, 0x06, 0x51, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x6f, 0x77,
0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x6f, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x63,
0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x6f, 0x6c, 0x12, 0x1c, 0x0a,
0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x09, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x2a, 0xfd, 0x03, 0x0a, 0x52, 0x09, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0x48, 0x0a, 0x08, 0x41,
0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x73, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70,
0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x0a,
0x6e, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74,
0x65, 0x5f, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
0x6e, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x44, 0x0a, 0x12, 0x43, 0x69, 0x53, 0x65, 0x63, 0x74, 0x69,
0x65, 0x5f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x10, 0x02, 0x12, 0x16, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72,
0x0a, 0x12, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x54, 0x75, 0x72, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x6f, 0x77, 0x12, 0x1c, 0x0a,
0x6e, 0x6f, 0x75, 0x74, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x09, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x54, 0x79, 0x70, 0x65, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x52, 0x09, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x2a, 0xfd, 0x03, 0x0a, 0x0a,
0x16, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x54, 0x72, 0x61, 0x6e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,
0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x53, 0x6c, 0x6f, 0x70, 0x65, 0x10, 0x06, 0x12, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x21, 0x0a, 0x1d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x53, 0x65, 0x5f, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x43, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, 0x65, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x10, 0x02, 0x12, 0x16, 0x0a,
0x5f, 0x4c, 0x69, 0x6e, 0x6b, 0x10, 0x08, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x65, 0x76, 0x69, 0x63, 0x12, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x54, 0x75, 0x72, 0x6e,
0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x10, 0x09, 0x6f, 0x75, 0x74, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54,
0x12, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x52, 0x79, 0x70, 0x65, 0x5f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16,
0x65, 0x6c, 0x61, 0x79, 0x10, 0x0a, 0x12, 0x24, 0x0a, 0x20, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x54, 0x72, 0x61, 0x6e, 0x73,
0x54, 0x79, 0x70, 0x65, 0x5f, 0x50, 0x68, 0x61, 0x73, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69,
0x65, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x10, 0x0b, 0x12, 0x15, 0x0a, 0x11, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x53, 0x6c, 0x6f, 0x70, 0x65, 0x10, 0x06, 0x12, 0x21,
0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x0a, 0x1d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x53, 0x65, 0x63,
0x6e, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x43, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, 0x65, 0x10,
0x65, 0x5f, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x10, 0x0d, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f,
0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x41, 0x6c, 0x61, 0x72, 0x6d, 0x10, 0x0e, 0x12, 0x4c, 0x69, 0x6e, 0x6b, 0x10, 0x08, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x12, 0x0a, 0x0e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x50, 0x73, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4c, 0x69, 0x6e, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x10, 0x09, 0x12,
0x64, 0x10, 0x0f, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x52, 0x65,
0x65, 0x5f, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x10, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x6c, 0x61, 0x79, 0x10, 0x0a, 0x12, 0x24, 0x0a, 0x20, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54,
0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x6b, 0x78, 0x10, 0x11, 0x12, 0x79, 0x70, 0x65, 0x5f, 0x50, 0x68, 0x61, 0x73, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65,
0x12, 0x0a, 0x0e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4b, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x10, 0x0b, 0x12, 0x15, 0x0a, 0x11, 0x44,
0x79, 0x10, 0x12, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e,
0x65, 0x5f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x10, 0x13, 0x2a, 0x25, 0x0a, 0x04, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x50, 0x6f, 0x72, 0x74, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x05, 0x5f, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x10, 0x0d, 0x12, 0x14, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69,
0x0a, 0x01, 0x41, 0x10, 0x01, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10, 0x02, 0x12, 0x05, 0x0a, 0x01, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x41, 0x6c, 0x61, 0x72, 0x6d, 0x10, 0x0e, 0x12, 0x12,
0x43, 0x10, 0x03, 0x2a, 0x20, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x0e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x50, 0x73, 0x64,
0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x46, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x49, 0x10, 0x0f, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x47, 0x48, 0x54, 0x10, 0x01, 0x2a, 0x43, 0x0a, 0x0e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x5f, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x10, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x65,
0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x6b, 0x78, 0x10, 0x11, 0x12, 0x12,
0x61, 0x72, 0x79, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x78, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x0a, 0x0e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4b, 0x65, 0x79,
0x6e, 0x74, 0x65, 0x72, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x75, 0x6c, 0x61, 0x10, 0x12, 0x12, 0x17, 0x0a, 0x13, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
0x74, 0x65, 0x64, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x10, 0x02, 0x42, 0x1a, 0x5a, 0x18, 0x2e, 0x2f, 0x5f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x10, 0x13, 0x2a, 0x25, 0x0a, 0x04, 0x50,
0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x6f, 0x72, 0x74, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x05, 0x0a,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x01, 0x41, 0x10, 0x01, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10, 0x02, 0x12, 0x05, 0x0a, 0x01, 0x43,
0x10, 0x03, 0x2a, 0x20, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x08, 0x0a, 0x04, 0x4c, 0x45, 0x46, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x49, 0x47,
0x48, 0x54, 0x10, 0x01, 0x2a, 0x43, 0x0a, 0x0e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x69,
0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x61,
0x72, 0x79, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x78, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e,
0x74, 0x65, 0x72, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x6e, 0x73, 0x75, 0x6c, 0x61, 0x74,
0x65, 0x64, 0x4a, 0x6f, 0x69, 0x6e, 0x74, 0x10, 0x02, 0x42, 0x1a, 0x5a, 0x18, 0x2e, 0x2f, 0x72,
0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -3092,7 +3165,7 @@ func file_model_proto_rawDescGZIP() []byte {
} }
var file_model_proto_enumTypes = make([]protoimpl.EnumInfo, 9) var file_model_proto_enumTypes = make([]protoimpl.EnumInfo, 9)
var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 29) var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 30)
var file_model_proto_goTypes = []interface{}{ var file_model_proto_goTypes = []interface{}{
(DeviceType)(0), // 0: model.DeviceType (DeviceType)(0), // 0: model.DeviceType
(Port)(0), // 1: model.Port (Port)(0), // 1: model.Port
@ -3132,6 +3205,7 @@ var file_model_proto_goTypes = []interface{}{
(*CjDataItem)(nil), // 35: model.CjDataItem (*CjDataItem)(nil), // 35: model.CjDataItem
(*QdData)(nil), // 36: model.QdData (*QdData)(nil), // 36: model.QdData
(*AsdGroup)(nil), // 37: model.AsdGroup (*AsdGroup)(nil), // 37: model.AsdGroup
(*CiSectionCodePoint)(nil), // 38: model.CiSectionCodePoint
} }
var file_model_proto_depIdxs = []int32{ var file_model_proto_depIdxs = []int32{
10, // 0: model.Repository.physicalSections:type_name -> model.PhysicalSection 10, // 0: model.Repository.physicalSections:type_name -> model.PhysicalSection
@ -3187,12 +3261,13 @@ var file_model_proto_depIdxs = []int32{
0, // 50: model.ElectronicComponent.deviceType:type_name -> model.DeviceType 0, // 50: model.ElectronicComponent.deviceType:type_name -> model.DeviceType
34, // 51: model.CentralizedStationRef.cjList:type_name -> model.CjData 34, // 51: model.CentralizedStationRef.cjList:type_name -> model.CjData
36, // 52: model.CentralizedStationRef.qdList:type_name -> model.QdData 36, // 52: model.CentralizedStationRef.qdList:type_name -> model.QdData
35, // 53: model.CjData.refRelays:type_name -> model.CjDataItem 38, // 53: model.CentralizedStationRef.sectionCodePoints:type_name -> model.CiSectionCodePoint
54, // [54:54] is the sub-list for method output_type 35, // 54: model.CjData.refRelays:type_name -> model.CjDataItem
54, // [54:54] is the sub-list for method input_type 55, // [55:55] is the sub-list for method output_type
54, // [54:54] is the sub-list for extension type_name 55, // [55:55] is the sub-list for method input_type
54, // [54:54] is the sub-list for extension extendee 55, // [55:55] is the sub-list for extension type_name
0, // [0:54] is the sub-list for field type_name 55, // [55:55] is the sub-list for extension extendee
0, // [0:55] is the sub-list for field type_name
} }
func init() { file_model_proto_init() } func init() { file_model_proto_init() }
@ -3549,6 +3624,18 @@ func file_model_proto_init() {
return nil return nil
} }
} }
file_model_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CiSectionCodePoint); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -3556,7 +3643,7 @@ func file_model_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_model_proto_rawDesc, RawDescriptor: file_model_proto_rawDesc,
NumEnums: 9, NumEnums: 9,
NumMessages: 29, NumMessages: 30,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -8,11 +8,14 @@ type Platform struct {
station *Station station *Station
} }
func NewPlatform(id string) *Platform { func NewPlatform(id string, code string) *Platform {
return &Platform{Identity: identity{ return &Platform{
id: id, Identity: identity{
deviceType: proto.DeviceType_DeviceType_Platform, id: id,
}} deviceType: proto.DeviceType_DeviceType_Platform,
},
code: code,
}
} }
func (p *Platform) Code() string { func (p *Platform) Code() string {

View File

@ -3,12 +3,11 @@ package repository
import ( import (
"errors" "errors"
"fmt" "fmt"
"joylink.club/rtsssimulation/repository/model/proto"
"joylink.club/rtsssimulation/util/number"
"log/slog" "log/slog"
"math" "math"
"strconv" "strconv"
"joylink.club/rtsssimulation/repository/model/proto"
"joylink.club/rtsssimulation/util/number"
) )
var repositoryMap = make(map[string]*Repository) var repositoryMap = make(map[string]*Repository)
@ -112,7 +111,6 @@ func buildModels(source *proto.Repository, repository *Repository) error {
m := newPsd(protoData.Id, protoData.AsdAmount, protoData.AsdGroups) m := newPsd(protoData.Id, protoData.AsdAmount, protoData.AsdGroups)
repository.psdMap[m.Id()] = m repository.psdMap[m.Id()] = m
} }
for _, protoData := range source.Lights { for _, protoData := range source.Lights {
m := NewLight(protoData.Id, protoData.Code) m := NewLight(protoData.Id, protoData.Code)
repository.lightMap[m.Id()] = m repository.lightMap[m.Id()] = m
@ -121,7 +119,6 @@ func buildModels(source *proto.Repository, repository *Repository) error {
m := NewAlarm(protoData.Id, protoData.Code) m := NewAlarm(protoData.Id, protoData.Code)
repository.alarmMap[m.Id()] = m repository.alarmMap[m.Id()] = m
} }
for _, protoData := range source.Mkxs { for _, protoData := range source.Mkxs {
m := NewMkx(protoData.Id) m := NewMkx(protoData.Id)
repository.mkxMap[m.Id()] = m repository.mkxMap[m.Id()] = m
@ -130,6 +127,10 @@ func buildModels(source *proto.Repository, repository *Repository) error {
m := NewKey(protoData.Id, protoData.Code, protoData.Gear) m := NewKey(protoData.Id, protoData.Code, protoData.Gear)
repository.keyMap[m.Id()] = m repository.keyMap[m.Id()] = m
} }
for _, protoData := range source.Platforms {
m := NewPlatform(protoData.Id, protoData.Code)
repository.platformMap[m.Id()] = m
}
err := repository.generateCoordinateInfo(source.MainCoordinateSystem) err := repository.generateCoordinateInfo(source.MainCoordinateSystem)
for _, protoData := range source.CentralizedStationRefs { for _, protoData := range source.CentralizedStationRefs {
repository.centralizedMap[protoData.StationId] = protoData repository.centralizedMap[protoData.StationId] = protoData
@ -174,9 +175,25 @@ func buildModelRelationship(source *proto.Repository, repository *Repository) er
if err != nil { if err != nil {
return err return err
} }
err = buildPlatformRelationShip(source, repository)
if err != nil {
return err
}
return err return err
} }
func buildPlatformRelationShip(source *proto.Repository, repo *Repository) error {
for _, protoData := range source.Platforms {
platform := repo.platformMap[protoData.Id]
station := repo.stationMap[protoData.StationId]
if station == nil {
return fmt.Errorf("站台[id:%s]关联的车站[id:%s]不存在", platform.Id(), protoData.StationId)
}
platform.station = station
}
return nil
}
func buildMkxRelationShip(source *proto.Repository, repo *Repository) error { func buildMkxRelationShip(source *proto.Repository, repo *Repository) error {
for _, protoData := range source.Mkxs { for _, protoData := range source.Mkxs {
mkx := repo.mkxMap[protoData.Id] mkx := repo.mkxMap[protoData.Id]
@ -194,6 +211,11 @@ func buildMkxRelationShip(source *proto.Repository, repo *Repository) error {
func buildPsdRelationShip(source *proto.Repository, repo *Repository) error { func buildPsdRelationShip(source *proto.Repository, repo *Repository) error {
for _, protoData := range source.Psds { for _, protoData := range source.Psds {
psd := repo.psdMap[protoData.Id] psd := repo.psdMap[protoData.Id]
platform := repo.platformMap[protoData.PlatformId]
if platform == nil {
return fmt.Errorf("屏蔽门[id:%s]关联的站台[id:%s]不存在", psd.Id(), protoData.PlatformId)
}
psd.platform = platform
for _, group := range protoData.ElectronicComponentGroups { for _, group := range protoData.ElectronicComponentGroups {
var components []IGroupedElectronicComponent var components []IGroupedElectronicComponent
for _, id := range group.GetComponentIds() { for _, id := range group.GetComponentIds() {