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 -}