From f13d1ed4684dcfbf215fa750a7a3513eccff92c4 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 26 Sep 2023 13:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9E=84=E5=BB=BAprotoReposi?= =?UTF-8?q?tory=20bug=EF=BC=9B=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=81=93=E5=B2=94=E7=8A=B6=E6=80=81=E7=9A=84=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wayside/memory/wayside_memory_turnout.go | 6 +++++- .../simulation/wayside/memory/wayside_simulation.go | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ats/verify/simulation/wayside/memory/wayside_memory_turnout.go b/ats/verify/simulation/wayside/memory/wayside_memory_turnout.go index fe41f41..4c3d1ec 100644 --- a/ats/verify/simulation/wayside/memory/wayside_memory_turnout.go +++ b/ats/verify/simulation/wayside/memory/wayside_memory_turnout.go @@ -16,7 +16,11 @@ func ChangeTurnoutState(simulation *VerifySimulation, status *state.SwitchState, panic(&dto.ErrorDto{Code: dto.ArgumentParseError, Message: "参数转换出错"}) } uid := QueryUidByMidAndIndex(mapId, int32(index), &graphicData.Turnout{}) - entities.TurnToNormal(simulation.WorldId, uid) + if status.Normal { + entities.TurnToNormal(simulation.WorldId, uid) + } else if status.Reverse { + entities.TurnToReverse(simulation.WorldId, uid) + } //log.Default().Printf("修改道岔【UID:%s】\n", uid) //allSwitchMap := &simulation.Memory.Status.SwitchStateMap //d, ok := allSwitchMap.Load(uid) diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index 188a878..e737b65 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -209,9 +209,13 @@ func relateRelay(repo *proto.Repository, relayGi *graphicData.RelayCabinetGraphi continue } for _, group := range relationship.Combinationtypes { + var relayUIds []string + for _, relayId := range group.RefRelays { + relayUIds = append(relayUIds, uidsMap.RelayIds[relayId].Uid) + } turnout.RelayGroups = append(turnout.RelayGroups, &proto.RelayGroup{ Code: group.Code, - RelayIds: group.RefRelays, + RelayIds: relayUIds, }) } case graphicData.RelatedRef_signal: @@ -220,9 +224,13 @@ func relateRelay(repo *proto.Repository, relayGi *graphicData.RelayCabinetGraphi continue } for _, group := range relationship.Combinationtypes { + var relayUIds []string + for _, relayId := range group.RefRelays { + relayUIds = append(relayUIds, uidsMap.RelayIds[relayId].Uid) + } signal.RelayGroups = append(signal.RelayGroups, &proto.RelayGroup{ Code: group.Code, - RelayIds: group.RefRelays, + RelayIds: relayUIds, }) } }