From af28993e2493b75c161e22c8343be1992066de6b Mon Sep 17 00:00:00 2001 From: weizhihong Date: Thu, 24 Aug 2023 10:24:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=A8=E5=8A=9B=E5=AD=A6=E7=81=AB?= =?UTF-8?q?=E8=BD=A6=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E5=88=97=E8=BD=A6?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/wayside/memory/wayside_memory_train.go | 11 ++++++----- dynamics/httpData.go | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ats/verify/simulation/wayside/memory/wayside_memory_train.go b/ats/verify/simulation/wayside/memory/wayside_memory_train.go index 542e6b1..7a2ac20 100644 --- a/ats/verify/simulation/wayside/memory/wayside_memory_train.go +++ b/ats/verify/simulation/wayside/memory/wayside_memory_train.go @@ -32,11 +32,12 @@ func AddTrainState(simulation *VerifySimulation, status *state.TrainState) { status.Up = up status.PointTo = pointTo httpCode, _, err := dynamics.SendInitTrainReq(&dynamics.InitTrainInfo{ - TrainIndex: uint16(trainIndex), - LinkIndex: uint16(linkId), - LinkOffset: uint32(loffset), - Speed: uint16(math.Round(float64(status.Speed * 10))), - Up: status.Up, + TrainIndex: uint16(trainIndex), + LinkIndex: uint16(linkId), + LinkOffset: uint32(loffset), + Speed: uint16(math.Round(float64(status.Speed * 10))), + Up: status.Up, + TrainLength: uint16(status.TrainLength), }) zap.S().Debugf("添加列车:[%d-%s-%d]", trainIndex, status.HeadLinkId, status.HeadLinkOffset) zap.S().Debugf("列车初始化:[%d-%d-%d]", trainIndex, linkId, loffset) diff --git a/dynamics/httpData.go b/dynamics/httpData.go index 70eba2d..d35916f 100644 --- a/dynamics/httpData.go +++ b/dynamics/httpData.go @@ -5,8 +5,9 @@ type InitTrainInfo struct { LinkIndex uint16 `json:"linkIndex"` LinkOffset uint32 `json:"linkOffset"` //单位0.1km/h - Speed uint16 `json:"speed"` - Up bool `json:"up"` + Speed uint16 `json:"speed"` + Up bool `json:"up"` + TrainLength uint16 `json:"trainLength"` } // LineBaseInfo 线路基础信息,提供给动力学作为计算依据