From 32b4b9ba0292965ac560f981ff289d34edf0ab7a Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 9 Jan 2024 14:51:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=BE=AA=E7=8E=AF=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/simulation.go | 3 ++- bj-rtss-message | 2 +- rtss_simulation | 2 +- .../wayside/memory/wayside_memory_transponder.go | 4 +--- ts/test_simulation_manage.go | 9 --------- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/api/simulation.go b/api/simulation.go index ed6547d..c88a3de 100644 --- a/api/simulation.go +++ b/api/simulation.go @@ -573,8 +573,9 @@ func transponderMove(c *gin.Context) { if err := c.ShouldBind(&req); err != nil { panic(sys_error.New("应答器移位操作失败,请求参数异常", err)) } + simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", req) - err := memory.TransponderMove(req) + err := memory.TransponderMove(simulation, req) if err != nil { panic(sys_error.New(fmt.Sprintf("应答器移位操作失败,%s", err.Error()), err)) } diff --git a/bj-rtss-message b/bj-rtss-message index 13ed3c7..999608f 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 13ed3c733cea89b06b95d2cc6ac4912ade8cb75a +Subproject commit 999608fa88a430cba9bef8915f76993a0e4c6d8e diff --git a/rtss_simulation b/rtss_simulation index 3b685c9..a4c1721 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit 3b685c99bee48ce05858384c9af357b98ba225d7 +Subproject commit a4c17218f7e1901fa25c9c90905a1749f5c57068 diff --git a/ts/simulation/wayside/memory/wayside_memory_transponder.go b/ts/simulation/wayside/memory/wayside_memory_transponder.go index 2a9f749..a65379d 100644 --- a/ts/simulation/wayside/memory/wayside_memory_transponder.go +++ b/ts/simulation/wayside/memory/wayside_memory_transponder.go @@ -4,14 +4,12 @@ import ( "fmt" "joylink.club/bj-rtsts-server/dto" "joylink.club/bj-rtsts-server/sys_error" - "joylink.club/bj-rtsts-server/ts" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/component/component_proto" "joylink.club/rtsssimulation/entity" ) -func TransponderMove(req *dto.TransponderMoveReqDto) error { - simulation := ts.GetSimulation(req.SimulationId) +func TransponderMove(simulation *VerifySimulation, req *dto.TransponderMoveReqDto) error { worldData := entity.GetWorldData(simulation.World) link := worldData.Repo.FindLink(simulation.uidMap[req.LinkId].Uid) if link == nil { diff --git a/ts/test_simulation_manage.go b/ts/test_simulation_manage.go index 917492f..7ad42fb 100644 --- a/ts/test_simulation_manage.go +++ b/ts/test_simulation_manage.go @@ -181,12 +181,3 @@ func FindSimulation(simulationId string) *memory.VerifySimulation { } return nil } - -// GetSimulation 获取仿真 -func GetSimulation(simulationId string) *memory.VerifySimulation { - simulation := FindSimulation(simulationId) - if simulation == nil { - panic(sys_error.New(fmt.Sprintf("仿真[%s]不存在", simulationId))) - } - return simulation -}