From feace07deaed471eaddc949a2c6a60e91bea3cac Mon Sep 17 00:00:00 2001 From: weizhihong Date: Thu, 7 Dec 2023 16:15:29 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wayside/memory/wayside_memory_map_init.go | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ts/simulation/wayside/memory/wayside_memory_map_init.go b/ts/simulation/wayside/memory/wayside_memory_map_init.go index 8785df1..de675fb 100644 --- a/ts/simulation/wayside/memory/wayside_memory_map_init.go +++ b/ts/simulation/wayside/memory/wayside_memory_map_init.go @@ -2,6 +2,7 @@ package memory import ( "fmt" + "log/slog" "strings" "sync" @@ -91,13 +92,16 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) { var sections []*graphicData.Section for _, d := range data.Section { if otherDeviceIdMap[d.Common.Id] { + slog.Warn("区段[id:%s][code:%s]设备是其他线路设备已过滤", d.Common.Id, d.Code) continue } if d.PaRef != nil && otherDeviceIdMap[d.PaRef.Id] { d.PaRef = nil + slog.Warn("区段[id:%s][code:%s]设备A端是其他线路设备已置空", d.Common.Id, d.Code) } if d.PbRef != nil && otherDeviceIdMap[d.PbRef.Id] { d.PbRef = nil + slog.Warn("区段[id:%s][code:%s]设备B端是其他线路设备已置空", d.Common.Id, d.Code) } var acs []string for _, id := range d.AxleCountings { @@ -106,9 +110,6 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) { } acs = append(acs, id) } - if len(d.AxleCountings) > 1 && len(acs) == 0 { - continue - } d.AxleCountings = acs if otherDeviceIdMap[d.TrackSectionId] { d.TrackSectionId = "" @@ -120,6 +121,7 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) { var axleCounts []*graphicData.AxleCounting for _, d := range data.AxleCountings { if otherDeviceIdMap[d.Common.Id] { + slog.Warn("计轴[id:%s][code:%s]设备其他线路设备已过滤", d.Common.Id, d.Code) continue } var refs []*graphicData.RelatedRef @@ -137,16 +139,20 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) { var turnouts []*graphicData.Turnout for _, d := range data.Turnouts { if otherDeviceIdMap[d.Common.Id] { + slog.Warn("道岔[id:%s][code:%s]设备其他线路设备已过滤", d.Common.Id, d.Code) continue } if d.PaRef != nil && otherDeviceIdMap[d.PaRef.Id] { d.PaRef = nil + slog.Warn("道岔[id:%s][code:%s]设备A端是其他线路设备已置空", d.Common.Id, d.Code) } if d.PbRef != nil && otherDeviceIdMap[d.PbRef.Id] { d.PbRef = nil + slog.Warn("道岔[id:%s][code:%s]设备B端是其他线路设备已置空", d.Common.Id, d.Code) } if d.PcRef != nil && otherDeviceIdMap[d.PcRef.Id] { d.PcRef = nil + slog.Warn("道岔[id:%s][code:%s]设备C端是其他线路设备已置空", d.Common.Id, d.Code) } if d.PaTrackSectionId != "" && otherDeviceIdMap[d.PaTrackSectionId] { d.PaTrackSectionId = "" @@ -164,9 +170,7 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) { var signals []*graphicData.Signal for _, d := range data.Signals { if otherDeviceIdMap[d.Common.Id] { - continue - } - if d.RefDev != nil && otherDeviceIdMap[d.RefDev.Id] { + slog.Warn("信号机[id:%s][code:%s]设备其他线路设备已过滤", d.Common.Id, d.Code) continue } signals = append(signals, d) @@ -176,9 +180,7 @@ func filterOtherLineDevice(data *graphicData.RtssGraphicStorage) { var transponders []*graphicData.Transponder for _, d := range data.Transponders { if otherDeviceIdMap[d.Common.Id] { - continue - } - if d.TransponderRef != nil && otherDeviceIdMap[d.TransponderRef.Id] { + slog.Warn("应答器[id:%s][code:%s]设备其他线路设备已过滤", d.Common.Id, d.Code) continue } transponders = append(transponders, d)