增加屏蔽门故障操作及逻辑

This commit is contained in:
joylink_zhangsai 2023-11-06 10:53:06 +08:00
parent 82dc5a6dcb
commit 01b16f30ef
5 changed files with 19 additions and 13 deletions

@ -1 +1 @@
Subproject commit 280219a91abaa9c58fd9979ad7340fe5d85caad1
Subproject commit ce7d7d49dc8e87dc93256eda90c0994105537421

View File

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

@ -1 +1 @@
Subproject commit d080a2a1fc3224f1a9c1696d57dad95635523956
Subproject commit dfe96a977ccb283510934a15dfa0f3303620c278

View File

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

View File

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