Merge remote-tracking branch 'origin/master'

This commit is contained in:
joylink_zhangsai 2023-09-28 14:10:53 +08:00
commit deda54551d
2 changed files with 8 additions and 8 deletions

View File

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

View File

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