Merge branch 'master' of https://git.code.tencent.com/beijing-rtss-test/bj-rtsts-server-go
This commit is contained in:
commit
f97df40b5a
|
@ -1 +1 @@
|
|||
Subproject commit 4faeb5e2d5da71f17be1f6c729b5d633db235b73
|
||||
Subproject commit f9f2cabf35774b9be45afd6474a4d40f32a7da36
|
|
@ -31,11 +31,11 @@ type TrainDynamicConfig struct {
|
|||
// int32 mass=1;
|
||||
//
|
||||
// 基本阻力参数A
|
||||
BaseResistanceParamA float32 `protobuf:"fixed32,1,opt,name=baseResistanceParamA,proto3" json:"baseResistanceParamA,omitempty"`
|
||||
DavisParamA float32 `protobuf:"fixed32,1,opt,name=davisParamA,proto3" json:"davisParamA,omitempty"`
|
||||
// 基本阻力参数B
|
||||
BaseResistanceParamB float32 `protobuf:"fixed32,2,opt,name=baseResistanceParamB,proto3" json:"baseResistanceParamB,omitempty"`
|
||||
DavisParamB float32 `protobuf:"fixed32,2,opt,name=davisParamB,proto3" json:"davisParamB,omitempty"`
|
||||
// 基本阻力参数C
|
||||
BaseResistanceParamC float32 `protobuf:"fixed32,3,opt,name=baseResistanceParamC,proto3" json:"baseResistanceParamC,omitempty"`
|
||||
DavisParamC float32 `protobuf:"fixed32,3,opt,name=davisParamC,proto3" json:"davisParamC,omitempty"`
|
||||
// 曲线阻力参数R1
|
||||
CurveResistanceParamR1 float32 `protobuf:"fixed32,4,opt,name=curveResistanceParamR1,proto3" json:"curveResistanceParamR1,omitempty"`
|
||||
// 曲线阻力参数R2
|
||||
|
@ -50,10 +50,11 @@ type TrainDynamicConfig struct {
|
|||
Jump bool `protobuf:"varint,9,opt,name=jump,proto3" json:"jump,omitempty"`
|
||||
// 打滑(%)
|
||||
Slip float32 `protobuf:"fixed32,10,opt,name=slip,proto3" json:"slip,omitempty"`
|
||||
// 前溜/后溜(mm)(正数前溜,负数后溜)
|
||||
// 前溜/后溜(m/s)(正数前溜,负数后溜)
|
||||
Slide int32 `protobuf:"varint,11,opt,name=slide,proto3" json:"slide,omitempty"`
|
||||
// 过标/欠标(mm)(正数过标,负数欠标)
|
||||
StopSign int32 `protobuf:"varint,12,opt,name=stopSign,proto3" json:"stopSign,omitempty"`
|
||||
Idling float32 `protobuf:"fixed32,13,opt,name=idling,proto3" json:"idling,omitempty"` //空转
|
||||
}
|
||||
|
||||
func (x *TrainDynamicConfig) Reset() {
|
||||
|
@ -88,23 +89,23 @@ func (*TrainDynamicConfig) Descriptor() ([]byte, []int) {
|
|||
return file_common_data_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *TrainDynamicConfig) GetBaseResistanceParamA() float32 {
|
||||
func (x *TrainDynamicConfig) GetDavisParamA() float32 {
|
||||
if x != nil {
|
||||
return x.BaseResistanceParamA
|
||||
return x.DavisParamA
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TrainDynamicConfig) GetBaseResistanceParamB() float32 {
|
||||
func (x *TrainDynamicConfig) GetDavisParamB() float32 {
|
||||
if x != nil {
|
||||
return x.BaseResistanceParamB
|
||||
return x.DavisParamB
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *TrainDynamicConfig) GetBaseResistanceParamC() float32 {
|
||||
func (x *TrainDynamicConfig) GetDavisParamC() float32 {
|
||||
if x != nil {
|
||||
return x.BaseResistanceParamC
|
||||
return x.DavisParamC
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
@ -172,6 +173,13 @@ func (x *TrainDynamicConfig) GetStopSign() int32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *TrainDynamicConfig) GetIdling() float32 {
|
||||
if x != nil {
|
||||
return x.Idling
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// 列车一端的状态
|
||||
type TrainEndsState struct {
|
||||
state protoimpl.MessageState
|
||||
|
@ -183,8 +191,8 @@ 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"`
|
||||
// 雷达测速数值
|
||||
RadarCheckSpeed float32 `protobuf:"fixed32,4,opt,name=radarCheckSpeed,proto3" json:"radarCheckSpeed,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"`
|
||||
}
|
||||
|
@ -242,9 +250,9 @@ func (x *TrainEndsState) GetRadarEnable() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func (x *TrainEndsState) GetRadarCheckSpeed() float32 {
|
||||
func (x *TrainEndsState) GetRadarCheckSpeedDiff() float32 {
|
||||
if x != nil {
|
||||
return x.RadarCheckSpeed
|
||||
return x.RadarCheckSpeedDiff
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
@ -260,59 +268,58 @@ var File_common_data_proto protoreflect.FileDescriptor
|
|||
|
||||
var file_common_data_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x9a, 0x04, 0x0a, 0x12,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xfc, 0x03, 0x0a, 0x12,
|
||||
0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x12, 0x32, 0x0a, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74,
|
||||
0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x41, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02,
|
||||
0x52, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x41, 0x12, 0x32, 0x0a, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65,
|
||||
0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x42, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74,
|
||||
0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x42, 0x12, 0x32, 0x0a, 0x14, 0x62, 0x61,
|
||||
0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61,
|
||||
0x6d, 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65,
|
||||
0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x43, 0x12, 0x36,
|
||||
0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63,
|
||||
0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16,
|
||||
0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x52, 0x31, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52,
|
||||
0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x32,
|
||||
0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73,
|
||||
0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x32, 0x12, 0x36,
|
||||
0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63,
|
||||
0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x33, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16,
|
||||
0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x52, 0x33, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52,
|
||||
0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x34,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73,
|
||||
0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x34, 0x12, 0x2e,
|
||||
0x0a, 0x12, 0x72, 0x65, 0x76, 0x6f, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x73, 0x73, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x02, 0x52, 0x12, 0x72, 0x65, 0x76, 0x6f,
|
||||
0x6c, 0x76, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x73, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x6a, 0x75, 0x6d, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6a, 0x75,
|
||||
0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x69, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02,
|
||||
0x52, 0x04, 0x73, 0x6c, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x18,
|
||||
0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08,
|
||||
0x73, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
|
||||
0x73, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x22, 0xe4, 0x01, 0x0a, 0x0e, 0x54, 0x72, 0x61,
|
||||
0x69, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x73,
|
||||
0x70, 0x65, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x41, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x73, 0x70, 0x65, 0x65, 0x64, 0x53, 0x65,
|
||||
0x6e, 0x73, 0x6f, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x12, 0x2e, 0x0a, 0x12, 0x73,
|
||||
0x70, 0x65, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x42, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x73, 0x70, 0x65, 0x65, 0x64, 0x53, 0x65,
|
||||
0x6e, 0x73, 0x6f, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x12, 0x20, 0x0a, 0x0b, 0x72,
|
||||
0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x0b, 0x72, 0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x28, 0x0a,
|
||||
0x0f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, 0x64,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65,
|
||||
0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x61, 0x64, 0x61, 0x72,
|
||||
0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0e, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x42,
|
||||
0x2f, 0x5a, 0x2d, 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, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x69, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x61, 0x76, 0x69, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x41, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x64, 0x61, 0x76, 0x69, 0x73, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x41, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x61, 0x76, 0x69, 0x73, 0x50, 0x61, 0x72,
|
||||
0x61, 0x6d, 0x42, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x64, 0x61, 0x76, 0x69, 0x73,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x42, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x61, 0x76, 0x69, 0x73, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x43, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x64, 0x61, 0x76,
|
||||
0x69, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x43, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76,
|
||||
0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x52, 0x31, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52,
|
||||
0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x31,
|
||||
0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61,
|
||||
0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02,
|
||||
0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63,
|
||||
0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x32, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76,
|
||||
0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x52, 0x33, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52,
|
||||
0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x33,
|
||||
0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61,
|
||||
0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x34, 0x18, 0x07, 0x20, 0x01, 0x28, 0x02,
|
||||
0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63,
|
||||
0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x34, 0x12, 0x2e, 0x0a, 0x12, 0x72, 0x65, 0x76, 0x6f,
|
||||
0x6c, 0x76, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x73, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x08,
|
||||
0x20, 0x01, 0x28, 0x02, 0x52, 0x12, 0x72, 0x65, 0x76, 0x6f, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x4d,
|
||||
0x61, 0x73, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6a, 0x75, 0x6d, 0x70,
|
||||
0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6a, 0x75, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x73, 0x6c, 0x69, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x73, 0x6c, 0x69, 0x70,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x05, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x53, 0x69,
|
||||
0x67, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x53, 0x69,
|
||||
0x67, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x64, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01,
|
||||
0x28, 0x02, 0x52, 0x06, 0x69, 0x64, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0xec, 0x01, 0x0a, 0x0e, 0x54,
|
||||
0x72, 0x61, 0x69, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a,
|
||||
0x12, 0x73, 0x70, 0x65, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x45, 0x6e, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x41, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x73, 0x70, 0x65, 0x65, 0x64,
|
||||
0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x12, 0x2e, 0x0a,
|
||||
0x12, 0x73, 0x70, 0x65, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x45, 0x6e, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x42, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x73, 0x70, 0x65, 0x65, 0x64,
|
||||
0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x12, 0x20, 0x0a,
|
||||
0x0b, 0x72, 0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x0b, 0x72, 0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12,
|
||||
0x30, 0x0a, 0x13, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x70, 0x65,
|
||||
0x65, 0x64, 0x44, 0x69, 0x66, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x13, 0x72, 0x61,
|
||||
0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, 0x64, 0x44, 0x69, 0x66,
|
||||
0x66, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54,
|
||||
0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x72, 0x61, 0x64, 0x61, 0x72,
|
||||
0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x2f, 0x5a, 0x2d, 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, 0x63, 0x6f,
|
||||
0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -5058,8 +5058,8 @@ type Train struct {
|
|||
TrainModel Train_TrainModel `protobuf:"varint,1,opt,name=trainModel,proto3,enum=graphicData.Train_TrainModel" json:"trainModel,omitempty"` // 车型
|
||||
CarriageLength int32 `protobuf:"varint,2,opt,name=carriageLength,proto3" json:"carriageLength,omitempty"` // 列车车厢长度
|
||||
TotalLength int32 `protobuf:"varint,3,opt,name=totalLength,proto3" json:"totalLength,omitempty"` // 总长度
|
||||
MinDiameter int32 `protobuf:"varint,4,opt,name=minDiameter,proto3" json:"minDiameter,omitempty"` // 车轮的最小直径
|
||||
MaxDiameter int32 `protobuf:"varint,5,opt,name=maxDiameter,proto3" json:"maxDiameter,omitempty"` // 车轮的最大直径
|
||||
// int32 minDiameter = 4; // 车轮的最小直径
|
||||
// int32 maxDiameter = 5; // 车轮的最大直径
|
||||
TrainSets string `protobuf:"bytes,6,opt,name=trainSets,proto3" json:"trainSets,omitempty"` // 编组
|
||||
DynamicConfig *common_proto.TrainDynamicConfig `protobuf:"bytes,7,opt,name=dynamicConfig,proto3" json:"dynamicConfig,omitempty"` //动力学参数
|
||||
}
|
||||
|
@ -5117,20 +5117,6 @@ func (x *Train) GetTotalLength() int32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *Train) GetMinDiameter() int32 {
|
||||
if x != nil {
|
||||
return x.MinDiameter
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Train) GetMaxDiameter() int32 {
|
||||
if x != nil {
|
||||
return x.MaxDiameter
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Train) GetTrainSets() string {
|
||||
if x != nil {
|
||||
return x.TrainSets
|
||||
|
@ -6121,7 +6107,7 @@ var file_stationLayoutGraphics_proto_rawDesc = []byte{
|
|||
0x28, 0x0d, 0x52, 0x0a, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x2e,
|
||||
0x0a, 0x12, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x12, 0x63, 0x65, 0x6e, 0x74,
|
||||
0x72, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xde,
|
||||
0x72, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x9a,
|
||||
0x02, 0x0a, 0x05, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x12, 0x3d, 0x0a, 0x0a, 0x74, 0x72, 0x61, 0x69,
|
||||
0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x67,
|
||||
0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e,
|
||||
|
@ -6131,33 +6117,29 @@ var file_stationLayoutGraphics_proto_rawDesc = []byte{
|
|||
0x0e, 0x63, 0x61, 0x72, 0x72, 0x69, 0x61, 0x67, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12,
|
||||
0x20, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4c, 0x65, 0x6e, 0x67, 0x74,
|
||||
0x68, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x44, 0x69, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x69, 0x6e, 0x44, 0x69, 0x61, 0x6d, 0x65,
|
||||
0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x44, 0x69, 0x61, 0x6d, 0x65, 0x74,
|
||||
0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x44, 0x69, 0x61,
|
||||
0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x65,
|
||||
0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53,
|
||||
0x65, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x0d, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43,
|
||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x28, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x4d, 0x6f,
|
||||
0x64, 0x65, 0x6c, 0x12, 0x05, 0x0a, 0x01, 0x41, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10,
|
||||
0x01, 0x12, 0x05, 0x0a, 0x01, 0x43, 0x10, 0x02, 0x12, 0x05, 0x0a, 0x01, 0x44, 0x10, 0x03, 0x22,
|
||||
0x49, 0x0a, 0x09, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6c, 0x64, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
|
||||
0x52, 0x06, 0x6f, 0x6c, 0x64, 0x69, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18,
|
||||
0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x03, 0x69, 0x64, 0x73, 0x2a, 0x1d, 0x0a, 0x09, 0x44, 0x69,
|
||||
0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x00, 0x12,
|
||||
0x08, 0x0a, 0x04, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x42, 0x69, 0x0a, 0x25, 0x63, 0x6c, 0x75,
|
||||
0x62, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6a, 0x72, 0x74, 0x73, 0x73,
|
||||
0x2e, 0x61, 0x74, 0x73, 0x2e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x73, 0x42, 0x13, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69,
|
||||
0x63, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x2b, 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, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x73, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x73, 0x12,
|
||||
0x40, 0x0a, 0x0d, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
|
||||
0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x52, 0x0d, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||
0x67, 0x22, 0x28, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12,
|
||||
0x05, 0x0a, 0x01, 0x41, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10, 0x01, 0x12, 0x05, 0x0a,
|
||||
0x01, 0x43, 0x10, 0x02, 0x12, 0x05, 0x0a, 0x01, 0x44, 0x10, 0x03, 0x22, 0x49, 0x0a, 0x09, 0x4f,
|
||||
0x74, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x6f, 0x6c, 0x64, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x6c,
|
||||
0x64, 0x69, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
|
||||
0x0d, 0x52, 0x03, 0x69, 0x64, 0x73, 0x2a, 0x1d, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44,
|
||||
0x4f, 0x57, 0x4e, 0x10, 0x01, 0x42, 0x69, 0x0a, 0x25, 0x63, 0x6c, 0x75, 0x62, 0x2e, 0x6a, 0x6f,
|
||||
0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6a, 0x72, 0x74, 0x73, 0x73, 0x2e, 0x61, 0x74, 0x73,
|
||||
0x2e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x42, 0x13,
|
||||
0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x50, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x5a, 0x2b, 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, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -95,14 +95,14 @@ type ConfigTrainEnds struct {
|
|||
SpeedSensorEnableA bool `json:"speedSensorEnableA"` // 2端速度传感器是否有效
|
||||
SpeedSensorEnableB bool `json:"speedSensorEnableB"` // 2端速度传感器是否有效
|
||||
RadarEnable bool `json:"radarEnable"` // 雷达是否有效
|
||||
RadarCheckSpeed float32 `json:"radarCheckSpeed"` // 雷达测速数值
|
||||
RadarCheckSpeedDiff float32 `json:"radarCheckSpeed"` // 雷达测速数值
|
||||
RadarCheckTime int32 `json:"radarCheckTime"` // 雷达检测时间(秒)
|
||||
}
|
||||
type ConfigTrainData struct {
|
||||
//Mass int32 `json:"mass" form:"mass"` // 列车的质量(100=1ton)
|
||||
BaseResistanceParamA float32 `json:"baseResistanceParamA"` // 基本阻力参数A
|
||||
BaseResistanceParamB float32 `json:"baseResistanceParamB"` // 基本阻力参数B
|
||||
BaseResistanceParamC float32 `json:"baseResistanceParamC"` // 基本阻力参数C
|
||||
DavisParamA float32 `json:"davisParamA"` // 基本阻力参数A
|
||||
DavisParamB float32 `json:"davisParamB"` // 基本阻力参数B
|
||||
DavisParamC float32 `json:"davisParamC"` // 基本阻力参数C
|
||||
CurveResistanceParamR1 float32 `json:"curveResistanceParamR1"` // 曲线阻力参数R1
|
||||
CurveResistanceParamR2 float32 `json:"curveResistanceParamR2"` // 曲线阻力参数R2
|
||||
CurveResistanceParamR3 float32 `json:"curveResistanceParamR3"` // 曲线阻力参数R3
|
||||
|
@ -112,6 +112,7 @@ type ConfigTrainData struct {
|
|||
Slip float32 `json:"slip"` // 打滑(%)
|
||||
Slide int32 `json:"slide"` // 前溜/后溜(mm)(正数前溜,负数后溜)
|
||||
StopSign int32 `json:"stopSign"` // 过标/欠标(mm)(正数过标,负数欠标)
|
||||
Idling float32 `json:"idling"` // 空转
|
||||
//TrainEndsA ConfigTrainEnds `json:"TrainEndsA"` // 车辆A端
|
||||
//TrainEndsB ConfigTrainEnds `json:"TrainEndsB"` // 车辆B端
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -22,8 +22,8 @@ type TrainInfoDto struct {
|
|||
TrainModel int32 `json:"train_model" form:"train_model"`
|
||||
CarriageLength int32 `json:"carriage_length" form:"carriage_length"`
|
||||
TotalLength int32 `json:"total_length" form:"total_length"`
|
||||
MinDiameter int32 `json:"min_diameter" form:"min_diameter"`
|
||||
MaxDiameter int32 `json:"max_diameter" form:"max_diameter"`
|
||||
//MinDiameter int32 `json:"min_diameter" form:"min_diameter"`
|
||||
//MaxDiameter int32 `json:"max_diameter" form:"max_diameter"`
|
||||
TrainSets string `json:"train_sets" form:"train_sets"`
|
||||
Description string `json:"description" form:"description"`
|
||||
TrainConfigData *ConfigTrainData `json:"trainConfigData" form:"trainConfigData"`
|
||||
|
@ -39,11 +39,10 @@ func ConvertToTrainDto(trailInfos []*PublishedDto) []*TrainInfoDto {
|
|||
func TrainConfigToDtoConvert(dc *common_proto.TrainDynamicConfig) *ConfigTrainData {
|
||||
if dc != nil {
|
||||
return &ConfigTrainData{
|
||||
BaseResistanceParamA: dc.BaseResistanceParamA, BaseResistanceParamB: dc.BaseResistanceParamB, BaseResistanceParamC: dc.BaseResistanceParamC,
|
||||
DavisParamA: dc.DavisParamA, DavisParamB: dc.DavisParamB, DavisParamC: dc.DavisParamC,
|
||||
CurveResistanceParamR1: dc.CurveResistanceParamR1, CurveResistanceParamR2: dc.CurveResistanceParamR2, CurveResistanceParamR3: dc.CurveResistanceParamR3,
|
||||
CurveResistanceParamR4: dc.CurveResistanceParamR4, RevolvingMassParam: dc.RevolvingMassParam,
|
||||
Jump: dc.Jump, Slip: dc.Slip, Slide: dc.Slide,
|
||||
StopSign: dc.StopSign,
|
||||
Jump: dc.Jump, Slip: dc.Slip, Slide: dc.Slide, Idling: dc.Idling, StopSign: dc.StopSign,
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
@ -58,8 +57,8 @@ func ConvertDtoFromTrain(t *PublishedDto) *TrainInfoDto {
|
|||
TrainModel: int32(message.TrainModel),
|
||||
CarriageLength: message.CarriageLength,
|
||||
TotalLength: message.TotalLength,
|
||||
MinDiameter: message.MinDiameter,
|
||||
MaxDiameter: message.MaxDiameter,
|
||||
//MinDiameter: message.MinDiameter,
|
||||
//MaxDiameter: message.MaxDiameter,
|
||||
TrainSets: message.TrainSets,
|
||||
TrainConfigData: TrainConfigToDtoConvert(message.DynamicConfig),
|
||||
}
|
||||
|
|
1
go.mod
1
go.mod
|
@ -9,6 +9,7 @@ require (
|
|||
github.com/golang/protobuf v1.5.3
|
||||
github.com/google/uuid v1.4.0
|
||||
github.com/sagikazarmark/slog-shim v0.1.0
|
||||
github.com/shopspring/decimal v1.3.1
|
||||
github.com/spf13/viper v1.18.1
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/swaggo/files v1.0.1
|
||||
|
|
6
go.sum
6
go.sum
|
@ -80,8 +80,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
|
|||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
||||
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
|
@ -174,6 +174,8 @@ github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6g
|
|||
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
|
||||
github.com/samber/slog-gin v1.1.0 h1:dDvYEGJkJg0DxuNWo6m6gV5Bm+iSk85Ox9on7c7OjQU=
|
||||
github.com/samber/slog-gin v1.1.0/go.mod h1:vmMxOYIqDHbthu7SmiF/oOlMhpYukL62JB4Ct5etOvI=
|
||||
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
|
||||
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/simonvetter/modbus v1.6.0 h1:RDHJevtc7LDIVoHAbhDun8fy+QwnGe+ZU+sLm9ZZzjc=
|
||||
github.com/simonvetter/modbus v1.6.0/go.mod h1:hh90ZaTaPLcK2REj6/fpTbiV0J6S7GWmd8q+GVRObPw=
|
||||
github.com/snksoft/crc v1.1.0 h1:HkLdI4taFlgGGG1KvsWMpz78PkOC9TkPVpTV/cuWn48=
|
||||
|
|
|
@ -181,6 +181,7 @@ github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Q
|
|||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sagikazarmark/crypt v0.17.0/go.mod h1:SMtHTvdmsZMuY/bpZoqokSoChIrcJ/epOxZN58PbZDg=
|
||||
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
|
||||
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
|
||||
|
|
|
@ -3,6 +3,8 @@ package message_server
|
|||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"joylink.club/bj-rtsts-server/dto/common_proto"
|
||||
"reflect"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -364,13 +366,44 @@ func convertTrainState(v *state_proto.TrainState) *state_proto.TrainMapState {
|
|||
RightDoorCloseCommand: v.VobcState.RightDoorCloseCommand,
|
||||
AllDoorClose: v.VobcState.AllDoorClose,
|
||||
VobcInterruption: v.VobcState.UdpInterruption,
|
||||
TrainDynamicConfig: v.TrainDynamicConfig,
|
||||
TrainEndsA: v.TrainEndsA,
|
||||
TrainEndsB: v.TrainEndsB,
|
||||
TrainEndsA: convertEnds(v.TrainEndsA),
|
||||
TrainEndsB: convertEnds(v.TrainEndsB),
|
||||
}
|
||||
trainConfig := &state_proto.TrainDynamicConfigMqtt{}
|
||||
convertDynamicConfig(v.TrainDynamicConfig, trainConfig)
|
||||
t.TrainDynamicConfig = trainConfig
|
||||
return t
|
||||
}
|
||||
|
||||
func convertDynamicConfig(config *common_proto.TrainDynamicConfig, dest *state_proto.TrainDynamicConfigMqtt) {
|
||||
configType := reflect.TypeOf(config).Elem()
|
||||
for index := 0; index < configType.NumField(); index++ {
|
||||
field := configType.Field(index)
|
||||
if field.IsExported() {
|
||||
fieldName := field.Name
|
||||
destVal := reflect.ValueOf(dest).Elem().FieldByName(fieldName)
|
||||
sourceData := reflect.ValueOf(config).Elem().FieldByName(fieldName).Interface()
|
||||
|
||||
if destVal.Kind() == reflect.String {
|
||||
destVal.Set(reflect.ValueOf(fmt.Sprintf("%v", sourceData)))
|
||||
} else {
|
||||
destVal.Set(reflect.ValueOf(sourceData))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func convertEnds(ends *common_proto.TrainEndsState) *state_proto.TrainEndsStateMqtt {
|
||||
return &state_proto.TrainEndsStateMqtt{SpeedSensorEnableA: ends.SpeedSensorEnableA,
|
||||
SpeedSensorEnableB: ends.SpeedSensorEnableB,
|
||||
RadarEnable: ends.RadarEnable,
|
||||
RadarCheckSpeedDiff: floatToString(ends.RadarCheckSpeedDiff),
|
||||
RadarCheckTime: ends.RadarCheckTime}
|
||||
}
|
||||
func floatToString(f float32) string {
|
||||
return fmt.Sprintf("%v", f)
|
||||
}
|
||||
|
||||
// 收集道岔状态
|
||||
func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state_proto.SwitchState, error) {
|
||||
uidMap := memory.QueryMapUidMapByType(mapId, &data_proto.Turnout{})
|
||||
|
|
|
@ -69,9 +69,9 @@ func TrainConfigToProtoConvert(t *dto.ConfigTrainData) *common_proto.TrainDynami
|
|||
return nil
|
||||
}
|
||||
return &common_proto.TrainDynamicConfig{
|
||||
BaseResistanceParamA: t.BaseResistanceParamA, BaseResistanceParamB: t.BaseResistanceParamB, BaseResistanceParamC: t.BaseResistanceParamC,
|
||||
DavisParamA: t.DavisParamA, DavisParamB: t.DavisParamB, DavisParamC: t.DavisParamC,
|
||||
CurveResistanceParamR1: t.CurveResistanceParamR1, CurveResistanceParamR2: t.CurveResistanceParamR2, CurveResistanceParamR3: t.CurveResistanceParamR3, CurveResistanceParamR4: t.CurveResistanceParamR4,
|
||||
Jump: t.Jump, Slip: t.Slip,
|
||||
RevolvingMassParam: t.RevolvingMassParam, Jump: t.Jump, Slip: t.Slip, Idling: t.Idling,
|
||||
Slide: t.Slide, StopSign: t.StopSign,
|
||||
}
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ func convertTrainDtoToProto(t *dto.TrainInfoDto) []byte {
|
|||
TrainModel: data_proto.Train_TrainModel(t.TrainModel),
|
||||
CarriageLength: t.CarriageLength,
|
||||
TotalLength: t.TotalLength,
|
||||
MinDiameter: t.MinDiameter,
|
||||
MaxDiameter: t.MaxDiameter,
|
||||
//MinDiameter: t.MinDiameter,
|
||||
//MaxDiameter: t.MaxDiameter,
|
||||
TrainSets: t.TrainSets,
|
||||
DynamicConfig: TrainConfigToProtoConvert(t.TrainConfigData),
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ type InitTrainInfo struct {
|
|||
Speed uint16 `json:"speed"`
|
||||
Up bool `json:"up"`
|
||||
//TrainLength uint32 `json:"trainLength"`
|
||||
TrainOperationConfig *TrainOperationConfig `json:"TrainOperationConfig"`
|
||||
TrainOperationConfig *TrainOperationConfig `json:"config"`
|
||||
}
|
||||
|
||||
// 移除列车请求参数
|
||||
|
@ -54,19 +54,20 @@ type Curve struct {
|
|||
type TrainOperationConfig struct {
|
||||
TrainIndex int `json:"trainIndex"`
|
||||
//Mass int `json:"mass" form:"mass"` //列车的质量(100=1ton)
|
||||
Length int `json:"列车的长度(cm)"`
|
||||
BaseResistanceParamA float32 `json:"基本阻力参数A"`
|
||||
BaseResistanceParamB float32 `json:"基本阻力参数B"`
|
||||
BaseResistanceParamC float32 `json:"基本阻力参数C"`
|
||||
CurveResistanceParamR1 float32 `json:"曲线阻力参数R1"`
|
||||
CurveResistanceParamR2 float32 `json:"曲线阻力参数R2"`
|
||||
CurveResistanceParamR3 float32 `json:"曲线阻力参数R3"`
|
||||
CurveResistanceParamR4 float32 `json:"曲线阻力参数R4"`
|
||||
RevolvingMassParam float32 `json:"旋转质量参数"`
|
||||
Jump bool `json:"是否跳跃"`
|
||||
Slip float32 `json:"打滑(%)"`
|
||||
Slide int `json:"前溜/后溜(mm)(正数前溜,负数后溜)"`
|
||||
StopSign int `json:"过标/欠标(mm)(正数过标,负数欠标)"`
|
||||
Length int `json:"length"` // 列车的长度(cm)
|
||||
DavisParamA float32 `json:"davisParamA"` // 基本阻力参数A
|
||||
DavisParamB float32 `json:"davisParamB"` // 基本阻力参数B
|
||||
DavisParamC float32 `json:"davisParamC"` // 基本阻力参数C
|
||||
CurveResistanceParamR1 float32 `json:"curveResistanceParamR1"` // 曲线阻力参数R1
|
||||
CurveResistanceParamR2 float32 `json:"curveResistanceParamR2"` // 曲线阻力参数R2
|
||||
CurveResistanceParamR3 float32 `json:"curveResistanceParamR3"` // 曲线阻力参数R3
|
||||
CurveResistanceParamR4 float32 `json:"curveResistanceParamR4"` // 曲线阻力参数R4
|
||||
RevolvingMassParam float32 `json:"revolvingMassParam"` // 旋转质量参数
|
||||
Jump bool `json:"jump"` // 是否跳跃
|
||||
Slip float32 `json:"slip"` // 打滑(%)
|
||||
Idling float32 `json:"idling"` // 空转(%),默认值:0
|
||||
Slide int `json:"slide"` // 前溜/后溜(mm)(正数前溜,负数后溜)
|
||||
StopSign int `json:"stopSign"` // 过标/欠标(mm)(正数过标,负数欠标)
|
||||
//WheelDiameter int `json:"轮径(mm)"`
|
||||
//RadarSpeed float32 `json:"雷达速度差值(m/s)"`
|
||||
//RadarDuration int `json:"雷达速度差值持续时间(ms)"`
|
||||
|
|
|
@ -21,17 +21,13 @@ import (
|
|||
"joylink.club/bj-rtsts-server/dto/state_proto"
|
||||
)
|
||||
|
||||
func DtoTrainEndsToStateProto(ends dto.ConfigTrainEnds) *common_proto.TrainEndsState {
|
||||
return &common_proto.TrainEndsState{SpeedSensorEnableA: ends.SpeedSensorEnableA, SpeedSensorEnableB: ends.SpeedSensorEnableB,
|
||||
RadarEnable: ends.RadarEnable, RadarCheckSpeed: ends.RadarCheckSpeed, RadarCheckTime: ends.RadarCheckTime}
|
||||
}
|
||||
func CreateMsgTrainConfig(trainId int, trainLen int64, configTrainData dto.ConfigTrainData) *message.TrainOperationConfig {
|
||||
return &message.TrainOperationConfig{TrainIndex: trainId, Length: int(trainLen),
|
||||
BaseResistanceParamA: configTrainData.BaseResistanceParamA, BaseResistanceParamB: configTrainData.BaseResistanceParamB,
|
||||
BaseResistanceParamC: configTrainData.BaseResistanceParamC, CurveResistanceParamR1: configTrainData.CurveResistanceParamR1,
|
||||
DavisParamA: configTrainData.DavisParamA, DavisParamB: configTrainData.DavisParamB,
|
||||
DavisParamC: configTrainData.DavisParamC, CurveResistanceParamR1: configTrainData.CurveResistanceParamR1,
|
||||
CurveResistanceParamR2: configTrainData.CurveResistanceParamR2, CurveResistanceParamR3: configTrainData.CurveResistanceParamR3,
|
||||
CurveResistanceParamR4: configTrainData.CurveResistanceParamR4, RevolvingMassParam: configTrainData.RevolvingMassParam,
|
||||
Jump: configTrainData.Jump, Slip: configTrainData.Slip, Slide: int(configTrainData.Slide),
|
||||
Jump: configTrainData.Jump, Slip: configTrainData.Slip, Slide: int(configTrainData.Slide), Idling: configTrainData.Idling,
|
||||
StopSign: int(configTrainData.StopSign)}
|
||||
}
|
||||
|
||||
|
@ -203,7 +199,7 @@ func copyTrainEnds(trainState *state_proto.TrainState, fieldName string, configD
|
|||
endsVal.SpeedSensorEnableA = configData.SpeedSensorEnableA
|
||||
endsVal.SpeedSensorEnableB = configData.SpeedSensorEnableB
|
||||
endsVal.RadarEnable = configData.RadarEnable
|
||||
endsVal.RadarCheckSpeed = configData.RadarCheckSpeed
|
||||
endsVal.RadarCheckSpeedDiff = configData.RadarCheckSpeedDiff
|
||||
endsVal.RadarCheckTime = configData.RadarCheckTime
|
||||
}
|
||||
func UpdateConfigTrain(vs *VerifySimulation, ct *dto.ConfigTrainReqDto) {
|
||||
|
@ -217,26 +213,9 @@ func UpdateConfigTrain(vs *VerifySimulation, ct *dto.ConfigTrainReqDto) {
|
|||
panic(sys_error.New(fmt.Sprintf("列车参数修改断言:列车【%s】不存在", ct.TrainId)))
|
||||
}
|
||||
createOrUpdateStateDynamicConfig(trainState, ct.ConfigData, ct.TrainEndsA, ct.TrainEndsB)
|
||||
/* if trainState.TrainDynamicConfig == nil {
|
||||
trainState.TrainDynamicConfig = &state_proto.TrainDynamicConfig{}
|
||||
}*/
|
||||
/*trainState.TrainDynamicConfig.BaseResistanceParamA = ct.ConfigData.BaseResistanceParamA
|
||||
trainState.TrainDynamicConfig.BaseResistanceParamB = ct.ConfigData.BaseResistanceParamB
|
||||
trainState.TrainDynamicConfig.BaseResistanceParamC = ct.ConfigData.BaseResistanceParamC
|
||||
trainState.TrainDynamicConfig.CurveResistanceParamR1 = ct.ConfigData.CurveResistanceParamR1
|
||||
trainState.TrainDynamicConfig.CurveResistanceParamR2 = ct.ConfigData.CurveResistanceParamR2
|
||||
trainState.TrainDynamicConfig.CurveResistanceParamR3 = ct.ConfigData.CurveResistanceParamR3
|
||||
trainState.TrainDynamicConfig.CurveResistanceParamR4 = ct.ConfigData.CurveResistanceParamR4
|
||||
trainState.TrainDynamicConfig.Jump = ct.ConfigData.Jump
|
||||
trainState.TrainDynamicConfig.Slip = ct.ConfigData.Slip
|
||||
trainState.TrainDynamicConfig.Slide = ct.ConfigData.Slide
|
||||
trainState.TrainDynamicConfig.StopSign = ct.ConfigData.StopSign*/
|
||||
trainState.TrainLength = ct.Length
|
||||
|
||||
trainState.WheelDiameter = ct.WheelDiameter
|
||||
//copyTrainEnds(trainState.TrainDynamicConfig, "TrainEndsA", ct.ConfigData.TrainEndsA)
|
||||
//copyTrainEnds(trainState.TrainDynamicConfig, "TrainEndsB", ct.ConfigData.TrainEndsB)
|
||||
//requestDynamicConfig(ct)
|
||||
requestDynamicConfig(ct)
|
||||
}
|
||||
|
||||
func requestDynamicConfig(ct *dto.ConfigTrainReqDto) {
|
||||
|
|
Loading…
Reference in New Issue