From 01b16f30efef8246acd0f0a6a49ed663da86c056 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 6 Nov 2023 10:53:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E9=97=A8=E6=95=85=E9=9A=9C=E6=93=8D=E4=BD=9C=E5=8F=8A=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bj-rtss-message | 2 +- message_server/sfp_ms.go | 3 +-- rtss_simulation | 2 +- ts/protos/state/device_state.pb.go | 14 +++++++------- ts/simulation/wayside/memory/wayside_memory_psd.go | 11 +++++++++-- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/bj-rtss-message b/bj-rtss-message index 280219a..ce7d7d4 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 280219a91abaa9c58fd9979ad7340fe5d85caad1 +Subproject commit ce7d7d49dc8e87dc93256eda90c0994105537421 diff --git a/message_server/sfp_ms.go b/message_server/sfp_ms.go index e2d5535..326ea07 100644 --- a/message_server/sfp_ms.go +++ b/message_server/sfp_ms.go @@ -2,7 +2,6 @@ package message_server import ( "fmt" - "strconv" "time" "google.golang.org/protobuf/proto" @@ -108,7 +107,7 @@ func (ms *SfpMs) collectPsdStates() ([]*state.PsdState, error) { for i, asdEntry := range list { asdState := component.AsdStateType.Get(asdEntry) asdStates[i] = &state.AsdState{ - Code: strconv.Itoa(i + 1), + Code: int32(i + 1), Kmdw: asdState.Kmdw, Gmdw: asdState.Gmdw, Mgj: asdState.Mgj, diff --git a/rtss_simulation b/rtss_simulation index d080a2a..dfe96a9 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit d080a2a1fc3224f1a9c1696d57dad95635523956 +Subproject commit dfe96a977ccb283510934a15dfa0f3303620c278 diff --git a/ts/protos/state/device_state.pb.go b/ts/protos/state/device_state.pb.go index 9539f9a..bfe1aef 100644 --- a/ts/protos/state/device_state.pb.go +++ b/ts/protos/state/device_state.pb.go @@ -1707,10 +1707,10 @@ type AsdState struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` //滑动门的编号 - Kmdw bool `protobuf:"varint,2,opt,name=kmdw,proto3" json:"kmdw,omitempty"` //开门到位(实际位置) - Gmdw bool `protobuf:"varint,3,opt,name=gmdw,proto3" json:"gmdw,omitempty"` //关门到位(实际位置) - Mgj bool `protobuf:"varint,4,opt,name=mgj,proto3" json:"mgj,omitempty"` //门关继电器 + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` //滑动门的编号 + Kmdw bool `protobuf:"varint,2,opt,name=kmdw,proto3" json:"kmdw,omitempty"` //开门到位(实际位置) + Gmdw bool `protobuf:"varint,3,opt,name=gmdw,proto3" json:"gmdw,omitempty"` //关门到位(实际位置) + Mgj bool `protobuf:"varint,4,opt,name=mgj,proto3" json:"mgj,omitempty"` //门关继电器 } func (x *AsdState) Reset() { @@ -1745,11 +1745,11 @@ func (*AsdState) Descriptor() ([]byte, []int) { return file_device_state_proto_rawDescGZIP(), []int{15} } -func (x *AsdState) GetCode() string { +func (x *AsdState) GetCode() int32 { if x != nil { return x.Code } - return "" + return 0 } func (x *AsdState) GetKmdw() bool { @@ -2494,7 +2494,7 @@ var file_device_state_proto_rawDesc = []byte{ 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x67, 0x6a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6d, 0x67, 0x6a, 0x22, 0x58, 0x0a, 0x08, 0x41, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x6d, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x6d, 0x64, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6b, 0x6d, 0x64, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6d, 0x64, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x67, 0x6d, 0x64, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x67, 0x6a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, diff --git a/ts/simulation/wayside/memory/wayside_memory_psd.go b/ts/simulation/wayside/memory/wayside_memory_psd.go index 3de4e49..5e5299d 100644 --- a/ts/simulation/wayside/memory/wayside_memory_psd.go +++ b/ts/simulation/wayside/memory/wayside_memory_psd.go @@ -4,6 +4,7 @@ import ( "fmt" "joylink.club/bj-rtsts-server/dto/request_proto" "joylink.club/bj-rtsts-server/ts/protos/graphicData" + "joylink.club/rtsssimulation/component/component_proto" "joylink.club/rtsssimulation/fi" ) @@ -24,10 +25,16 @@ func HandlePsdOperation(simulation *VerifySimulation, req *request_proto.PsdOper case request_proto.Psd_CancelGm: return fi.CancelInterlockGm(simulation.World, uid) case request_proto.Psd_ForceKm4: - case request_proto.Psd_ForceKm8: - case request_proto.Psd_ForceGm: + 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) default: panic(fmt.Sprintf("未知的道岔操作:%s", req.Operation)) } From 3c76b468b29267d510c7558161515ac33b5fe7b8 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 6 Nov 2023 13:54:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E9=97=A8=E6=95=85=E9=9A=9C=E6=93=8D=E4=BD=9Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dto/request_proto/request.pb.go | 70 ++++++++++--------- .../wayside/memory/wayside_memory_psd.go | 1 + 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/dto/request_proto/request.pb.go b/dto/request_proto/request.pb.go index a4f5a09..dafcb1d 100644 --- a/dto/request_proto/request.pb.go +++ b/dto/request_proto/request.pb.go @@ -246,10 +246,11 @@ const ( Psd_ForceKm4 Psd_Operation = 7 //强制四编组开门 Psd_ForceKm8 Psd_Operation = 8 //强制八编组开门 Psd_ForceGm Psd_Operation = 9 //强制关门 - Psd_AsdCannotOpen Psd_Operation = 10 //滑动门无法开门 - Psd_CancelAsdCannotOpen Psd_Operation = 11 //取消滑动门无法开门 - Psd_AsdCannotClose Psd_Operation = 12 //滑动门无法关闭 - Psd_CancelAsdCannotClose Psd_Operation = 13 //取消滑动门无法关闭 + 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 //取消滑动门无法关闭 ) // Enum value maps for Psd_Operation. @@ -265,10 +266,11 @@ var ( 7: "ForceKm4", 8: "ForceKm8", 9: "ForceGm", - 10: "AsdCannotOpen", - 11: "CancelAsdCannotOpen", - 12: "AsdCannotClose", - 13: "CancelAsdCannotClose", + 10: "CancelForce", + 11: "AsdCannotOpen", + 12: "CancelAsdCannotOpen", + 13: "AsdCannotClose", + 14: "CancelAsdCannotClose", } Psd_Operation_value = map[string]int32{ "Undefined": 0, @@ -281,10 +283,11 @@ var ( "ForceKm4": 7, "ForceKm8": 8, "ForceGm": 9, - "AsdCannotOpen": 10, - "CancelAsdCannotOpen": 11, - "AsdCannotClose": 12, - "CancelAsdCannotClose": 13, + "CancelForce": 10, + "AsdCannotOpen": 11, + "CancelAsdCannotOpen": 12, + "AsdCannotClose": 13, + "CancelAsdCannotClose": 14, } ) @@ -672,7 +675,7 @@ var file_request_proto_rawDesc = []byte{ 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x64, 0x72, 0x73, 0x74, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x63, 0x63, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x63, - 0x63, 0x10, 0x05, 0x22, 0xeb, 0x01, 0x0a, 0x03, 0x50, 0x73, 0x64, 0x22, 0xe3, 0x01, 0x0a, 0x09, + 0x63, 0x10, 0x05, 0x22, 0xfc, 0x01, 0x0a, 0x03, 0x50, 0x73, 0x64, 0x22, 0xf4, 0x01, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4b, 0x6d, 0x34, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4b, 0x6d, 0x34, 0x10, 0x02, @@ -681,26 +684,27 @@ var file_request_proto_rawDesc = []byte{ 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x47, 0x6d, 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4b, 0x6d, 0x34, 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4b, 0x6d, 0x38, 0x10, 0x08, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x6f, - 0x72, 0x63, 0x65, 0x47, 0x6d, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x73, 0x64, 0x43, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x10, 0x0a, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x4f, 0x70, 0x65, - 0x6e, 0x10, 0x0b, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0x0c, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, - 0x0d, 0x22, 0xb9, 0x01, 0x0a, 0x0f, 0x50, 0x73, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x69, 0x6d, - 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x70, - 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x12, - 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x09, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, - 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x73, 0x64, 0x2e, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x05, 0x52, 0x08, 0x61, 0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x15, 0x5a, - 0x13, 0x2e, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x63, 0x65, 0x47, 0x6d, 0x10, 0x09, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x73, 0x64, 0x43, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x10, 0x0b, 0x12, 0x17, 0x0a, 0x13, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x4f, 0x70, + 0x65, 0x6e, 0x10, 0x0c, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0x0d, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x41, 0x73, 0x64, 0x43, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x43, 0x6c, 0x6f, 0x73, 0x65, + 0x10, 0x0e, 0x22, 0xb9, 0x01, 0x0a, 0x0f, 0x50, 0x73, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x69, + 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, + 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x09, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x16, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x73, 0x64, 0x2e, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x61, 0x73, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x15, + 0x5a, 0x13, 0x2e, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/ts/simulation/wayside/memory/wayside_memory_psd.go b/ts/simulation/wayside/memory/wayside_memory_psd.go index 5e5299d..9e939fe 100644 --- a/ts/simulation/wayside/memory/wayside_memory_psd.go +++ b/ts/simulation/wayside/memory/wayside_memory_psd.go @@ -27,6 +27,7 @@ func HandlePsdOperation(simulation *VerifySimulation, req *request_proto.PsdOper case request_proto.Psd_ForceKm4: case request_proto.Psd_ForceKm8: 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: