动力学列车数据配置
This commit is contained in:
parent
23157a4055
commit
118fe91900
|
@ -50,7 +50,7 @@ type TrainDynamicConfig struct {
|
||||||
Jump bool `protobuf:"varint,9,opt,name=jump,proto3" json:"jump,omitempty"`
|
Jump bool `protobuf:"varint,9,opt,name=jump,proto3" json:"jump,omitempty"`
|
||||||
// 打滑(%)
|
// 打滑(%)
|
||||||
Slip float32 `protobuf:"fixed32,10,opt,name=slip,proto3" json:"slip,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"`
|
Slide int32 `protobuf:"varint,11,opt,name=slide,proto3" json:"slide,omitempty"`
|
||||||
// 过标/欠标(mm)(正数过标,负数欠标)
|
// 过标/欠标(mm)(正数过标,负数欠标)
|
||||||
StopSign int32 `protobuf:"varint,12,opt,name=stopSign,proto3" json:"stopSign,omitempty"`
|
StopSign int32 `protobuf:"varint,12,opt,name=stopSign,proto3" json:"stopSign,omitempty"`
|
||||||
|
@ -183,8 +183,8 @@ type TrainEndsState struct {
|
||||||
SpeedSensorEnableB bool `protobuf:"varint,2,opt,name=speedSensorEnableB,proto3" json:"speedSensorEnableB,omitempty"`
|
SpeedSensorEnableB bool `protobuf:"varint,2,opt,name=speedSensorEnableB,proto3" json:"speedSensorEnableB,omitempty"`
|
||||||
// 雷达是否有效
|
// 雷达是否有效
|
||||||
RadarEnable bool `protobuf:"varint,3,opt,name=radarEnable,proto3" json:"radarEnable,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"`
|
RadarCheckTime int32 `protobuf:"varint,5,opt,name=radarCheckTime,proto3" json:"radarCheckTime,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -242,9 +242,9 @@ func (x *TrainEndsState) GetRadarEnable() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *TrainEndsState) GetRadarCheckSpeed() float32 {
|
func (x *TrainEndsState) GetRadarCheckSpeedDiff() float32 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.RadarCheckSpeed
|
return x.RadarCheckSpeedDiff
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -294,7 +294,7 @@ var file_common_data_proto_rawDesc = []byte{
|
||||||
0x52, 0x04, 0x73, 0x6c, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x18,
|
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,
|
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, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
|
||||||
0x73, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x22, 0xe4, 0x01, 0x0a, 0x0e, 0x54, 0x72, 0x61,
|
0x73, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x22, 0xec, 0x01, 0x0a, 0x0e, 0x54, 0x72, 0x61,
|
||||||
0x69, 0x6e, 0x45, 0x6e, 0x64, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x73,
|
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,
|
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,
|
0x41, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x73, 0x70, 0x65, 0x65, 0x64, 0x53, 0x65,
|
||||||
|
@ -303,16 +303,16 @@ var file_common_data_proto_rawDesc = []byte{
|
||||||
0x42, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x73, 0x70, 0x65, 0x65, 0x64, 0x53, 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,
|
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,
|
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,
|
0x52, 0x0b, 0x72, 0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x30, 0x0a,
|
||||||
0x0f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, 0x64,
|
0x13, 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,
|
0x44, 0x69, 0x66, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x13, 0x72, 0x61, 0x64, 0x61,
|
||||||
0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x61, 0x64, 0x61, 0x72,
|
0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, 0x64, 0x44, 0x69, 0x66, 0x66, 0x12,
|
||||||
0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x26, 0x0a, 0x0e, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d,
|
||||||
0x0e, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x42,
|
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68,
|
||||||
0x2f, 0x5a, 0x2d, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f,
|
0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x2f, 0x5a, 0x2d, 0x6a, 0x6f, 0x79, 0x6c, 0x69,
|
||||||
0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f,
|
0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73,
|
||||||
0x64, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
|
||||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -5055,13 +5055,13 @@ type Train struct {
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
TrainModel Train_TrainModel `protobuf:"varint,1,opt,name=trainModel,proto3,enum=graphicData.Train_TrainModel" json:"trainModel,omitempty"` // 车型
|
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"` // 列车车厢长度
|
CarriageLength int32 `protobuf:"varint,2,opt,name=carriageLength,proto3" json:"carriageLength,omitempty"` // 列车车厢长度
|
||||||
TotalLength int32 `protobuf:"varint,3,opt,name=totalLength,proto3" json:"totalLength,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"` // 车轮的最小直径
|
// int32 minDiameter = 4; // 车轮的最小直径
|
||||||
MaxDiameter int32 `protobuf:"varint,5,opt,name=maxDiameter,proto3" json:"maxDiameter,omitempty"` // 车轮的最大直径
|
// int32 maxDiameter = 5; // 车轮的最大直径
|
||||||
TrainSets string `protobuf:"bytes,6,opt,name=trainSets,proto3" json:"trainSets,omitempty"` // 编组
|
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"` //动力学参数
|
DynamicConfig *common_proto.TrainDynamicConfig `protobuf:"bytes,7,opt,name=dynamicConfig,proto3" json:"dynamicConfig,omitempty"` //动力学参数
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Train) Reset() {
|
func (x *Train) Reset() {
|
||||||
|
@ -5117,20 +5117,6 @@ func (x *Train) GetTotalLength() int32 {
|
||||||
return 0
|
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 {
|
func (x *Train) GetTrainSets() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.TrainSets
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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, 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,
|
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,
|
0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x73, 0x18, 0x06,
|
||||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x69, 0x6e, 0x44, 0x69, 0x61, 0x6d, 0x65,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x73, 0x12,
|
||||||
0x74, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x44, 0x69, 0x61, 0x6d, 0x65, 0x74,
|
0x40, 0x0a, 0x0d, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||||
0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x44, 0x69, 0x61,
|
0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
|
||||||
0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53, 0x65,
|
0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66,
|
||||||
0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x53,
|
0x69, 0x67, 0x52, 0x0d, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||||
0x65, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x0d, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f,
|
0x67, 0x22, 0x28, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12,
|
||||||
0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d,
|
0x05, 0x0a, 0x01, 0x41, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10, 0x01, 0x12, 0x05, 0x0a,
|
||||||
0x6d, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63,
|
0x01, 0x43, 0x10, 0x02, 0x12, 0x05, 0x0a, 0x01, 0x44, 0x10, 0x03, 0x22, 0x49, 0x0a, 0x09, 0x4f,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43,
|
0x74, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x28, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x4d, 0x6f,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06,
|
||||||
0x64, 0x65, 0x6c, 0x12, 0x05, 0x0a, 0x01, 0x41, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10,
|
0x6f, 0x6c, 0x64, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x6c,
|
||||||
0x01, 0x12, 0x05, 0x0a, 0x01, 0x43, 0x10, 0x02, 0x12, 0x05, 0x0a, 0x01, 0x44, 0x10, 0x03, 0x22,
|
0x64, 0x69, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
|
||||||
0x49, 0x0a, 0x09, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04,
|
0x0d, 0x52, 0x03, 0x69, 0x64, 0x73, 0x2a, 0x1d, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74,
|
||||||
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
0x69, 0x6f, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44,
|
||||||
0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6c, 0x64, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
|
0x4f, 0x57, 0x4e, 0x10, 0x01, 0x42, 0x69, 0x0a, 0x25, 0x63, 0x6c, 0x75, 0x62, 0x2e, 0x6a, 0x6f,
|
||||||
0x52, 0x06, 0x6f, 0x6c, 0x64, 0x69, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18,
|
0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6a, 0x72, 0x74, 0x73, 0x73, 0x2e, 0x61, 0x74, 0x73,
|
||||||
0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x03, 0x69, 0x64, 0x73, 0x2a, 0x1d, 0x0a, 0x09, 0x44, 0x69,
|
0x2e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x42, 0x13,
|
||||||
0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x00, 0x12,
|
0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x50, 0x72,
|
||||||
0x08, 0x0a, 0x04, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x01, 0x42, 0x69, 0x0a, 0x25, 0x63, 0x6c, 0x75,
|
0x6f, 0x74, 0x6f, 0x5a, 0x2b, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75,
|
||||||
0x62, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6a, 0x72, 0x74, 0x73, 0x73,
|
0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65,
|
||||||
0x2e, 0x61, 0x74, 0x73, 0x2e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x6f, 0x73, 0x42, 0x13, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69,
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
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 (
|
var (
|
||||||
|
|
|
@ -92,11 +92,11 @@ type ConfigTrainReqDto struct {
|
||||||
WheelDiameter int32 `json:"wheelDiameter"` // 轮径(mm)
|
WheelDiameter int32 `json:"wheelDiameter"` // 轮径(mm)
|
||||||
}
|
}
|
||||||
type ConfigTrainEnds struct {
|
type ConfigTrainEnds struct {
|
||||||
SpeedSensorEnableA bool `json:"speedSensorEnableA"` // 2端速度传感器是否有效
|
SpeedSensorEnableA bool `json:"speedSensorEnableA"` // 2端速度传感器是否有效
|
||||||
SpeedSensorEnableB bool `json:"speedSensorEnableB"` // 2端速度传感器是否有效
|
SpeedSensorEnableB bool `json:"speedSensorEnableB"` // 2端速度传感器是否有效
|
||||||
RadarEnable bool `json:"radarEnable"` // 雷达是否有效
|
RadarEnable bool `json:"radarEnable"` // 雷达是否有效
|
||||||
RadarCheckSpeed float32 `json:"radarCheckSpeed"` // 雷达测速数值
|
RadarCheckSpeedDiff float32 `json:"radarCheckSpeed"` // 雷达测速数值
|
||||||
RadarCheckTime int32 `json:"radarCheckTime"` // 雷达检测时间(秒)
|
RadarCheckTime int32 `json:"radarCheckTime"` // 雷达检测时间(秒)
|
||||||
}
|
}
|
||||||
type ConfigTrainData struct {
|
type ConfigTrainData struct {
|
||||||
//Mass int32 `json:"mass" form:"mass"` // 列车的质量(100=1ton)
|
//Mass int32 `json:"mass" form:"mass"` // 列车的质量(100=1ton)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,13 +17,13 @@ type TrainInfoReqDto struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrainInfoDto struct {
|
type TrainInfoDto struct {
|
||||||
Id int32 `json:"id" form:"id"`
|
Id int32 `json:"id" form:"id"`
|
||||||
Name string `json:"name" form:"name"`
|
Name string `json:"name" form:"name"`
|
||||||
TrainModel int32 `json:"train_model" form:"train_model"`
|
TrainModel int32 `json:"train_model" form:"train_model"`
|
||||||
CarriageLength int32 `json:"carriage_length" form:"carriage_length"`
|
CarriageLength int32 `json:"carriage_length" form:"carriage_length"`
|
||||||
TotalLength int32 `json:"total_length" form:"total_length"`
|
TotalLength int32 `json:"total_length" form:"total_length"`
|
||||||
MinDiameter int32 `json:"min_diameter" form:"min_diameter"`
|
//MinDiameter int32 `json:"min_diameter" form:"min_diameter"`
|
||||||
MaxDiameter int32 `json:"max_diameter" form:"max_diameter"`
|
//MaxDiameter int32 `json:"max_diameter" form:"max_diameter"`
|
||||||
TrainSets string `json:"train_sets" form:"train_sets"`
|
TrainSets string `json:"train_sets" form:"train_sets"`
|
||||||
Description string `json:"description" form:"description"`
|
Description string `json:"description" form:"description"`
|
||||||
TrainConfigData *ConfigTrainData `json:"trainConfigData" form:"trainConfigData"`
|
TrainConfigData *ConfigTrainData `json:"trainConfigData" form:"trainConfigData"`
|
||||||
|
@ -52,14 +52,14 @@ func ConvertDtoFromTrain(t *PublishedDto) *TrainInfoDto {
|
||||||
message := &data_proto.Train{}
|
message := &data_proto.Train{}
|
||||||
proto.Unmarshal(t.Proto, message)
|
proto.Unmarshal(t.Proto, message)
|
||||||
return &TrainInfoDto{
|
return &TrainInfoDto{
|
||||||
Id: t.ID,
|
Id: t.ID,
|
||||||
Name: t.Name,
|
Name: t.Name,
|
||||||
Description: t.Note,
|
Description: t.Note,
|
||||||
TrainModel: int32(message.TrainModel),
|
TrainModel: int32(message.TrainModel),
|
||||||
CarriageLength: message.CarriageLength,
|
CarriageLength: message.CarriageLength,
|
||||||
TotalLength: message.TotalLength,
|
TotalLength: message.TotalLength,
|
||||||
MinDiameter: message.MinDiameter,
|
//MinDiameter: message.MinDiameter,
|
||||||
MaxDiameter: message.MaxDiameter,
|
//MaxDiameter: message.MaxDiameter,
|
||||||
TrainSets: message.TrainSets,
|
TrainSets: message.TrainSets,
|
||||||
TrainConfigData: TrainConfigToDtoConvert(message.DynamicConfig),
|
TrainConfigData: TrainConfigToDtoConvert(message.DynamicConfig),
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ package message_server
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"joylink.club/bj-rtsts-server/dto/common_proto"
|
||||||
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -361,13 +363,44 @@ func convertTrainState(v *state_proto.TrainState) *state_proto.TrainMapState {
|
||||||
RightDoorCloseCommand: v.VobcState.RightDoorCloseCommand,
|
RightDoorCloseCommand: v.VobcState.RightDoorCloseCommand,
|
||||||
AllDoorClose: v.VobcState.AllDoorClose,
|
AllDoorClose: v.VobcState.AllDoorClose,
|
||||||
VobcInterruption: v.VobcState.UdpInterruption,
|
VobcInterruption: v.VobcState.UdpInterruption,
|
||||||
TrainDynamicConfig: v.TrainDynamicConfig,
|
TrainEndsA: convertEnds(v.TrainEndsA),
|
||||||
TrainEndsA: v.TrainEndsA,
|
TrainEndsB: convertEnds(v.TrainEndsB),
|
||||||
TrainEndsB: v.TrainEndsB,
|
|
||||||
}
|
}
|
||||||
|
trainConfig := &state_proto.TrainDynamicConfigMqtt{}
|
||||||
|
convertDynamicConfig(v.TrainDynamicConfig, trainConfig)
|
||||||
|
t.TrainDynamicConfig = trainConfig
|
||||||
return t
|
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) {
|
func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state_proto.SwitchState, error) {
|
||||||
uidMap := memory.QueryMapUidMapByType(mapId, &data_proto.Turnout{})
|
uidMap := memory.QueryMapUidMapByType(mapId, &data_proto.Turnout{})
|
||||||
|
|
|
@ -82,10 +82,10 @@ func convertTrainDtoToProto(t *dto.TrainInfoDto) []byte {
|
||||||
TrainModel: data_proto.Train_TrainModel(t.TrainModel),
|
TrainModel: data_proto.Train_TrainModel(t.TrainModel),
|
||||||
CarriageLength: t.CarriageLength,
|
CarriageLength: t.CarriageLength,
|
||||||
TotalLength: t.TotalLength,
|
TotalLength: t.TotalLength,
|
||||||
MinDiameter: t.MinDiameter,
|
//MinDiameter: t.MinDiameter,
|
||||||
MaxDiameter: t.MaxDiameter,
|
//MaxDiameter: t.MaxDiameter,
|
||||||
TrainSets: t.TrainSets,
|
TrainSets: t.TrainSets,
|
||||||
DynamicConfig: TrainConfigToProtoConvert(t.TrainConfigData),
|
DynamicConfig: TrainConfigToProtoConvert(t.TrainConfigData),
|
||||||
}
|
}
|
||||||
b, _ := proto.Marshal(message)
|
b, _ := proto.Marshal(message)
|
||||||
return b
|
return b
|
||||||
|
|
|
@ -8,7 +8,7 @@ type InitTrainInfo struct {
|
||||||
Speed uint16 `json:"speed"`
|
Speed uint16 `json:"speed"`
|
||||||
Up bool `json:"up"`
|
Up bool `json:"up"`
|
||||||
//TrainLength uint32 `json:"trainLength"`
|
//TrainLength uint32 `json:"trainLength"`
|
||||||
TrainOperationConfig *TrainOperationConfig `json:"TrainOperationConfig"`
|
TrainOperationConfig *TrainOperationConfig `json:"trainOperationConfig"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移除列车请求参数
|
// 移除列车请求参数
|
||||||
|
|
|
@ -21,10 +21,6 @@ import (
|
||||||
"joylink.club/bj-rtsts-server/dto/state_proto"
|
"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 {
|
func CreateMsgTrainConfig(trainId int, trainLen int64, configTrainData dto.ConfigTrainData) *message.TrainOperationConfig {
|
||||||
return &message.TrainOperationConfig{TrainIndex: trainId, Length: int(trainLen),
|
return &message.TrainOperationConfig{TrainIndex: trainId, Length: int(trainLen),
|
||||||
BaseResistanceParamA: configTrainData.BaseResistanceParamA, BaseResistanceParamB: configTrainData.BaseResistanceParamB,
|
BaseResistanceParamA: configTrainData.BaseResistanceParamA, BaseResistanceParamB: configTrainData.BaseResistanceParamB,
|
||||||
|
@ -203,7 +199,7 @@ func copyTrainEnds(trainState *state_proto.TrainState, fieldName string, configD
|
||||||
endsVal.SpeedSensorEnableA = configData.SpeedSensorEnableA
|
endsVal.SpeedSensorEnableA = configData.SpeedSensorEnableA
|
||||||
endsVal.SpeedSensorEnableB = configData.SpeedSensorEnableB
|
endsVal.SpeedSensorEnableB = configData.SpeedSensorEnableB
|
||||||
endsVal.RadarEnable = configData.RadarEnable
|
endsVal.RadarEnable = configData.RadarEnable
|
||||||
endsVal.RadarCheckSpeed = configData.RadarCheckSpeed
|
endsVal.RadarCheckSpeedDiff = configData.RadarCheckSpeedDiff
|
||||||
endsVal.RadarCheckTime = configData.RadarCheckTime
|
endsVal.RadarCheckTime = configData.RadarCheckTime
|
||||||
}
|
}
|
||||||
func UpdateConfigTrain(vs *VerifySimulation, ct *dto.ConfigTrainReqDto) {
|
func UpdateConfigTrain(vs *VerifySimulation, ct *dto.ConfigTrainReqDto) {
|
||||||
|
@ -217,25 +213,8 @@ func UpdateConfigTrain(vs *VerifySimulation, ct *dto.ConfigTrainReqDto) {
|
||||||
panic(sys_error.New(fmt.Sprintf("列车参数修改断言:列车【%s】不存在", ct.TrainId)))
|
panic(sys_error.New(fmt.Sprintf("列车参数修改断言:列车【%s】不存在", ct.TrainId)))
|
||||||
}
|
}
|
||||||
createOrUpdateStateDynamicConfig(trainState, ct.ConfigData, ct.TrainEndsA, ct.TrainEndsB)
|
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.TrainLength = ct.Length
|
||||||
|
|
||||||
trainState.WheelDiameter = ct.WheelDiameter
|
trainState.WheelDiameter = ct.WheelDiameter
|
||||||
//copyTrainEnds(trainState.TrainDynamicConfig, "TrainEndsA", ct.ConfigData.TrainEndsA)
|
|
||||||
//copyTrainEnds(trainState.TrainDynamicConfig, "TrainEndsB", ct.ConfigData.TrainEndsB)
|
|
||||||
//requestDynamicConfig(ct)
|
//requestDynamicConfig(ct)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue