列车控制调整

This commit is contained in:
tiger_zhou 2024-05-09 14:36:13 +08:00
parent 0b25327b28
commit 6fa4c6e6a9
5 changed files with 219 additions and 137 deletions

View File

@ -236,7 +236,7 @@ type TrainEndsState struct {
SpeedSensorEnableB bool `protobuf:"varint,2,opt,name=speedSensorEnableB,proto3" json:"speedSensorEnableB,omitempty"`
// 雷达是否有效
RadarEnable bool `protobuf:"varint,3,opt,name=radarEnable,proto3" json:"radarEnable,omitempty"`
// 雷达测速差值(米/秒
// 雷达测速差值(千米/小时
RadarCheckSpeedDiff float32 `protobuf:"fixed32,4,opt,name=radarCheckSpeedDiff,proto3" json:"radarCheckSpeedDiff,omitempty"`
// 雷达检测时间(秒)
RadarCheckTime int32 `protobuf:"varint,5,opt,name=radarCheckTime,proto3" json:"radarCheckTime,omitempty"`
@ -246,9 +246,9 @@ type TrainEndsState struct {
AccCheckSpeedDiff float32 `protobuf:"fixed32,7,opt,name=accCheckSpeedDiff,proto3" json:"accCheckSpeedDiff,omitempty"`
// 加速度持续时间
AccCheckTime int32 `protobuf:"varint,8,opt,name=accCheckTime,proto3" json:"accCheckTime,omitempty"`
// 速传速度输出(米/秒
// 速传速度输出(千米/小时
AccOutSpeed int32 `protobuf:"varint,9,opt,name=accOutSpeed,proto3" json:"accOutSpeed,omitempty"`
// 雷达速度输出(米/秒
// 雷达速度输出(千米/小时
RadarOutSpeed int32 `protobuf:"varint,10,opt,name=radarOutSpeed,proto3" json:"radarOutSpeed,omitempty"`
// 记录雷达设置检测时间的时间点,用于计算周期内的数字
RadarCheckTimeOverAt int64 `protobuf:"varint,11,opt,name=radarCheckTimeOverAt,proto3" json:"radarCheckTimeOverAt,omitempty"`

View File

@ -587,6 +587,55 @@ func (TrainControl_TrainControlType) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{14, 0}
}
type TrainControl_Direction int32
const (
TrainControl_BACKWARD TrainControl_Direction = 0 //后退
TrainControl_FORWARD TrainControl_Direction = 1 //前进
TrainControl_NEUTRALWARD TrainControl_Direction = 2 //中位
)
// Enum value maps for TrainControl_Direction.
var (
TrainControl_Direction_name = map[int32]string{
0: "BACKWARD",
1: "FORWARD",
2: "NEUTRALWARD",
}
TrainControl_Direction_value = map[string]int32{
"BACKWARD": 0,
"FORWARD": 1,
"NEUTRALWARD": 2,
}
)
func (x TrainControl_Direction) Enum() *TrainControl_Direction {
p := new(TrainControl_Direction)
*p = x
return p
}
func (x TrainControl_Direction) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (TrainControl_Direction) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[11].Descriptor()
}
func (TrainControl_Direction) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[11]
}
func (x TrainControl_Direction) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use TrainControl_Direction.Descriptor instead.
func (TrainControl_Direction) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{14, 1}
}
type Ckm_Operation int32
const (
@ -617,11 +666,11 @@ func (x Ckm_Operation) String() string {
}
func (Ckm_Operation) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[11].Descriptor()
return file_request_proto_enumTypes[12].Descriptor()
}
func (Ckm_Operation) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[11]
return &file_request_proto_enumTypes[12]
}
func (x Ckm_Operation) Number() protoreflect.EnumNumber {
@ -666,11 +715,11 @@ func (x Ckm_Force) String() string {
}
func (Ckm_Force) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[12].Descriptor()
return file_request_proto_enumTypes[13].Descriptor()
}
func (Ckm_Force) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[12]
return &file_request_proto_enumTypes[13]
}
func (x Ckm_Force) Number() protoreflect.EnumNumber {
@ -712,11 +761,11 @@ func (x Ckm_Fault) String() string {
}
func (Ckm_Fault) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[13].Descriptor()
return file_request_proto_enumTypes[14].Descriptor()
}
func (Ckm_Fault) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[13]
return &file_request_proto_enumTypes[14]
}
func (x Ckm_Fault) Number() protoreflect.EnumNumber {
@ -758,11 +807,11 @@ func (x Xcj_Operation) String() string {
}
func (Xcj_Operation) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[14].Descriptor()
return file_request_proto_enumTypes[15].Descriptor()
}
func (Xcj_Operation) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[14]
return &file_request_proto_enumTypes[15]
}
func (x Xcj_Operation) Number() protoreflect.EnumNumber {
@ -804,11 +853,11 @@ func (x Xcj_Fault) String() string {
}
func (Xcj_Fault) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[15].Descriptor()
return file_request_proto_enumTypes[16].Descriptor()
}
func (Xcj_Fault) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[15]
return &file_request_proto_enumTypes[16]
}
func (x Xcj_Fault) Number() protoreflect.EnumNumber {
@ -2386,7 +2435,7 @@ var file_request_proto_rawDesc = []byte{
0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x2e, 0x50, 0x73, 0x64, 0x2e, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x66, 0x61, 0x75, 0x6c,
0x74, 0x22, 0xb3, 0x05, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72,
0x74, 0x22, 0xec, 0x05, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72,
0x6f, 0x6c, 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, 0x18, 0x0a, 0x07, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x49,
@ -2429,59 +2478,62 @@ var file_request_proto_rawDesc = []byte{
0x56, 0x45, 0x52, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x10, 0x01,
0x12, 0x18, 0x0a, 0x14, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4b, 0x45,
0x59, 0x5f, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x41,
0x4e, 0x44, 0x4c, 0x45, 0x52, 0x10, 0x03, 0x22, 0xc6, 0x01, 0x0a, 0x0f, 0x43, 0x6b, 0x6d, 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, 0x0d, 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, 0x43,
0x6b, 0x6d, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70,
0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x2e, 0x43, 0x6b, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x22, 0x82, 0x01, 0x0a, 0x03, 0x43, 0x6b, 0x6d, 0x22, 0x29, 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, 0x0d, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x73, 0x10, 0x01, 0x22, 0x27, 0x0a, 0x05, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x0a, 0x0a, 0x06,
0x46, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x5f, 0x4b, 0x4d,
0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x5f, 0x47, 0x4d, 0x10, 0x02, 0x22, 0x27, 0x0a, 0x05,
0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x41, 0x5f, 0x4e, 0x4f, 0x4e, 0x45,
0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x41, 0x5f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x4c,
0x6f, 0x73, 0x73, 0x10, 0x01, 0x22, 0x5e, 0x0a, 0x08, 0x43, 0x6b, 0x6d, 0x50, 0x61, 0x72, 0x61,
0x6d, 0x12, 0x28, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
0x32, 0x12, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6b, 0x6d, 0x2e, 0x46,
0x6f, 0x72, 0x63, 0x65, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x66,
0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6b, 0x6d, 0x2e, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x05,
0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0xc6, 0x01, 0x0a, 0x0f, 0x58, 0x63, 0x6a, 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, 0x0d, 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, 0x58, 0x63, 0x6a,
0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x58,
0x63, 0x6a, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x54,
0x0a, 0x03, 0x58, 0x63, 0x6a, 0x22, 0x29, 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, 0x0d, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x10, 0x01,
0x22, 0x22, 0x0a, 0x05, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x41, 0x5f,
0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x41, 0x5f, 0x46, 0x61, 0x75,
0x6c, 0x74, 0x10, 0x01, 0x22, 0x34, 0x0a, 0x08, 0x58, 0x63, 0x6a, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x12, 0x28, 0x0a, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x12, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x58, 0x63, 0x6a, 0x2e, 0x46, 0x61,
0x75, 0x6c, 0x74, 0x52, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x30, 0x5a, 0x2e, 0x6a, 0x6f,
0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74,
0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 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,
0x4e, 0x44, 0x4c, 0x45, 0x52, 0x10, 0x03, 0x22, 0x37, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x41, 0x43, 0x4b, 0x57, 0x41, 0x52, 0x44,
0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4f, 0x52, 0x57, 0x41, 0x52, 0x44, 0x10, 0x01, 0x12,
0x0f, 0x0a, 0x0b, 0x4e, 0x45, 0x55, 0x54, 0x52, 0x41, 0x4c, 0x57, 0x41, 0x52, 0x44, 0x10, 0x02,
0x22, 0xc6, 0x01, 0x0a, 0x0f, 0x43, 0x6b, 0x6d, 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, 0x0d,
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, 0x43, 0x6b, 0x6d, 0x2e, 0x4f, 0x70, 0x65, 0x72,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x11, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6b, 0x6d, 0x50, 0x61, 0x72,
0x61, 0x6d, 0x52, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x82, 0x01, 0x0a, 0x03, 0x43, 0x6b,
0x6d, 0x22, 0x29, 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, 0x0d, 0x0a,
0x09, 0x53, 0x65, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x10, 0x01, 0x22, 0x27, 0x0a, 0x05,
0x46, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10,
0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x5f, 0x4b, 0x4d, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46,
0x5f, 0x47, 0x4d, 0x10, 0x02, 0x22, 0x27, 0x0a, 0x05, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0b,
0x0a, 0x07, 0x46, 0x41, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x46,
0x41, 0x5f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x4c, 0x6f, 0x73, 0x73, 0x10, 0x01, 0x22, 0x5e,
0x0a, 0x08, 0x43, 0x6b, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x28, 0x0a, 0x05, 0x66, 0x6f,
0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x2e, 0x43, 0x6b, 0x6d, 0x2e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x05, 0x66,
0x6f, 0x72, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6b,
0x6d, 0x2e, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0xc6,
0x01, 0x0a, 0x0f, 0x58, 0x63, 0x6a, 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, 0x0d, 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, 0x58, 0x63, 0x6a, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27,
0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x58, 0x63, 0x6a, 0x50, 0x61, 0x72, 0x61, 0x6d,
0x52, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x54, 0x0a, 0x03, 0x58, 0x63, 0x6a, 0x22, 0x29,
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, 0x0d, 0x0a, 0x09, 0x53, 0x65,
0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x10, 0x01, 0x22, 0x22, 0x0a, 0x05, 0x46, 0x61, 0x75,
0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x41, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12,
0x0c, 0x0a, 0x08, 0x46, 0x41, 0x5f, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x10, 0x01, 0x22, 0x34, 0x0a,
0x08, 0x58, 0x63, 0x6a, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x28, 0x0a, 0x05, 0x66, 0x61, 0x75,
0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x2e, 0x58, 0x63, 0x6a, 0x2e, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x66, 0x61,
0x75, 0x6c, 0x74, 0x42, 0x30, 0x5a, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63,
0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 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 (
@ -2496,7 +2548,7 @@ func file_request_proto_rawDescGZIP() []byte {
return file_request_proto_rawDescData
}
var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 16)
var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 17)
var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 25)
var file_request_proto_goTypes = []interface{}{
(Relay_Operation)(0), // 0: request.Relay.Operation
@ -2510,64 +2562,65 @@ var file_request_proto_goTypes = []interface{}{
(Psd_Force)(0), // 8: request.Psd.Force
(Psd_Fault)(0), // 9: request.Psd.Fault
(TrainControl_TrainControlType)(0), // 10: request.TrainControl.TrainControlType
(Ckm_Operation)(0), // 11: request.Ckm.Operation
(Ckm_Force)(0), // 12: request.Ckm.Force
(Ckm_Fault)(0), // 13: request.Ckm.Fault
(Xcj_Operation)(0), // 14: request.Xcj.Operation
(Xcj_Fault)(0), // 15: request.Xcj.Fault
(*Relay)(nil), // 16: request.Relay
(*RelayOperationReq)(nil), // 17: request.RelayOperationReq
(*Points)(nil), // 18: request.Points
(*PointsOperationReq)(nil), // 19: request.PointsOperationReq
(*PointsParam)(nil), // 20: request.PointsParam
(*Signal)(nil), // 21: request.Signal
(*SignalOperationReq)(nil), // 22: request.SignalOperationReq
(*SignalParam)(nil), // 23: request.SignalParam
(*Section)(nil), // 24: request.Section
(*SectionOperationReq)(nil), // 25: request.SectionOperationReq
(*SectionParam)(nil), // 26: request.SectionParam
(*Psd)(nil), // 27: request.Psd
(*PsdOperationReq)(nil), // 28: request.PsdOperationReq
(*PsdParam)(nil), // 29: request.PsdParam
(*TrainControl)(nil), // 30: request.TrainControl
(*CkmOperationReq)(nil), // 31: request.CkmOperationReq
(*Ckm)(nil), // 32: request.Ckm
(*CkmParam)(nil), // 33: request.CkmParam
(*XcjOperationReq)(nil), // 34: request.XcjOperationReq
(*Xcj)(nil), // 35: request.Xcj
(*XcjParam)(nil), // 36: request.XcjParam
(*TrainControl_EmergentButton)(nil), // 37: request.TrainControl.EmergentButton
(*TrainControl_DriverKeySwitch)(nil), // 38: request.TrainControl.DriverKeySwitch
(*TrainControl_DirectionKeySwitch)(nil), // 39: request.TrainControl.DirectionKeySwitch
(*TrainControl_PushHandler)(nil), // 40: request.TrainControl.PushHandler
(TrainControl_Direction)(0), // 11: request.TrainControl.Direction
(Ckm_Operation)(0), // 12: request.Ckm.Operation
(Ckm_Force)(0), // 13: request.Ckm.Force
(Ckm_Fault)(0), // 14: request.Ckm.Fault
(Xcj_Operation)(0), // 15: request.Xcj.Operation
(Xcj_Fault)(0), // 16: request.Xcj.Fault
(*Relay)(nil), // 17: request.Relay
(*RelayOperationReq)(nil), // 18: request.RelayOperationReq
(*Points)(nil), // 19: request.Points
(*PointsOperationReq)(nil), // 20: request.PointsOperationReq
(*PointsParam)(nil), // 21: request.PointsParam
(*Signal)(nil), // 22: request.Signal
(*SignalOperationReq)(nil), // 23: request.SignalOperationReq
(*SignalParam)(nil), // 24: request.SignalParam
(*Section)(nil), // 25: request.Section
(*SectionOperationReq)(nil), // 26: request.SectionOperationReq
(*SectionParam)(nil), // 27: request.SectionParam
(*Psd)(nil), // 28: request.Psd
(*PsdOperationReq)(nil), // 29: request.PsdOperationReq
(*PsdParam)(nil), // 30: request.PsdParam
(*TrainControl)(nil), // 31: request.TrainControl
(*CkmOperationReq)(nil), // 32: request.CkmOperationReq
(*Ckm)(nil), // 33: request.Ckm
(*CkmParam)(nil), // 34: request.CkmParam
(*XcjOperationReq)(nil), // 35: request.XcjOperationReq
(*Xcj)(nil), // 36: request.Xcj
(*XcjParam)(nil), // 37: request.XcjParam
(*TrainControl_EmergentButton)(nil), // 38: request.TrainControl.EmergentButton
(*TrainControl_DriverKeySwitch)(nil), // 39: request.TrainControl.DriverKeySwitch
(*TrainControl_DirectionKeySwitch)(nil), // 40: request.TrainControl.DirectionKeySwitch
(*TrainControl_PushHandler)(nil), // 41: request.TrainControl.PushHandler
}
var file_request_proto_depIdxs = []int32{
0, // 0: request.RelayOperationReq.operation:type_name -> request.Relay.Operation
1, // 1: request.PointsOperationReq.operation:type_name -> request.Points.Operation
20, // 2: request.PointsOperationReq.param:type_name -> request.PointsParam
21, // 2: request.PointsOperationReq.param:type_name -> request.PointsParam
2, // 3: request.PointsParam.forcePosition:type_name -> request.Points.Force
3, // 4: request.SignalOperationReq.operation:type_name -> request.Signal.Operation
23, // 5: request.SignalOperationReq.param:type_name -> request.SignalParam
24, // 5: request.SignalOperationReq.param:type_name -> request.SignalParam
5, // 6: request.SignalParam.force:type_name -> request.Signal.Force
4, // 7: request.SignalParam.dsList:type_name -> request.Signal.DS
6, // 8: request.SectionOperationReq.operation:type_name -> request.Section.Operation
26, // 9: request.SectionOperationReq.param:type_name -> request.SectionParam
27, // 9: request.SectionOperationReq.param:type_name -> request.SectionParam
7, // 10: request.PsdOperationReq.operation:type_name -> request.Psd.Operation
29, // 11: request.PsdOperationReq.param:type_name -> request.PsdParam
30, // 11: request.PsdOperationReq.param:type_name -> request.PsdParam
8, // 12: request.PsdParam.force:type_name -> request.Psd.Force
9, // 13: request.PsdParam.fault:type_name -> request.Psd.Fault
10, // 14: request.TrainControl.controlType:type_name -> request.TrainControl.TrainControlType
37, // 15: request.TrainControl.button:type_name -> request.TrainControl.EmergentButton
38, // 16: request.TrainControl.driverKey:type_name -> request.TrainControl.DriverKeySwitch
39, // 17: request.TrainControl.dirKey:type_name -> request.TrainControl.DirectionKeySwitch
40, // 18: request.TrainControl.handler:type_name -> request.TrainControl.PushHandler
11, // 19: request.CkmOperationReq.operation:type_name -> request.Ckm.Operation
33, // 20: request.CkmOperationReq.param:type_name -> request.CkmParam
12, // 21: request.CkmParam.force:type_name -> request.Ckm.Force
13, // 22: request.CkmParam.fault:type_name -> request.Ckm.Fault
14, // 23: request.XcjOperationReq.operation:type_name -> request.Xcj.Operation
36, // 24: request.XcjOperationReq.param:type_name -> request.XcjParam
15, // 25: request.XcjParam.fault:type_name -> request.Xcj.Fault
38, // 15: request.TrainControl.button:type_name -> request.TrainControl.EmergentButton
39, // 16: request.TrainControl.driverKey:type_name -> request.TrainControl.DriverKeySwitch
40, // 17: request.TrainControl.dirKey:type_name -> request.TrainControl.DirectionKeySwitch
41, // 18: request.TrainControl.handler:type_name -> request.TrainControl.PushHandler
12, // 19: request.CkmOperationReq.operation:type_name -> request.Ckm.Operation
34, // 20: request.CkmOperationReq.param:type_name -> request.CkmParam
13, // 21: request.CkmParam.force:type_name -> request.Ckm.Force
14, // 22: request.CkmParam.fault:type_name -> request.Ckm.Fault
15, // 23: request.XcjOperationReq.operation:type_name -> request.Xcj.Operation
37, // 24: request.XcjOperationReq.param:type_name -> request.XcjParam
16, // 25: request.XcjParam.fault:type_name -> request.Xcj.Fault
26, // [26:26] is the sub-list for method output_type
26, // [26:26] is the sub-list for method input_type
26, // [26:26] is the sub-list for extension type_name
@ -2887,7 +2940,7 @@ func file_request_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_request_proto_rawDesc,
NumEnums: 16,
NumEnums: 17,
NumMessages: 25,
NumExtensions: 0,
NumServices: 0,

View File

@ -3211,7 +3211,7 @@ type TrainEndsStateMqtt struct {
SpeedSensorEnableB bool `protobuf:"varint,2,opt,name=speedSensorEnableB,proto3" json:"speedSensorEnableB,omitempty"`
// 雷达是否有效
RadarEnable bool `protobuf:"varint,3,opt,name=radarEnable,proto3" json:"radarEnable,omitempty"`
// 雷达测速差值(米/秒 原本数据float
// 雷达测速差值(千米/小时 原本数据float
RadarCheckSpeedDiff string `protobuf:"bytes,4,opt,name=radarCheckSpeedDiff,proto3" json:"radarCheckSpeedDiff,omitempty"`
// 雷达检测时间(秒)
RadarCheckTime int32 `protobuf:"varint,5,opt,name=radarCheckTime,proto3" json:"radarCheckTime,omitempty"`
@ -3220,9 +3220,9 @@ type TrainEndsStateMqtt struct {
AccCheckSpeedDiff string `protobuf:"bytes,7,opt,name=accCheckSpeedDiff,proto3" json:"accCheckSpeedDiff,omitempty"`
// 加速度持续时间
AccCheckTime int32 `protobuf:"varint,8,opt,name=accCheckTime,proto3" json:"accCheckTime,omitempty"`
// 速传速度输出(米/秒
// 速传速度输出(千米/小时
AccOutSpeed int32 `protobuf:"varint,9,opt,name=accOutSpeed,proto3" json:"accOutSpeed,omitempty"`
// 雷达速度输出(米/秒
// 雷达速度输出(千米/小时
RadarOutSpeed int32 `protobuf:"varint,10,opt,name=radarOutSpeed,proto3" json:"radarOutSpeed,omitempty"`
}

View File

@ -98,11 +98,13 @@ func AddTrainStateNew(vs *VerifySimulation, status *state_proto.TrainState, conf
if tl <= 0 {
tl = DEFULAT_TRAIN_LOAD
}
status.VobcState = &state_proto.TrainVobcState{Tc1Active: true, TrainLoad: int64(tl), BrakingStatus: true, BrakeForce: DEFAULT_BRAKE_FORCE, DirectionForward: true}
if !status.RunDirection {
status.VobcState.Tc1Active = false
status.VobcState.Tc2Active = true
status.VobcState = &state_proto.TrainVobcState{TrainLoad: int64(tl), BrakingStatus: true, BrakeForce: DEFAULT_BRAKE_FORCE, DirectionForward: true}
//status.VobcState.HistoryDir = request_proto.TrainControl_FORWARD
if status.RunDirection {
status.VobcState.Tc1Active = true
} else {
status.VobcState.Tc2Active = true
}
status.Tcc = initTrainTcc(vs, status.RunDirection)
@ -299,7 +301,7 @@ func UpdateTrainStateByDynamics(vs *VerifySimulation, trainId string, info *mess
panic(sys_error.New("动力学传输数据:列车车头位置计算出错", e1))
}
runDirection, pointTo := QueryDirectionAndABByDevice(vs.Repo, id, port, info.Up)
//slog.Debug("处理动力学转换后的消息", "number", info.Number, "车头位置", id, "偏移", offset, "是否上行", runDirection, "是否ab", pointTo)
//slog.Debug("处理动力学转换后的消息", "number", info.Number, "Link", info.Link, "车头位置", id, "偏移", offset, "是否上行", runDirection, "是否ab", pointTo)
// 车尾相对车头link的偏移量
calctailOffset := calcTrailTailOffset(outLinkOffset, int64(info.Len), info.Up)
tailLinkId, tailDeviceId, tailDevicePort, tailLinkOffset, tailOffset, _, e2 := CalcInitializeLink(vs, outLinkId, calctailOffset, !info.Up)

View File

@ -41,10 +41,10 @@ func ControlTrainUpdate(s *VerifySimulation, ct *request_proto.TrainControl) {
if ct.ControlType == request_proto.TrainControl_EMERGENT_BUTTON {
tce = trainControlEB(vobc, tcc, ct.Button, ct.DeviceId, tccGraphicData)
} else if ct.ControlType == request_proto.TrainControl_DRIVER_KEY_SWITCH {
tce = trainControlDriverKey(vobc, tcc, ct.DriverKey, ct.DeviceId, tccGraphicData)
tce = trainControlDriverKey(sta.DynamicState.Speed, vobc, tcc, ct.DriverKey, ct.DeviceId, tccGraphicData)
train_pc_sim.Default().SendDriverActive(sta.ConnState, sta.VobcState)
} else if ct.ControlType == request_proto.TrainControl_DIRECTION_KEY_SWITCH {
tce = trainControlDirKey(vobc, tcc, ct.DirKey, ct.DeviceId, tccGraphicData)
tce = trainControlDirKey(sta.DynamicState.Speed, vobc, tcc, ct.DirKey, ct.DeviceId, tccGraphicData)
//此处先注释,根据现场调试情况 2024-4-16
//train_pc_sim.Default().SendTrainDirection(sta.VobcState.DirectionForward, sta.VobcState.DirectionBackward)
} else if ct.ControlType == request_proto.TrainControl_HANDLER {
@ -88,24 +88,49 @@ func trainControlEB(vobc *state_proto.TrainVobcState, tcc *state_proto.TrainCont
}
// 列车方向
func trainControlDirKey(vobc *state_proto.TrainVobcState, tcc *state_proto.TrainControlState, request *request_proto.TrainControl_DirectionKeySwitch, deviceId uint32, tccGraphic *data_proto.TccGraphicStorage) []train_pc_sim.TrainControlEvent {
func trainControlDirKey(trainSpeed int32, vobc *state_proto.TrainVobcState, tcc *state_proto.TrainControlState, request *request_proto.TrainControl_DirectionKeySwitch, deviceId uint32, tccGraphic *data_proto.TccGraphicStorage) []train_pc_sim.TrainControlEvent {
_, find := findTrainTccGraphicDataKey(tccGraphic, deviceId)
if !find {
slog.Error("未找到对应的列车方向键deviceId:", deviceId)
return nil
}
vobc.DirectionForward = false
vobc.DirectionBackward = false
if request.Val == 1 {
vobc.DirectionForward = true
} else if request.Val == 0 {
vobc.DirectionBackward = true
panic(sys_error.New("未找到对应的列车方向键"))
}
if tcc.DirKey == nil {
tcc.DirKey = &state_proto.TrainControlState_DirectionKeySwitch{Id: deviceId}
}
direction := request_proto.TrainControl_Direction(request.Val)
if trainSpeed > 0 {
panic(sys_error.New("列车未停稳时,不能变更方向"))
}
vobc.DirectionBackward = false
vobc.DirectionForward = false
if direction == request_proto.TrainControl_FORWARD {
vobc.DirectionForward = true
} else if direction == request_proto.TrainControl_BACKWARD {
vobc.DirectionBackward = true
}
/* if direction == request_proto.TrainControl_NEUTRALWARD {
vobc.DirectionBackward = false
vobc.DirectionForward = false
} else if trainSpeed > 0 && direction != vobc.HistoryDir {
tcc.DirKey.Val = uint32(vobc.HistoryDir.Number())
if vobc.HistoryDir == request_proto.TrainControl_FORWARD {
vobc.DirectionForward = true
} else if vobc.HistoryDir == request_proto.TrainControl_BACKWARD {
vobc.DirectionBackward = true
}
panic(sys_error.New("列车未停稳时,不能变更方向"))
}
vobc.DirectionBackward = false
vobc.DirectionForward = false
if direction == request_proto.TrainControl_FORWARD {
vobc.DirectionForward = true
vobc.HistoryDir = request_proto.TrainControl_FORWARD
} else if direction == request_proto.TrainControl_BACKWARD {
vobc.DirectionBackward = true
vobc.HistoryDir = request_proto.TrainControl_BACKWARD
}*/
tcc.DirKey.Val = request.Val
tce := make([]train_pc_sim.TrainControlEvent, 0)
tce = append(tce, train_pc_sim.TrainControlEvent{Command: message.HANDLE_FORWORD, Status: message.IsTrue(vobc.DirectionForward)})
@ -114,13 +139,15 @@ func trainControlDirKey(vobc *state_proto.TrainVobcState, tcc *state_proto.Train
}
// 列车驾驶端激活
func trainControlDriverKey(vobc *state_proto.TrainVobcState, tcc *state_proto.TrainControlState, request *request_proto.TrainControl_DriverKeySwitch, deviceId uint32, tccGraphic *data_proto.TccGraphicStorage) []train_pc_sim.TrainControlEvent {
func trainControlDriverKey(trainSpeed int32, vobc *state_proto.TrainVobcState, tcc *state_proto.TrainControlState, request *request_proto.TrainControl_DriverKeySwitch, deviceId uint32, tccGraphic *data_proto.TccGraphicStorage) []train_pc_sim.TrainControlEvent {
obj, find := findTrainTccGraphicDataKey(tccGraphic, deviceId)
if !find {
slog.Error("未找到对应的驾驶端激活设备deviceId:", deviceId)
return nil
}
if trainSpeed != 0 {
panic(sys_error.New("因列车未停稳,不支持此操作"))
}
if obj.Code == SKQYS1 {
vobc.Tc1Active = request.Val
} else if obj.Code == SKQYS2 {