From 2b7120831a2b3c8d0da1325329eb6ed5584d8811 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Thu, 9 Nov 2023 13:09:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=81=93=E5=B2=94=E7=BB=91=E5=AE=9A=E7=9A=84=E7=89=A9?= =?UTF-8?q?=E7=90=86=E5=8C=BA=E6=AE=B5=E6=96=B9=E6=B3=95=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/turnout.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repository/turnout.go b/repository/turnout.go index 53f2119..c9f16ba 100644 --- a/repository/turnout.go +++ b/repository/turnout.go @@ -3,6 +3,7 @@ package repository import ( "errors" "fmt" + "joylink.club/rtsssimulation/repository/model/proto" ) @@ -278,6 +279,10 @@ func (t *Turnout) FindRelay(groupCode, relayCode string) *Relay { return nil } +func (t *Turnout) GetPhysicalSection() *PhysicalSection { + return t.section +} + type TurnoutPort struct { turnout *Turnout port proto.Port From fa5ed10810475a4b640da593b5b344ddda287012 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Thu, 9 Nov 2023 13:16:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90=E8=8E=B7=E5=8F=96=E9=81=93?= =?UTF-8?q?=E5=B2=94=E5=AF=B9=E5=BA=94=E7=AB=AF=E5=8F=A3=E7=9A=84=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=85=B3=E7=B3=BB=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/turnout.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repository/turnout.go b/repository/turnout.go index c9f16ba..b72d987 100644 --- a/repository/turnout.go +++ b/repository/turnout.go @@ -283,6 +283,10 @@ func (t *Turnout) GetPhysicalSection() *PhysicalSection { return t.section } +func (t *Turnout) GindDevicePortByPort(port proto.Port) DevicePort { + return t.findDevicePortByPort(port) +} + type TurnoutPort struct { turnout *Turnout port proto.Port From 6c09377b4a82d527b71d4f2c34db06d6fb59dd39 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Thu, 9 Nov 2023 14:18:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E6=A0=B9?= =?UTF-8?q?=E6=8D=AEID=E6=9F=A5=E6=89=BE=E8=AE=BE=E5=A4=87=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/repository.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/repository/repository.go b/repository/repository.go index 1c98cda..fec6674 100644 --- a/repository/repository.go +++ b/repository/repository.go @@ -71,6 +71,21 @@ func (repo *Repository) FindById(id string) Identity { if md, ok := repo.relayMap[id]; ok { return md } + if md, ok := repo.physicalSectionMap[id]; ok { + return md + } + if md, ok := repo.checkPointMap[id]; ok { + return md + } + if md, ok := repo.responderMap[id]; ok { + return md + } + if md, ok := repo.stationMap[id]; ok { + return md + } + if md, ok := repo.platformMap[id]; ok { + return md + } return nil }