修改屏蔽门操作请求

This commit is contained in:
joylink_zhangsai 2024-01-23 18:02:39 +08:00
parent 007ec388b8
commit 4dfe137658
5 changed files with 304 additions and 159 deletions

@ -1 +1 @@
Subproject commit 54a5be2850fd4d1adccc6d155a2f9db0fac70d2f Subproject commit ed7e0605c52ba9e6234cc750c4adf9d7e1525cac

View File

@ -398,73 +398,18 @@ type Psd_Operation int32
const ( const (
Psd_Undefined Psd_Operation = 0 Psd_Undefined Psd_Operation = 0
// 屏蔽门控制 Psd_SetParams Psd_Operation = 1 // 设置参数
//
// Km4 = 1; //四编组开门
// CancelKm4 = 2; //取消四编组开门
// Km8 = 3; //八编组开门
// CancelKm8 = 4; //取消八编组开门
// Gm = 5; //关门
// CancelGm = 6; //取消关门
// ForceKm4 = 7; //强制四编组开门
// ForceKm8 = 8; //强制八编组开门
// ForceGm = 9; //强制关门
Psd_Km Psd_Operation = 1 //开门
Psd_CancelKm Psd_Operation = 2 //取消开门
Psd_Gm Psd_Operation = 3 //关门
Psd_CancelGm Psd_Operation = 4 //取消关门
Psd_ForceKm Psd_Operation = 5 //强制开门
Psd_ForceGm Psd_Operation = 6 //强制关门
Psd_CancelForce Psd_Operation = 10 //取消强制
// 屏蔽门故障
Psd_AsdCannotOpen Psd_Operation = 11 //滑动门无法开门
Psd_CancelAsdCannotOpen Psd_Operation = 12 //取消滑动门无法开门
Psd_AsdCannotClose Psd_Operation = 13 //滑动门无法关闭
Psd_CancelAsdCannotClose Psd_Operation = 14 //取消滑动门无法关闭
// 间隙探测
Psd_QDTC Psd_Operation = 15 //启动探测
Psd_CancelQDTC Psd_Operation = 16 //取消启动探测
Psd_TZTC Psd_Operation = 17 //停止探测
Psd_CancelTZTC Psd_Operation = 18 //取消停止探测
) )
// Enum value maps for Psd_Operation. // Enum value maps for Psd_Operation.
var ( var (
Psd_Operation_name = map[int32]string{ Psd_Operation_name = map[int32]string{
0: "Undefined", 0: "Undefined",
1: "Km", 1: "SetParams",
2: "CancelKm",
3: "Gm",
4: "CancelGm",
5: "ForceKm",
6: "ForceGm",
10: "CancelForce",
11: "AsdCannotOpen",
12: "CancelAsdCannotOpen",
13: "AsdCannotClose",
14: "CancelAsdCannotClose",
15: "QDTC",
16: "CancelQDTC",
17: "TZTC",
18: "CancelTZTC",
} }
Psd_Operation_value = map[string]int32{ Psd_Operation_value = map[string]int32{
"Undefined": 0, "Undefined": 0,
"Km": 1, "SetParams": 1,
"CancelKm": 2,
"Gm": 3,
"CancelGm": 4,
"ForceKm": 5,
"ForceGm": 6,
"CancelForce": 10,
"AsdCannotOpen": 11,
"CancelAsdCannotOpen": 12,
"AsdCannotClose": 13,
"CancelAsdCannotClose": 14,
"QDTC": 15,
"CancelQDTC": 16,
"TZTC": 17,
"CancelTZTC": 18,
} }
) )
@ -495,6 +440,101 @@ func (Psd_Operation) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{11, 0} return file_request_proto_rawDescGZIP(), []int{11, 0}
} }
type Psd_Force int32
const (
Psd_F_NONE Psd_Force = 0 //无强制
Psd_F_ASD_KM Psd_Force = 1 //滑动门强制开门
Psd_F_ASD_GM Psd_Force = 2 //滑动门强制关门
)
// Enum value maps for Psd_Force.
var (
Psd_Force_name = map[int32]string{
0: "F_NONE",
1: "F_ASD_KM",
2: "F_ASD_GM",
}
Psd_Force_value = map[string]int32{
"F_NONE": 0,
"F_ASD_KM": 1,
"F_ASD_GM": 2,
}
)
func (x Psd_Force) Enum() *Psd_Force {
p := new(Psd_Force)
*p = x
return p
}
func (x Psd_Force) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Psd_Force) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[8].Descriptor()
}
func (Psd_Force) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[8]
}
func (x Psd_Force) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Psd_Force.Descriptor instead.
func (Psd_Force) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{11, 1}
}
type Psd_Fault int32
const (
Psd_FA_NONE Psd_Fault = 0 //无故障
Psd_FA_Obstacle Psd_Fault = 1 //设置故障物
)
// Enum value maps for Psd_Fault.
var (
Psd_Fault_name = map[int32]string{
0: "FA_NONE",
1: "FA_Obstacle",
}
Psd_Fault_value = map[string]int32{
"FA_NONE": 0,
"FA_Obstacle": 1,
}
)
func (x Psd_Fault) Enum() *Psd_Fault {
p := new(Psd_Fault)
*p = x
return p
}
func (x Psd_Fault) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Psd_Fault) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[9].Descriptor()
}
func (Psd_Fault) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[9]
}
func (x Psd_Fault) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Psd_Fault.Descriptor instead.
func (Psd_Fault) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{11, 2}
}
// 继电器 // 继电器
type Relay struct { type Relay struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -1169,8 +1209,7 @@ type PsdOperationReq struct {
MapId int32 `protobuf:"varint,2,opt,name=mapId,proto3" json:"mapId,omitempty"` // 图id MapId int32 `protobuf:"varint,2,opt,name=mapId,proto3" json:"mapId,omitempty"` // 图id
DeviceId uint32 `protobuf:"varint,3,opt,name=deviceId,proto3" json:"deviceId,omitempty"` // 设备id DeviceId uint32 `protobuf:"varint,3,opt,name=deviceId,proto3" json:"deviceId,omitempty"` // 设备id
Operation Psd_Operation `protobuf:"varint,4,opt,name=operation,proto3,enum=request.Psd_Operation" json:"operation,omitempty"` // 操作 Operation Psd_Operation `protobuf:"varint,4,opt,name=operation,proto3,enum=request.Psd_Operation" json:"operation,omitempty"` // 操作
AsdCodes []int32 `protobuf:"varint,5,rep,packed,name=asdCodes,proto3" json:"asdCodes,omitempty"` //无法关闭/无法开启故障涉及的滑动门的编号 Param *PsdParam `protobuf:"bytes,5,opt,name=param,proto3" json:"param,omitempty"` // 屏蔽门参数,当operation为SetParams时有效
Group int32 `protobuf:"varint,6,opt,name=group,proto3" json:"group,omitempty"` //开门操作的编组
} }
func (x *PsdOperationReq) Reset() { func (x *PsdOperationReq) Reset() {
@ -1233,18 +1272,74 @@ func (x *PsdOperationReq) GetOperation() Psd_Operation {
return Psd_Undefined return Psd_Undefined
} }
func (x *PsdOperationReq) GetAsdCodes() []int32 { func (x *PsdOperationReq) GetParam() *PsdParam {
if x != nil {
return x.Param
}
return nil
}
type PsdParam struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AsdCodes []int32 `protobuf:"varint,1,rep,packed,name=asdCodes,proto3" json:"asdCodes,omitempty"` // 涉及的滑动门的编号
Force Psd_Force `protobuf:"varint,2,opt,name=force,proto3,enum=request.Psd_Force" json:"force,omitempty"` // 屏蔽门强制设置
Fault Psd_Fault `protobuf:"varint,3,opt,name=fault,proto3,enum=request.Psd_Fault" json:"fault,omitempty"` // 屏蔽门故障设置
}
func (x *PsdParam) Reset() {
*x = PsdParam{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PsdParam) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PsdParam) ProtoMessage() {}
func (x *PsdParam) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[13]
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 PsdParam.ProtoReflect.Descriptor instead.
func (*PsdParam) Descriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{13}
}
func (x *PsdParam) GetAsdCodes() []int32 {
if x != nil { if x != nil {
return x.AsdCodes return x.AsdCodes
} }
return nil return nil
} }
func (x *PsdOperationReq) GetGroup() int32 { func (x *PsdParam) GetForce() Psd_Force {
if x != nil { if x != nil {
return x.Group return x.Force
} }
return 0 return Psd_F_NONE
}
func (x *PsdParam) GetFault() Psd_Fault {
if x != nil {
return x.Fault
}
return Psd_FA_NONE
} }
var File_request_proto protoreflect.FileDescriptor var File_request_proto protoreflect.FileDescriptor
@ -1346,40 +1441,39 @@ var file_request_proto_rawDesc = []byte{
0x72, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x6f, 0x63, 0x6b, 0x44, 0x72, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x6f, 0x63, 0x6b, 0x44,
0x72, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x6f, 0x63, 0x6b, 0x50, 0x64, 0x72, 0x73, 0x74, 0x72, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x6f, 0x63, 0x6b, 0x50, 0x64, 0x72, 0x73, 0x74,
0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x6f, 0x63, 0x6b, 0x50, 0x64, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x6f, 0x63, 0x6b, 0x50, 0x64, 0x72, 0x73,
0x74, 0x22, 0x87, 0x02, 0x0a, 0x03, 0x50, 0x73, 0x64, 0x22, 0xff, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x74, 0x22, 0x88, 0x01, 0x0a, 0x03, 0x50, 0x73, 0x64, 0x22, 0x29, 0x0a, 0x09, 0x4f, 0x70, 0x65,
0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e, 0x64, 0x65, 0x66, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e, 0x64, 0x65, 0x66, 0x69,
0x69, 0x6e, 0x65, 0x64, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4b, 0x6d, 0x10, 0x01, 0x12, 0x0c, 0x6e, 0x65, 0x64, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61,
0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4b, 0x6d, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x6d, 0x73, 0x10, 0x01, 0x22, 0x2f, 0x0a, 0x05, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x0a, 0x0a,
0x47, 0x6d, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x47, 0x6d, 0x06, 0x46, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x5f, 0x41,
0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4b, 0x6d, 0x10, 0x05, 0x12, 0x53, 0x44, 0x5f, 0x4b, 0x4d, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x5f, 0x41, 0x53, 0x44,
0x0b, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x47, 0x6d, 0x10, 0x06, 0x12, 0x0f, 0x0a, 0x0b, 0x5f, 0x47, 0x4d, 0x10, 0x02, 0x22, 0x25, 0x0a, 0x05, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0b,
0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x11, 0x0a, 0x0a, 0x07, 0x46, 0x41, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x46,
0x0d, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x10, 0x0b, 0x41, 0x5f, 0x4f, 0x62, 0x73, 0x74, 0x61, 0x63, 0x6c, 0x65, 0x10, 0x01, 0x22, 0xc6, 0x01, 0x0a,
0x12, 0x17, 0x0a, 0x13, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x0f, 0x50, 0x73, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x6e, 0x6f, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x10, 0x0c, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x73, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64,
0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0x0d, 0x12, 0x18, 0x0a, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69,
0x14, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20,
0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0x0e, 0x12, 0x08, 0x0a, 0x04, 0x51, 0x44, 0x54, 0x43, 0x10, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65,
0x0f, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x51, 0x44, 0x54, 0x43, 0x10, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65,
0x10, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x5a, 0x54, 0x43, 0x10, 0x11, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x5a, 0x54, 0x43, 0x10, 0x12, 0x22, 0xcf, 0x01, 0x0a, 0x0f, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x71, 0x75,
0x50, 0x73, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x73, 0x64, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x22, 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x05,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65,
0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x73, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x05,
0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x7a, 0x0a, 0x08, 0x50, 0x73, 0x64, 0x50, 0x61, 0x72, 0x61,
0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x76, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20,
0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x03, 0x28, 0x05, 0x52, 0x08, 0x61, 0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x28, 0x0a,
0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x72,
0x73, 0x74, 0x2e, 0x50, 0x73, 0x64, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x73, 0x64, 0x2e, 0x46, 0x6f, 0x72, 0x63, 0x65,
0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74,
0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x50, 0x73, 0x64, 0x2e, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x66, 0x61, 0x75, 0x6c,
0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x30, 0x5a, 0x74, 0x42, 0x30, 0x5a, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75,
0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65,
0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72,
0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -1394,8 +1488,8 @@ func file_request_proto_rawDescGZIP() []byte {
return file_request_proto_rawDescData return file_request_proto_rawDescData
} }
var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 8) var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 10)
var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_request_proto_goTypes = []interface{}{ var file_request_proto_goTypes = []interface{}{
(Relay_Operation)(0), // 0: request.Relay.Operation (Relay_Operation)(0), // 0: request.Relay.Operation
(Points_Operation)(0), // 1: request.Points.Operation (Points_Operation)(0), // 1: request.Points.Operation
@ -1405,37 +1499,43 @@ var file_request_proto_goTypes = []interface{}{
(Signal_Force)(0), // 5: request.Signal.Force (Signal_Force)(0), // 5: request.Signal.Force
(Section_Operation)(0), // 6: request.Section.Operation (Section_Operation)(0), // 6: request.Section.Operation
(Psd_Operation)(0), // 7: request.Psd.Operation (Psd_Operation)(0), // 7: request.Psd.Operation
(*Relay)(nil), // 8: request.Relay (Psd_Force)(0), // 8: request.Psd.Force
(*RelayOperationReq)(nil), // 9: request.RelayOperationReq (Psd_Fault)(0), // 9: request.Psd.Fault
(*Points)(nil), // 10: request.Points (*Relay)(nil), // 10: request.Relay
(*PointsOperationReq)(nil), // 11: request.PointsOperationReq (*RelayOperationReq)(nil), // 11: request.RelayOperationReq
(*PointsParam)(nil), // 12: request.PointsParam (*Points)(nil), // 12: request.Points
(*Signal)(nil), // 13: request.Signal (*PointsOperationReq)(nil), // 13: request.PointsOperationReq
(*SignalOperationReq)(nil), // 14: request.SignalOperationReq (*PointsParam)(nil), // 14: request.PointsParam
(*SignalParam)(nil), // 15: request.SignalParam (*Signal)(nil), // 15: request.Signal
(*Section)(nil), // 16: request.Section (*SignalOperationReq)(nil), // 16: request.SignalOperationReq
(*SectionOperationReq)(nil), // 17: request.SectionOperationReq (*SignalParam)(nil), // 17: request.SignalParam
(*SectionParam)(nil), // 18: request.SectionParam (*Section)(nil), // 18: request.Section
(*Psd)(nil), // 19: request.Psd (*SectionOperationReq)(nil), // 19: request.SectionOperationReq
(*PsdOperationReq)(nil), // 20: request.PsdOperationReq (*SectionParam)(nil), // 20: request.SectionParam
(*Psd)(nil), // 21: request.Psd
(*PsdOperationReq)(nil), // 22: request.PsdOperationReq
(*PsdParam)(nil), // 23: request.PsdParam
} }
var file_request_proto_depIdxs = []int32{ var file_request_proto_depIdxs = []int32{
0, // 0: request.RelayOperationReq.operation:type_name -> request.Relay.Operation 0, // 0: request.RelayOperationReq.operation:type_name -> request.Relay.Operation
1, // 1: request.PointsOperationReq.operation:type_name -> request.Points.Operation 1, // 1: request.PointsOperationReq.operation:type_name -> request.Points.Operation
12, // 2: request.PointsOperationReq.param:type_name -> request.PointsParam 14, // 2: request.PointsOperationReq.param:type_name -> request.PointsParam
2, // 3: request.PointsParam.forcePosition:type_name -> request.Points.Force 2, // 3: request.PointsParam.forcePosition:type_name -> request.Points.Force
3, // 4: request.SignalOperationReq.operation:type_name -> request.Signal.Operation 3, // 4: request.SignalOperationReq.operation:type_name -> request.Signal.Operation
15, // 5: request.SignalOperationReq.param:type_name -> request.SignalParam 17, // 5: request.SignalOperationReq.param:type_name -> request.SignalParam
5, // 6: request.SignalParam.force:type_name -> request.Signal.Force 5, // 6: request.SignalParam.force:type_name -> request.Signal.Force
4, // 7: request.SignalParam.dsList:type_name -> request.Signal.DS 4, // 7: request.SignalParam.dsList:type_name -> request.Signal.DS
6, // 8: request.SectionOperationReq.operation:type_name -> request.Section.Operation 6, // 8: request.SectionOperationReq.operation:type_name -> request.Section.Operation
18, // 9: request.SectionOperationReq.param:type_name -> request.SectionParam 20, // 9: request.SectionOperationReq.param:type_name -> request.SectionParam
7, // 10: request.PsdOperationReq.operation:type_name -> request.Psd.Operation 7, // 10: request.PsdOperationReq.operation:type_name -> request.Psd.Operation
11, // [11:11] is the sub-list for method output_type 23, // 11: request.PsdOperationReq.param:type_name -> request.PsdParam
11, // [11:11] is the sub-list for method input_type 8, // 12: request.PsdParam.force:type_name -> request.Psd.Force
11, // [11:11] is the sub-list for extension type_name 9, // 13: request.PsdParam.fault:type_name -> request.Psd.Fault
11, // [11:11] is the sub-list for extension extendee 14, // [14:14] is the sub-list for method output_type
0, // [0:11] is the sub-list for field type_name 14, // [14:14] is the sub-list for method input_type
14, // [14:14] is the sub-list for extension type_name
14, // [14:14] is the sub-list for extension extendee
0, // [0:14] is the sub-list for field type_name
} }
func init() { file_request_proto_init() } func init() { file_request_proto_init() }
@ -1600,14 +1700,26 @@ func file_request_proto_init() {
return nil return nil
} }
} }
file_request_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PsdParam); 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{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_request_proto_rawDesc, RawDescriptor: file_request_proto_rawDesc,
NumEnums: 8, NumEnums: 10,
NumMessages: 13, NumMessages: 14,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

@ -1 +1 @@
Subproject commit fa7211d7bdf68be1df571f222a047ddd6cd764b0 Subproject commit 2879914757c66add547e417131f7127a7db856ee

View File

@ -9,4 +9,5 @@ var (
PointsParamType = ecs.NewComponentType[request_proto.PointsParam]() PointsParamType = ecs.NewComponentType[request_proto.PointsParam]()
SignalParamType = ecs.NewComponentType[request_proto.SignalParam]() SignalParamType = ecs.NewComponentType[request_proto.SignalParam]()
SectionParamType = ecs.NewComponentType[request_proto.SectionParam]() SectionParamType = ecs.NewComponentType[request_proto.SectionParam]()
PsdParamType = ecs.NewComponentType[request_proto.PsdParam]()
) )

