From ec9e1364953b79f217570844d940ff7f7540e5b1 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Thu, 7 Dec 2023 10:54:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90IBP=E7=9B=98=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=89=93=E5=8D=B0=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entity/ibp.go | 10 +++++----- entity/station.go | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/entity/ibp.go b/entity/ibp.go index 76ae4ff..3766d3f 100644 --- a/entity/ibp.go +++ b/entity/ibp.go @@ -170,7 +170,7 @@ func LoadEMPEntity(w ecs.World, entry *ecs.Entry, datas []*repository.Electronic d.EMPJ = NewRelayEntity(w, r, entityMap) emp.EMPJMap[r.Code()] = d } else { - slog.Warn("车站未实现设备[id:%s]逻辑", c.Id()) + slog.Warn("未实现设备[id:%s]逻辑", c.Id()) } } } @@ -188,20 +188,20 @@ func LoadEMPEntity(w ecs.World, entry *ecs.Entry, datas []*repository.Electronic } else if ok && strings.HasPrefix(c.Code(), "EMP") { d.EMP_BTNS = append(d.EMP_BTNS, NewButtonEntity(w, b, entityMap)) } else { - slog.Warn("车站未实现设备[id:%s]逻辑", c.Id()) + slog.Warn("未实现设备[id:%s]逻辑", c.Id()) } } emp.EMPJMap[g.Code()] = d } } if emp.Alarm == nil || emp.QBA == nil || emp.SDA == nil { - return fmt.Errorf("车站EMP组合初始化出错,请检查IBP地图组合数据") + return fmt.Errorf("EMP组合初始化出错,请检查IBP地图组合数据") } for code, e := range emp.EMPJMap { if e.EMPFA_BTN == nil || e.EMPD == nil || len(e.EMP_BTNS) == 0 { - return fmt.Errorf("车站组合[%s]还原按钮未关联,请检查IBP地图组合数据", code) + return fmt.Errorf("组合[%s]还原按钮未关联,请检查IBP地图组合数据", code) } else if e.EMPJ == nil { - return fmt.Errorf("车站组合[%s]还原按钮未关联,请检查继电器地图组合数据", code) + return fmt.Errorf("组合[%s]继电器未关联,请检查继电器地图组合数据", code) } } entry.AddComponent(component.EmpElectronicType, unsafe.Pointer(emp)) diff --git a/entity/station.go b/entity/station.go index 185fb78..a8ddebb 100644 --- a/entity/station.go +++ b/entity/station.go @@ -1,6 +1,8 @@ package entity import ( + "fmt" + "joylink.club/ecs" "joylink.club/rtsssimulation/component" ) @@ -25,11 +27,11 @@ func LoadStations(w ecs.World) error { entry := NewStationEntity(w, station.Id(), data) err = LoadSPKEntity(w, entry, station.SpksComponents(), data) // 人员防护 if err != nil { - return err + return fmt.Errorf("车站【%s】人员防护error:%s", station.Id(), err.Error()) } err = LoadEMPEntity(w, entry, station.EmpGroups(), data) // 紧急停车 if err != nil { - return err + return fmt.Errorf("车站【%s】紧急停车error:%s", station.Id(), err.Error()) } } return nil