【修改阻力解析】

This commit is contained in:
weizhihong 2023-09-28 13:56:54 +08:00
parent e8a3f635b9
commit abc68eca2e
2 changed files with 8 additions and 8 deletions

View File

@ -230,10 +230,10 @@ func decoderDynamicsTrainInfo(buf []byte) *TrainInfo {
b := buf[12]
trainInfo.UpSlope = (b & (1 << 7)) != 0
trainInfo.Up = (b & (1 << 6)) != 0
trainInfo.TotalResistance = binary.BigEndian.Uint32(buf[14:18])
trainInfo.AirResistance = binary.BigEndian.Uint32(buf[18:22])
trainInfo.SlopeResistance = binary.BigEndian.Uint32(buf[22:26])
trainInfo.CurveResistance = binary.BigEndian.Uint32(buf[26:30])
trainInfo.TotalResistance = int32(binary.BigEndian.Uint32(buf[14:18]))
trainInfo.AirResistance = int32(binary.BigEndian.Uint32(buf[18:22]))
trainInfo.SlopeResistance = int32(binary.BigEndian.Uint32(buf[22:26]))
trainInfo.CurveResistance = int32(binary.BigEndian.Uint32(buf[26:30]))
trainInfo.Speed = math.Float32frombits(binary.BigEndian.Uint32(buf[30:34]))
trainInfo.HeadSpeed1 = math.Float32frombits(binary.BigEndian.Uint32(buf[34:38]))
trainInfo.HeadSpeed2 = math.Float32frombits(binary.BigEndian.Uint32(buf[38:42]))

View File

@ -25,13 +25,13 @@ type TrainInfo struct {
//列车当前运行方向(偏移量增大/减小方向)
Up bool
//实际运行阻力N
TotalResistance uint32
TotalResistance int32
//阻力1空气阻力N
AirResistance uint32
AirResistance int32
//阻力2坡道阻力N
SlopeResistance uint32
SlopeResistance int32
//阻力3曲线阻力N
CurveResistance uint32
CurveResistance int32
//列车运行速度m/s
Speed float32
//头车速传1速度值m/s