This commit is contained in:
walker 2023-08-29 18:01:40 +08:00
commit 237beec2bf
17 changed files with 218 additions and 564 deletions

View File

@ -35,9 +35,6 @@ var PhysicalSectionStateComponent = ecs.NewComponentType[cstate.PhysicalSectionS
// 信号机状态组件
var SignalStateComponent = ecs.NewComponentType[cstate.SignalState]()
// 信号机显示操作组件
var SignalDisplayOperatingComponent = ecs.NewComponentType[cstate.SignalDisplayOperating]()
// 站台单侧屏蔽门状态组件
var PsdStateComponent = ecs.NewComponentType[cstate.PsdState]()
@ -55,3 +52,9 @@ var RelayStateComponent = ecs.NewComponentType[cstate.RelayState]()
// 紧急停车按钮状态组件
var EmpStateComponent = ecs.NewComponentType[cstate.EmpState]()
// 生成标签组件
// 用于标记实体便于查找
func NewComponentTag() *ecs.ComponentType[struct{}] {
return ecs.NewComponentType[struct{}]()
}

View File

@ -402,73 +402,6 @@ func (x *SignalState) GetDisplay() SignalAspect {
return SignalAspect_No
}
// 信号机显示操作
type SignalDisplayOperating struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// 是否执行操作
StartOperate bool `protobuf:"varint,1,opt,name=startOperate,proto3" json:"startOperate,omitempty"`
// 执行操作剩余时长单位ms
OperateTime int64 `protobuf:"varint,2,opt,name=operateTime,proto3" json:"operateTime,omitempty"`
// 信号机目标显示
TargetAspect SignalAspect `protobuf:"varint,3,opt,name=targetAspect,proto3,enum=cstate.SignalAspect" json:"targetAspect,omitempty"`
}
func (x *SignalDisplayOperating) Reset() {
*x = SignalDisplayOperating{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SignalDisplayOperating) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SignalDisplayOperating) ProtoMessage() {}
func (x *SignalDisplayOperating) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[4]
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 SignalDisplayOperating.ProtoReflect.Descriptor instead.
func (*SignalDisplayOperating) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{4}
}
func (x *SignalDisplayOperating) GetStartOperate() bool {
if x != nil {
return x.StartOperate
}
return false
}
func (x *SignalDisplayOperating) GetOperateTime() int64 {
if x != nil {
return x.OperateTime
}
return 0
}
func (x *SignalDisplayOperating) GetTargetAspect() SignalAspect {
if x != nil {
return x.TargetAspect
}
return SignalAspect_No
}
// 站台一侧屏蔽门状态
type PsdState struct {
state protoimpl.MessageState
@ -486,7 +419,7 @@ type PsdState struct {
func (x *PsdState) Reset() {
*x = PsdState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[5]
mi := &file_status_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -499,7 +432,7 @@ func (x *PsdState) String() string {
func (*PsdState) ProtoMessage() {}
func (x *PsdState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[5]
mi := &file_status_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -512,7 +445,7 @@ func (x *PsdState) ProtoReflect() protoreflect.Message {
// Deprecated: Use PsdState.ProtoReflect.Descriptor instead.
func (*PsdState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{5}
return file_status_proto_rawDescGZIP(), []int{4}
}
func (x *PsdState) GetAllClosed() bool {
@ -551,7 +484,7 @@ type PercentageDeviceState struct {
func (x *PercentageDeviceState) Reset() {
*x = PercentageDeviceState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[6]
mi := &file_status_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -564,7 +497,7 @@ func (x *PercentageDeviceState) String() string {
func (*PercentageDeviceState) ProtoMessage() {}
func (x *PercentageDeviceState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[6]
mi := &file_status_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -577,7 +510,7 @@ func (x *PercentageDeviceState) ProtoReflect() protoreflect.Message {
// Deprecated: Use PercentageDeviceState.ProtoReflect.Descriptor instead.
func (*PercentageDeviceState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{6}
return file_status_proto_rawDescGZIP(), []int{5}
}
func (x *PercentageDeviceState) GetRate() int64 {
@ -612,7 +545,7 @@ type MovableDeviceState struct {
func (x *MovableDeviceState) Reset() {
*x = MovableDeviceState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[7]
mi := &file_status_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -625,7 +558,7 @@ func (x *MovableDeviceState) String() string {
func (*MovableDeviceState) ProtoMessage() {}
func (x *MovableDeviceState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[7]
mi := &file_status_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -638,7 +571,7 @@ func (x *MovableDeviceState) ProtoReflect() protoreflect.Message {
// Deprecated: Use MovableDeviceState.ProtoReflect.Descriptor instead.
func (*MovableDeviceState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{7}
return file_status_proto_rawDescGZIP(), []int{6}
}
func (x *MovableDeviceState) GetToH() bool {
@ -675,7 +608,7 @@ type BaliseState struct {
func (x *BaliseState) Reset() {
*x = BaliseState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[8]
mi := &file_status_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -688,7 +621,7 @@ func (x *BaliseState) String() string {
func (*BaliseState) ProtoMessage() {}
func (x *BaliseState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[8]
mi := &file_status_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -701,7 +634,7 @@ func (x *BaliseState) ProtoReflect() protoreflect.Message {
// Deprecated: Use BaliseState.ProtoReflect.Descriptor instead.
func (*BaliseState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{8}
return file_status_proto_rawDescGZIP(), []int{7}
}
func (x *BaliseState) GetContent() *BaliseContent {
@ -728,7 +661,7 @@ type BaliseContent struct {
func (x *BaliseContent) Reset() {
*x = BaliseContent{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[9]
mi := &file_status_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -741,7 +674,7 @@ func (x *BaliseContent) String() string {
func (*BaliseContent) ProtoMessage() {}
func (x *BaliseContent) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[9]
mi := &file_status_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -754,7 +687,7 @@ func (x *BaliseContent) ProtoReflect() protoreflect.Message {
// Deprecated: Use BaliseContent.ProtoReflect.Descriptor instead.
func (*BaliseContent) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{9}
return file_status_proto_rawDescGZIP(), []int{8}
}
func (x *BaliseContent) GetId() string {
@ -796,7 +729,7 @@ type OccupiedLinkPosition struct {
func (x *OccupiedLinkPosition) Reset() {
*x = OccupiedLinkPosition{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[10]
mi := &file_status_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -809,7 +742,7 @@ func (x *OccupiedLinkPosition) String() string {
func (*OccupiedLinkPosition) ProtoMessage() {}
func (x *OccupiedLinkPosition) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[10]
mi := &file_status_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -822,7 +755,7 @@ func (x *OccupiedLinkPosition) ProtoReflect() protoreflect.Message {
// Deprecated: Use OccupiedLinkPosition.ProtoReflect.Descriptor instead.
func (*OccupiedLinkPosition) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{10}
return file_status_proto_rawDescGZIP(), []int{9}
}
func (x *OccupiedLinkPosition) GetLinkId() string {
@ -861,7 +794,7 @@ type TrainState struct {
func (x *TrainState) Reset() {
*x = TrainState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[11]
mi := &file_status_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -874,7 +807,7 @@ func (x *TrainState) String() string {
func (*TrainState) ProtoMessage() {}
func (x *TrainState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[11]
mi := &file_status_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -887,7 +820,7 @@ func (x *TrainState) ProtoReflect() protoreflect.Message {
// Deprecated: Use TrainState.ProtoReflect.Descriptor instead.
func (*TrainState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{11}
return file_status_proto_rawDescGZIP(), []int{10}
}
func (x *TrainState) GetActiveHead() TrainActiveEnum {
@ -922,7 +855,7 @@ type TowPositionButtonState struct {
func (x *TowPositionButtonState) Reset() {
*x = TowPositionButtonState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[12]
mi := &file_status_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -935,7 +868,7 @@ func (x *TowPositionButtonState) String() string {
func (*TowPositionButtonState) ProtoMessage() {}
func (x *TowPositionButtonState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[12]
mi := &file_status_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -948,7 +881,7 @@ func (x *TowPositionButtonState) ProtoReflect() protoreflect.Message {
// Deprecated: Use TowPositionButtonState.ProtoReflect.Descriptor instead.
func (*TowPositionButtonState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{12}
return file_status_proto_rawDescGZIP(), []int{11}
}
func (x *TowPositionButtonState) GetPos1() bool {
@ -978,7 +911,7 @@ type RelayState struct {
func (x *RelayState) Reset() {
*x = RelayState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[13]
mi := &file_status_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -991,7 +924,7 @@ func (x *RelayState) String() string {
func (*RelayState) ProtoMessage() {}
func (x *RelayState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[13]
mi := &file_status_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1004,7 +937,7 @@ func (x *RelayState) ProtoReflect() protoreflect.Message {
// Deprecated: Use RelayState.ProtoReflect.Descriptor instead.
func (*RelayState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{13}
return file_status_proto_rawDescGZIP(), []int{12}
}
func (x *RelayState) GetActive() bool {
@ -1028,7 +961,7 @@ type EmpState struct {
func (x *EmpState) Reset() {
*x = EmpState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[14]
mi := &file_status_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1041,7 +974,7 @@ func (x *EmpState) String() string {
func (*EmpState) ProtoMessage() {}
func (x *EmpState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[14]
mi := &file_status_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1054,7 +987,7 @@ func (x *EmpState) ProtoReflect() protoreflect.Message {
// Deprecated: Use EmpState.ProtoReflect.Descriptor instead.
func (*EmpState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{14}
return file_status_proto_rawDescGZIP(), []int{13}
}
func (x *EmpState) GetPressed() bool {
@ -1077,7 +1010,7 @@ type ButtonState struct {
func (x *ButtonState) Reset() {
*x = ButtonState{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[15]
mi := &file_status_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1090,7 +1023,7 @@ func (x *ButtonState) String() string {
func (*ButtonState) ProtoMessage() {}
func (x *ButtonState) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[15]
mi := &file_status_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1103,7 +1036,7 @@ func (x *ButtonState) ProtoReflect() protoreflect.Message {
// Deprecated: Use ButtonState.ProtoReflect.Descriptor instead.
func (*ButtonState) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{15}
return file_status_proto_rawDescGZIP(), []int{14}
}
func (x *ButtonState) GetPressDown() bool {
@ -1132,7 +1065,7 @@ type ButtonPressOperating struct {
func (x *ButtonPressOperating) Reset() {
*x = ButtonPressOperating{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[16]
mi := &file_status_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1145,7 +1078,7 @@ func (x *ButtonPressOperating) String() string {
func (*ButtonPressOperating) ProtoMessage() {}
func (x *ButtonPressOperating) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[16]
mi := &file_status_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1158,7 +1091,7 @@ func (x *ButtonPressOperating) ProtoReflect() protoreflect.Message {
// Deprecated: Use ButtonPressOperating.ProtoReflect.Descriptor instead.
func (*ButtonPressOperating) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{16}
return file_status_proto_rawDescGZIP(), []int{15}
}
func (x *ButtonPressOperating) GetStart() bool {
@ -1204,7 +1137,7 @@ type ButtonConfirmOperating struct {
func (x *ButtonConfirmOperating) Reset() {
*x = ButtonConfirmOperating{}
if protoimpl.UnsafeEnabled {
mi := &file_status_proto_msgTypes[17]
mi := &file_status_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1217,7 +1150,7 @@ func (x *ButtonConfirmOperating) String() string {
func (*ButtonConfirmOperating) ProtoMessage() {}
func (x *ButtonConfirmOperating) ProtoReflect() protoreflect.Message {
mi := &file_status_proto_msgTypes[17]
mi := &file_status_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1230,7 +1163,7 @@ func (x *ButtonConfirmOperating) ProtoReflect() protoreflect.Message {
// Deprecated: Use ButtonConfirmOperating.ProtoReflect.Descriptor instead.
func (*ButtonConfirmOperating) Descriptor() ([]byte, []int) {
return file_status_proto_rawDescGZIP(), []int{17}
return file_status_proto_rawDescGZIP(), []int{16}
}
func (x *ButtonConfirmOperating) GetConfirm() bool {
@ -1266,96 +1199,87 @@ var file_status_proto_rawDesc = []byte{
0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x69, 0x73, 0x70, 0x6c,
0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x63, 0x73, 0x74, 0x61, 0x74,
0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x07,
0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0x98, 0x01, 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e,
0x61, 0x6c, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
0x6e, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67,
0x65, 0x74, 0x41, 0x73, 0x70, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14,
0x2e, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x73,
0x70, 0x65, 0x63, 0x74, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x73, 0x70, 0x65,
0x63, 0x74, 0x22, 0x74, 0x0a, 0x08, 0x50, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c,
0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09,
0x61, 0x6c, 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
0x09, 0x61, 0x6c, 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x69, 0x6e,
0x74, 0x65, 0x72, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x18,
0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x6f, 0x63, 0x6b,
0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x22, 0x43, 0x0a, 0x15, 0x50, 0x65, 0x72, 0x63,
0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x04, 0x72, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x22, 0x58, 0x0a,
0x12, 0x4d, 0x6f, 0x76, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74,
0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x6f, 0x48, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
0x52, 0x03, 0x74, 0x6f, 0x48, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70,
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70,
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x0a, 0x0b, 0x42, 0x61, 0x6c, 0x69, 0x73,
0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65,
0x2e, 0x42, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x4d, 0x0a, 0x0d, 0x42, 0x61, 0x6c, 0x69, 0x73,
0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x6e, 0x0a, 0x14, 0x4f, 0x63, 0x63, 0x75, 0x70, 0x69,
0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16,
0x0a, 0x06, 0x6c, 0x69, 0x6e, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x6c, 0x69, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f,
0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x73, 0x74, 0x61,
0x72, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x4f,
0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x64,
0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x69, 0x6e,
0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x48,
0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x63, 0x73, 0x74, 0x61,
0x74, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x6e,
0x75, 0x6d, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x48, 0x65, 0x61, 0x64, 0x12, 0x42,
0x0a, 0x0d, 0x6f, 0x63, 0x63, 0x75, 0x70, 0x69, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x18,
0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x4f,
0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0x74, 0x0a, 0x08, 0x50, 0x73, 0x64, 0x53, 0x74,
0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x43, 0x6c, 0x6f, 0x73, 0x65,
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x65, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x4f, 0x70, 0x65, 0x6e, 0x65, 0x64, 0x12,
0x2c, 0x0a, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65,
0x61, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x22, 0x43, 0x0a,
0x15, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x61, 0x67, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63,
0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x74, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x72, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61,
0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67,
0x65, 0x74, 0x22, 0x58, 0x0a, 0x12, 0x4d, 0x6f, 0x76, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x76,
0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x6f, 0x48, 0x18,
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x74, 0x6f, 0x48, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x70,
0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64,
0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01,
0x28, 0x03, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x0a, 0x0b,
0x42, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63,
0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x42, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x4d, 0x0a, 0x0d,
0x42, 0x61, 0x6c, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x6e, 0x0a, 0x14, 0x4f,
0x63, 0x63, 0x75, 0x70, 0x69, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x6f, 0x73, 0x69, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6f, 0x63, 0x63, 0x75, 0x70, 0x69, 0x65, 0x64, 0x4c, 0x69, 0x6e,
0x6b, 0x73, 0x22, 0x40, 0x0a, 0x16, 0x54, 0x6f, 0x77, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
0x6e, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x70, 0x6f, 0x73, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x31,
0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04,
0x70, 0x6f, 0x73, 0x32, 0x22, 0x24, 0x0a, 0x0a, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x53, 0x74, 0x61,
0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x24, 0x0a, 0x08, 0x45, 0x6d,
0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64,
0x22, 0x2b, 0x0a, 0x0b, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12,
0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x73, 0x73, 0x44, 0x6f, 0x77, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x08, 0x52, 0x09, 0x70, 0x72, 0x65, 0x73, 0x73, 0x44, 0x6f, 0x77, 0x6e, 0x22, 0x84, 0x01,
0x0a, 0x14, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x73, 0x73, 0x4f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18,
0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04,
0x64, 0x6f, 0x77, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x77, 0x6e,
0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x69,
0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72,
0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6e, 0x65, 0x65, 0x64, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x72, 0x6d, 0x22, 0x4a, 0x0a, 0x16, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x18,
0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63,
0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c,
0x2a, 0x81, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x73, 0x70, 0x65, 0x63,
0x74, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x6f, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, 0x52, 0x10, 0x01,
0x12, 0x05, 0x0a, 0x01, 0x47, 0x10, 0x02, 0x12, 0x05, 0x0a, 0x01, 0x59, 0x10, 0x03, 0x12, 0x05,
0x0a, 0x01, 0x57, 0x10, 0x04, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02,
0x52, 0x59, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x57, 0x10, 0x07, 0x12, 0x06, 0x0a, 0x02,
0x47, 0x47, 0x10, 0x08, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x59, 0x10, 0x09, 0x12, 0x06, 0x0a, 0x02,
0x59, 0x59, 0x10, 0x0a, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x46, 0x10, 0x0b, 0x12, 0x06, 0x0a, 0x02,
0x59, 0x46, 0x10, 0x0c, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x46, 0x10, 0x0d, 0x12, 0x06, 0x0a, 0x02,
0x57, 0x46, 0x10, 0x0e, 0x2a, 0x35, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x41, 0x63, 0x74,
0x69, 0x76, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0a, 0x0a, 0x06, 0x48, 0x45, 0x41, 0x44, 0x5f,
0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x48, 0x45, 0x41, 0x44, 0x5f, 0x41, 0x10, 0x01, 0x12,
0x0a, 0x0a, 0x06, 0x48, 0x45, 0x41, 0x44, 0x5f, 0x42, 0x10, 0x02, 0x42, 0x0a, 0x5a, 0x08, 0x2e,
0x2f, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x69, 0x6e, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x73,
0x74, 0x61, 0x72, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1c, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03,
0x52, 0x09, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x0a,
0x54, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x61, 0x63,
0x74, 0x69, 0x76, 0x65, 0x48, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17,
0x2e, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x41, 0x63, 0x74,
0x69, 0x76, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x48,
0x65, 0x61, 0x64, 0x12, 0x42, 0x0a, 0x0d, 0x6f, 0x63, 0x63, 0x75, 0x70, 0x69, 0x65, 0x64, 0x4c,
0x69, 0x6e, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x73, 0x74,
0x61, 0x74, 0x65, 0x2e, 0x4f, 0x63, 0x63, 0x75, 0x70, 0x69, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b,
0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6f, 0x63, 0x63, 0x75, 0x70, 0x69,
0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x22, 0x40, 0x0a, 0x16, 0x54, 0x6f, 0x77, 0x50, 0x6f,
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x70, 0x6f, 0x73, 0x31, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x32, 0x18, 0x02, 0x20,
0x01, 0x28, 0x08, 0x52, 0x04, 0x70, 0x6f, 0x73, 0x32, 0x22, 0x24, 0x0a, 0x0a, 0x52, 0x65, 0x6c,
0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22,
0x24, 0x0a, 0x08, 0x45, 0x6d, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70,
0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x72,
0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0x2b, 0x0a, 0x0b, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53,
0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x73, 0x73, 0x44, 0x6f, 0x77,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x70, 0x72, 0x65, 0x73, 0x73, 0x44, 0x6f,
0x77, 0x6e, 0x22, 0x84, 0x01, 0x0a, 0x14, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x50, 0x72, 0x65,
0x73, 0x73, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73,
0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72,
0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65,
0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72,
0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x65, 0x64, 0x43,
0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6e, 0x65,
0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x22, 0x4a, 0x0a, 0x16, 0x42, 0x75, 0x74,
0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x18, 0x01,
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x12, 0x16, 0x0a,
0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x63,
0x61, 0x6e, 0x63, 0x65, 0x6c, 0x2a, 0x81, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c,
0x41, 0x73, 0x70, 0x65, 0x63, 0x74, 0x12, 0x06, 0x0a, 0x02, 0x4e, 0x6f, 0x10, 0x00, 0x12, 0x05,
0x0a, 0x01, 0x52, 0x10, 0x01, 0x12, 0x05, 0x0a, 0x01, 0x47, 0x10, 0x02, 0x12, 0x05, 0x0a, 0x01,
0x59, 0x10, 0x03, 0x12, 0x05, 0x0a, 0x01, 0x57, 0x10, 0x04, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10,
0x05, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x59, 0x10, 0x06, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x57, 0x10,
0x07, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x47, 0x10, 0x08, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x59, 0x10,
0x09, 0x12, 0x06, 0x0a, 0x02, 0x59, 0x59, 0x10, 0x0a, 0x12, 0x06, 0x0a, 0x02, 0x52, 0x46, 0x10,
0x0b, 0x12, 0x06, 0x0a, 0x02, 0x59, 0x46, 0x10, 0x0c, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x46, 0x10,
0x0d, 0x12, 0x06, 0x0a, 0x02, 0x57, 0x46, 0x10, 0x0e, 0x2a, 0x35, 0x0a, 0x0f, 0x54, 0x72, 0x61,
0x69, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0a, 0x0a, 0x06,
0x48, 0x45, 0x41, 0x44, 0x5f, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x48, 0x45, 0x41, 0x44,
0x5f, 0x41, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x48, 0x45, 0x41, 0x44, 0x5f, 0x42, 0x10, 0x02,
0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1371,7 +1295,7 @@ func file_status_proto_rawDescGZIP() []byte {
}
var file_status_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_status_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
var file_status_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
var file_status_proto_goTypes = []interface{}{
(SignalAspect)(0), // 0: cstate.SignalAspect
(TrainActiveEnum)(0), // 1: cstate.TrainActiveEnum
@ -1379,32 +1303,30 @@ var file_status_proto_goTypes = []interface{}{
(*SwitchRelayState)(nil), // 3: cstate.SwitchRelayState
(*PhysicalSectionState)(nil), // 4: cstate.PhysicalSectionState
(*SignalState)(nil), // 5: cstate.SignalState
(*SignalDisplayOperating)(nil), // 6: cstate.SignalDisplayOperating
(*PsdState)(nil), // 7: cstate.PsdState
(*PercentageDeviceState)(nil), // 8: cstate.PercentageDeviceState
(*MovableDeviceState)(nil), // 9: cstate.MovableDeviceState
(*BaliseState)(nil), // 10: cstate.BaliseState
(*BaliseContent)(nil), // 11: cstate.BaliseContent
(*OccupiedLinkPosition)(nil), // 12: cstate.OccupiedLinkPosition
(*TrainState)(nil), // 13: cstate.TrainState
(*TowPositionButtonState)(nil), // 14: cstate.TowPositionButtonState
(*RelayState)(nil), // 15: cstate.RelayState
(*EmpState)(nil), // 16: cstate.EmpState
(*ButtonState)(nil), // 17: cstate.ButtonState
(*ButtonPressOperating)(nil), // 18: cstate.ButtonPressOperating
(*ButtonConfirmOperating)(nil), // 19: cstate.ButtonConfirmOperating
(*PsdState)(nil), // 6: cstate.PsdState
(*PercentageDeviceState)(nil), // 7: cstate.PercentageDeviceState
(*MovableDeviceState)(nil), // 8: cstate.MovableDeviceState
(*BaliseState)(nil), // 9: cstate.BaliseState
(*BaliseContent)(nil), // 10: cstate.BaliseContent
(*OccupiedLinkPosition)(nil), // 11: cstate.OccupiedLinkPosition
(*TrainState)(nil), // 12: cstate.TrainState
(*TowPositionButtonState)(nil), // 13: cstate.TowPositionButtonState
(*RelayState)(nil), // 14: cstate.RelayState
(*EmpState)(nil), // 15: cstate.EmpState
(*ButtonState)(nil), // 16: cstate.ButtonState
(*ButtonPressOperating)(nil), // 17: cstate.ButtonPressOperating
(*ButtonConfirmOperating)(nil), // 18: cstate.ButtonConfirmOperating
}
var file_status_proto_depIdxs = []int32{
0, // 0: cstate.SignalState.display:type_name -> cstate.SignalAspect
0, // 1: cstate.SignalDisplayOperating.targetAspect:type_name -> cstate.SignalAspect
11, // 2: cstate.BaliseState.content:type_name -> cstate.BaliseContent
1, // 3: cstate.TrainState.activeHead:type_name -> cstate.TrainActiveEnum
12, // 4: cstate.TrainState.occupiedLinks:type_name -> cstate.OccupiedLinkPosition
5, // [5:5] is the sub-list for method output_type
5, // [5:5] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
10, // 1: cstate.BaliseState.content:type_name -> cstate.BaliseContent
1, // 2: cstate.TrainState.activeHead:type_name -> cstate.TrainActiveEnum
11, // 3: cstate.TrainState.occupiedLinks:type_name -> cstate.OccupiedLinkPosition
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_status_proto_init() }
@ -1462,18 +1384,6 @@ func file_status_proto_init() {
}
}
file_status_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SignalDisplayOperating); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_status_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PsdState); i {
case 0:
return &v.state
@ -1485,7 +1395,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PercentageDeviceState); i {
case 0:
return &v.state
@ -1497,7 +1407,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*MovableDeviceState); i {
case 0:
return &v.state
@ -1509,7 +1419,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BaliseState); i {
case 0:
return &v.state
@ -1521,7 +1431,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BaliseContent); i {
case 0:
return &v.state
@ -1533,7 +1443,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OccupiedLinkPosition); i {
case 0:
return &v.state
@ -1545,7 +1455,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainState); i {
case 0:
return &v.state
@ -1557,7 +1467,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TowPositionButtonState); i {
case 0:
return &v.state
@ -1569,7 +1479,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RelayState); i {
case 0:
return &v.state
@ -1581,7 +1491,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EmpState); i {
case 0:
return &v.state
@ -1593,7 +1503,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ButtonState); i {
case 0:
return &v.state
@ -1605,7 +1515,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ButtonPressOperating); i {
case 0:
return &v.state
@ -1617,7 +1527,7 @@ func file_status_proto_init() {
return nil
}
}
file_status_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
file_status_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ButtonConfirmOperating); i {
case 0:
return &v.state
@ -1636,7 +1546,7 @@ func file_status_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_status_proto_rawDesc,
NumEnums: 2,
NumMessages: 18,
NumMessages: 17,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -84,8 +84,6 @@ func foreachModels(modelManager umi.IModelManager, deviceType umi.DeviceType, ea
}
// //////////////////////////////////////////////////////////////////////
// 设备继电器标签,即标记继电器属于哪个设备的
type DeviceRelayTag struct{}
// 创建模型仓库引用实体
func CreateModelStorageRefEntity(w ecs.World) *ecs.Entry {
@ -100,14 +98,14 @@ func CreateWorldTimeEntity(w ecs.World) *ecs.Entry {
// 创建道岔实体
func CreateSwitchEntity(w ecs.World) *ecs.Entry {
e := w.Create(components.DeviceIdentityComponent, components.SwitchRelayStateComponent, components.PercentageDeviceStateComponent, components.MovableDeviceStateComponent, components.RelayTagHandlerComponent)
components.RelayTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: ecs.NewComponentType[DeviceRelayTag]()})
components.RelayTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: components.NewComponentTag()})
return e
}
// 创建信号机实体
func CreateSignalEntity(w ecs.World) *ecs.Entry {
e := w.Create(components.DeviceIdentityComponent, components.SignalStateComponent, components.RelayTagHandlerComponent)
components.RelayTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: ecs.NewComponentType[DeviceRelayTag]()})
components.RelayTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: components.NewComponentTag()})
return e
}
@ -116,14 +114,11 @@ func CreatePhysicalSectionEntity(w ecs.World) *ecs.Entry {
return w.Create(components.DeviceIdentityComponent, components.PhysicalSectionStateComponent)
}
// 屏蔽门与其cell关系tag定义
type PsdCellTag struct{}
// 创建站台单侧屏蔽门实体
func CreatePsdEntity(w ecs.World) *ecs.Entry {
e := w.Create(components.DeviceIdentityComponent, components.PsdStateComponent, components.PsdTagHandlerComponent, components.RelayTagHandlerComponent)
components.PsdTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: ecs.NewComponentType[PsdCellTag]()})
components.RelayTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: ecs.NewComponentType[DeviceRelayTag]()})
components.PsdTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: components.NewComponentTag()})
components.RelayTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: components.NewComponentTag()})
return e
}
@ -156,6 +151,6 @@ func CreateRelayEntity(w ecs.World, deviceEntry *ecs.Entry) *ecs.Entry {
// 创建紧急停车按钮实体
func CreateEmpEntity(w ecs.World) *ecs.Entry {
e := w.Create(components.DeviceIdentityComponent, components.EmpStateComponent, components.RelayTagHandlerComponent)
components.RelayTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: ecs.NewComponentType[DeviceRelayTag]()})
components.RelayTagHandlerComponent.Set(e, &cstate.EntityTagHandler{Tag: components.NewComponentTag()})
return e
}

View File

@ -14,14 +14,22 @@ var (
protoFolder = filepath.Join(basePath, "proto", "src")
protocPath = filepath.Join(basePath, "proto", "protoc-23.1", "bin", "win64", "protoc")
)
var goOutDir string = "./"
func main() {
//先安装以下插件
//go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
args := os.Args
if len(args) >= 2 {
//go run . component 编译组件proto
protoFolder = filepath.Join(protoFolder, args[1])
switch {
case args[1] == "component": //go run . component 编译组件proto
{
protocPath = filepath.Join(basePath, "protoc-23.1", "bin", "win64", "protoc")
protoFolder = filepath.Join(basePath, "src", args[1])
goOutDir = "../components"
}
}
}
//
protoFiles := getProtoFiles()
@ -49,7 +57,7 @@ func getProtoFiles() []string {
// 编译proto文件为Go文件
func compileProto(protoFiles []string) error {
for _, fileName := range protoFiles {
cmd := exec.Command(protocPath, "-I="+protoFolder, "--go_out=./", fileName)
cmd := exec.Command(protocPath, "-I="+protoFolder, fmt.Sprintf("--go_out=%s", goOutDir), fileName)
fmt.Println(cmd.String())
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

View File

@ -44,15 +44,7 @@ message SignalState{
//
SignalAspect display=1;
}
//
message SignalDisplayOperating{
//
bool startOperate = 1;
//ms
int64 operateTime = 2;
//
SignalAspect targetAspect = 3;
}
//
enum SignalAspect{
//

View File

@ -1,16 +0,0 @@
package model
import (
"joylink.club/rtsssimulation/umi"
)
// 计轴检测点模型
type AxlePointModel struct {
DeviceModel
//计轴检测点所在轨道
LinkOffset umi.ILinkOffsetRef
}
func NewAxlePointModel(id string) *AxlePointModel {
return &AxlePointModel{DeviceModel: DeviceModel{Id: id, Type: umi.AxlePoint}}
}

View File

@ -1,16 +0,0 @@
package model
import (
"joylink.club/rtsssimulation/umi"
)
// 应答器
type BaliseModel struct {
DeviceModel
//应答器所在轨道
LinkOffset umi.ILinkOffsetRef
}
func NewBaliseModel(id string) *BaliseModel {
return &BaliseModel{DeviceModel: DeviceModel{Id: id, Type: umi.Balise}}
}

View File

@ -1,14 +0,0 @@
package model
import "joylink.club/rtsssimulation/umi"
//两档位按钮
type TowPosButtonModel struct {
DeviceModel
// 按钮名称
Name string
}
func NewTowPosButtonModel(id string) *TowPosButtonModel {
return &TowPosButtonModel{DeviceModel: DeviceModel{Id: id, Type: umi.TowPosButton}}
}

View File

@ -1,23 +0,0 @@
package model
import (
"joylink.club/rtsssimulation/umi"
)
// 设备模型基础信息
type DeviceModel struct {
// 设备id
Id string
// 设备类型
Type umi.DeviceType
}
func (me *DeviceModel) GetId() string {
return me.Id
}
func (me *DeviceModel) IsSame(other umi.IDeviceModel) bool {
return me.Id == other.GetId()
}
func (me *DeviceModel) GetType() umi.DeviceType {
return me.Type
}

View File

@ -1,81 +0,0 @@
package model
import (
"joylink.club/rtsssimulation/umi"
)
// 长轨道,道岔端点间的轨道
type LinkModel struct {
DeviceModel
//轨道A端口连接的道岔
PortA umi.ISwitchRef
//轨道B端口连接的道岔
PortB umi.ISwitchRef
//长度,单位mm
Length int64
}
func NewLinkModel(id string) *LinkModel {
return &LinkModel{DeviceModel: DeviceModel{Id: id, Type: umi.Link}}
}
// 获取轨道长度单位mm
func (me *LinkModel) Len() int64 {
return me.Length
}
// 轨道A端连接的道岔
func (me *LinkModel) PortASwitch() umi.ISwitchRef {
return me.PortA
}
// 轨道B端连接的道岔
func (me *LinkModel) PortBSwitch() umi.ISwitchRef {
return me.PortB
}
///////////////////////////////////////////////////////
// 轨道端口引用
type LinkRef struct {
Link umi.ILinkModel
//引用轨道的端口
Port umi.PortEnum
}
func NewLinkRef(link *LinkModel, port umi.PortEnum) *LinkRef {
return &LinkRef{Link: link, Port: port}
}
// 被引用的轨道模型
func (me *LinkRef) LinkModel() umi.ILinkModel {
return me.Link
}
// 被引用的轨道的端口
func (me *LinkRef) LinkPort() umi.PortEnum {
return me.Port
}
///////////////////////////////////////////////////////////
// 轨道偏移位置引用轨道A端为偏移起始位置
type LinkOffsetRef struct {
Link umi.ILinkModel
//偏移位置单位mm
Offset int64
}
func NewLinkOffsetRef(link *LinkModel, offset int64) *LinkOffsetRef {
return &LinkOffsetRef{Link: link, Offset: offset}
}
// 被引用的轨道模型
func (me *LinkOffsetRef) LinkModel() umi.ILinkModel {
return me.Link
}
// 偏移量单位mm
func (me *LinkOffsetRef) GetOffset() int64 {
return me.Offset
}

View File

@ -1,56 +0,0 @@
package model
import (
"joylink.club/rtsssimulation/umi"
)
// 站台一侧屏蔽门模型
type PsdModel struct {
DeviceModel
//屏蔽门所包含的单元
Cells []*PsdCellModel
//屏蔽门移动从0-100耗时单位ms
MoveTime int64
}
func NewPsdModel(id string) *PsdModel {
return &PsdModel{DeviceModel: DeviceModel{Id: id, Type: umi.Psd}, Cells: make([]*PsdCellModel, 0)}
}
func (me *PsdModel) addCell(cell *PsdCellModel) {
me.Cells = append(me.Cells, cell)
}
// 屏蔽门移动从0-100耗时单位ms
func (me *PsdModel) MovingTime() int64 {
return me.MoveTime
}
// 屏蔽门的所有单元门
func (me *PsdModel) AllDeviceCells() []umi.IDeviceModel {
rt := make([]umi.IDeviceModel, 0, len(me.Cells))
for _, cell := range me.Cells {
rt = append(rt, cell)
}
return rt
}
/////////////////////////////////////////////
// 站台一侧屏蔽门单元模型
type PsdCellModel struct {
DeviceModel
//该屏蔽门单元所属的屏蔽门
psd umi.IDeviceModel
}
func NewPsdCellModel(id string, psdModel *PsdModel) *PsdCellModel {
cell := &PsdCellModel{
DeviceModel: DeviceModel{Id: id, Type: umi.PsdCell},
psd: psdModel,
}
psdModel.addCell(cell)
return cell
}
func (me *PsdCellModel) Psd() *PsdModel {
return me.psd.(*PsdModel)
}

View File

@ -1,21 +0,0 @@
package model
import (
"joylink.club/rtsssimulation/components/cstate"
"joylink.club/rtsssimulation/umi"
)
// 信号机
type SignalModel struct {
DeviceModel
//信号机所在轨道
LinkOffset *LinkOffsetRef
//信号机类型,出厂已确定,即几个色灯、排列顺序
Type cstate.SignalAspect
//默认显示信号
DefaultDisplay cstate.SignalAspect
}
func NewSignalModel(id string) *SignalModel {
return &SignalModel{DeviceModel: DeviceModel{Id: id, Type: umi.Signal}}
}

View File

@ -1,65 +0,0 @@
package model
import (
"joylink.club/rtsssimulation/umi"
)
// 道岔
type SwitchModel struct {
DeviceModel
//道岔A端口连接的轨道
PortA umi.ILinkRef
//道岔B端口连接的轨道
PortB umi.ILinkRef
//道岔C端口连接的轨道
PortC umi.ILinkRef
//道岔转动需要的时间(从开度0-100的时间),单位ms
TurnTime int64
}
func NewSwitchModel(id string) *SwitchModel {
return &SwitchModel{DeviceModel: DeviceModel{Id: id, Type: umi.Switch}}
}
// 道岔转动从0-100耗时单位ms
func (me *SwitchModel) TurningTime() int64 {
return me.TurnTime
}
// 道岔A端口连接的轨道
func (me *SwitchModel) PortALink() umi.ILinkRef {
return me.PortA
}
// 道岔B端口连接的轨道
func (me *SwitchModel) PortBLink() umi.ILinkRef {
return me.PortB
}
// 道岔C端口连接的轨道
func (me *SwitchModel) PortCLink() umi.ILinkRef {
return me.PortC
}
//////////////////////////////////////////////////////////
// 道岔端口引用
type SwitchRef struct {
Switch umi.ISwitchModel
//引用道岔的端口
Port umi.PortEnum
}
func NewSwitchRef(switchModel *SwitchModel, port umi.PortEnum) *SwitchRef {
return &SwitchRef{Switch: switchModel, Port: port}
}
// 被引用的道岔模型
func (me *SwitchRef) SwitchModel() umi.ISwitchModel {
return me.Switch
}
// 被引用的道岔的端口
func (me *SwitchRef) SwitchPort() umi.PortEnum {
return me.Port
}

View File

@ -0,0 +1,38 @@
package system
import (
"github.com/yohamta/donburi/filter"
"joylink.club/ecs"
"joylink.club/rtsssimulation/components"
"joylink.club/rtsssimulation/umi"
)
// 紧急停车按钮继电器系统
type EmpRelaySystem struct {
relaySystem
// 紧急停车按钮查询
query *ecs.Query
}
func NewEmpRelaySystem() *EmpRelaySystem {
return &EmpRelaySystem{
relaySystem: relaySystem{relayQuery: make(map[string]*ecs.Query)},
query: ecs.NewQuery(filter.Contains(components.EmpStateComponent)),
}
}
// world 执行
func (me *EmpRelaySystem) Update(world ecs.World) {
me.query.Each(world, func(empEntry *ecs.Entry) {
//key-继电器作用名value-继电器实体
usageRelayMapper := make(map[string]*ecs.Entry)
//迭代关联的所有继电器
me.getDeviceRelayQuery(empEntry).Each(world, func(empRelayEntry *ecs.Entry) {
relayId := components.DeviceIdentityComponent.Get(empRelayEntry).Id
relayModel := (WorldModelStorage(world).FindById(relayId)).(umi.IRelayModel)
usageRelayMapper[relayModel.UsageName()] = empRelayEntry
})
//根据具体业务逻辑处理继电器
})
}

View File

@ -7,7 +7,7 @@ import (
"joylink.club/rtsssimulation/components/cstate"
)
var PsdQuery = ecs.NewQuery(filter.Contains(components.DeviceIdentityComponent, components.PsdStateComponent, components.PsdTagHandlerComponent))
var PsdQuery = ecs.NewQuery(filter.Contains(components.PsdStateComponent, components.PsdTagHandlerComponent))
const (
//屏蔽门完全关闭

View File

@ -18,7 +18,7 @@ type SignalRelaySystem struct {
func NewSignalReplaySystem() *SignalRelaySystem {
return &SignalRelaySystem{
relaySystem: relaySystem{relayQuery: make(map[string]*ecs.Query)},
query: ecs.NewQuery(filter.Contains(components.DeviceIdentityComponent, components.SignalStateComponent)),
query: ecs.NewQuery(filter.Contains(components.SignalStateComponent)),
}
}

View File

@ -7,7 +7,7 @@ import (
"joylink.club/rtsssimulation/umi"
)
var SwitchQuery *ecs.Query = ecs.NewQuery(filter.Contains(components.DeviceIdentityComponent, components.SwitchRelayStateComponent, components.PercentageDeviceStateComponent))
var SwitchQuery *ecs.Query = ecs.NewQuery(filter.Contains(components.SwitchRelayStateComponent, components.PercentageDeviceStateComponent))
const (
//道岔定位