View File

@ -4,43 +4,75 @@ import (
"fmt" "fmt"
"joylink.club/bj-rtsts-server/dto/data_proto" "joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto" "joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/rtsssimulation/component/component_proto" "joylink.club/bj-rtsts-server/sys_error"
"joylink.club/rtsssimulation/fi" appcomponent "joylink.club/bj-rtsts-server/ts/simulation/app_component"
"joylink.club/ecs"
"joylink.club/rtsssimulation/component"
"joylink.club/rtsssimulation/entity"
"unsafe"
) )
// 处理道岔操作 // HandlePsdOperation 处理屏蔽门操作
func HandlePsdOperation(simulation *VerifySimulation, req *request_proto.PsdOperationReq) error { func HandlePsdOperation(simulation *VerifySimulation, req *request_proto.PsdOperationReq) error {
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.ScreenDoor{})
switch req.Operation { switch req.Operation {
case request_proto.Psd_Km: case request_proto.Psd_SetParams:
return fi.SetInterlockKm(simulation.World, uid, req.Group) return setPsdParams(simulation, req)
case request_proto.Psd_CancelKm:
return fi.CancelInterlockKm(simulation.World, uid, req.Group)
case request_proto.Psd_Gm:
return fi.SetInterlockGm(simulation.World, uid)
case request_proto.Psd_CancelGm:
return fi.CancelInterlockGm(simulation.World, uid)
case request_proto.Psd_ForceKm:
case request_proto.Psd_ForceGm:
case request_proto.Psd_CancelForce:
case request_proto.Psd_AsdCannotClose:
return fi.SetPsdFault(simulation.World, uid, component_proto.Psd_AsdCannotClose, req.AsdCodes)
case request_proto.Psd_CancelAsdCannotClose:
return fi.CancelPsdFault(simulation.World, uid, component_proto.Psd_AsdCannotClose, req.AsdCodes)
case request_proto.Psd_AsdCannotOpen:
return fi.SetPsdFault(simulation.World, uid, component_proto.Psd_AsdCannotOpen, req.AsdCodes)
case request_proto.Psd_CancelAsdCannotOpen:
return fi.CancelPsdFault(simulation.World, uid, component_proto.Psd_AsdCannotOpen, req.AsdCodes)
case request_proto.Psd_QDTC:
return fi.SetQDTC(simulation.World, uid)
case request_proto.Psd_CancelQDTC:
return fi.CancelQDTC(simulation.World, uid)
case request_proto.Psd_TZTC:
return fi.SetTZTC(simulation.World, uid)
case request_proto.Psd_CancelTZTC:
return fi.CancelTZTC(simulation.World, uid)
default: default:
panic(fmt.Sprintf("未知的道岔操作:%s", req.Operation)) panic(fmt.Sprintf("未知的屏蔽门操作:%s", req.Operation))
} }
return nil return nil
} }
func setPsdParams(simulation *VerifySimulation, req *request_proto.PsdOperationReq) error {
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.ScreenDoor{})
result := <-ecs.Request[ecs.EmptyType](simulation.World, func() ecs.Result[ecs.EmptyType] {
wd := entity.GetWorldData(simulation.World)
entry, ok := wd.EntityMap[uid]
if ok {
if !entry.HasComponent(component.AsdListType) {
return ecs.NewErrResult(fmt.Errorf("屏蔽门[%s]没有滑动门", uid))
}
err := getEcsRequest(req)(entry)
if err != nil {
return ecs.NewErrResult(err)
}
} else {
return ecs.NewErrResult(fmt.Errorf("未找到id=%s的实体", uid))
}
return ecs.NewOkEmptyResult()
})
return result.Err
}
func getEcsRequest(req *request_proto.PsdOperationReq) func(e *ecs.Entry) error {
return func(e *ecs.Entry) error {
e.AddComponent(appcomponent.PsdParamType, unsafe.Pointer(req.Param))
asdList := component.AsdListType.Get(e)
asdMap := make(map[int32]bool)
for _, code := range req.Param.AsdCodes {
asdMap[code] = true
}
for i, asdEntry := range asdList.List {
if asdMap[int32(i+1)] == true {
if request_proto.Psd_FA_Obstacle == req.Param.Fault {
asdEntry.AddComponent(component.AsdHasObstacleTag)
} else if request_proto.Psd_FA_NONE == req.Param.Fault {
asdEntry.RemoveComponent(component.AsdHasObstacleTag)
} else {
return sys_error.New(fmt.Sprintf("未知的屏蔽门故障设置[%s]", req.Param.Fault.String()))
}
if request_proto.Psd_F_ASD_KM == req.Param.Force {
asdEntry.AddComponent(component.AsdForceType, unsafe.Pointer(&component.BitState{Val: true}))
} else if request_proto.Psd_F_ASD_GM == req.Param.Force {
asdEntry.AddComponent(component.AsdForceType, unsafe.Pointer(&component.BitState{Val: false}))
} else if request_proto.Psd_F_NONE == req.Param.Force {
asdEntry.RemoveComponent(component.AsdForceType)
}
} else {
asdEntry.RemoveComponent(component.AsdHasObstacleTag)
asdEntry.RemoveComponent(component.AsdForceType)
}
}
return nil
}
}