|
@@ -52,6 +52,7 @@ type t_data_check_area_ied struct {
|
|
|
IedType string
|
|
|
ScdId int64
|
|
|
PType string
|
|
|
+ IedNo string //所属间隔下支路(线路)在SCD中端子实际编号,如在母线间隔下支路9
|
|
|
Cr int // '创建人' ,
|
|
|
Ct string `orm:"-"` // '创建时间' ,
|
|
|
Ur int // '更新人' ,
|
|
@@ -265,6 +266,13 @@ func (c *CheckAreaMgr) UpdateIeds(scdid int64, areaid int, ieds string) error {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
+//设置间隔下指定装置的端子编号,该编号只有在端子匹配表达式中存在{no}标识时才会使用
|
|
|
+func (c *CheckAreaMgr) SetIedNo(areaid int, iedname, no string) error {
|
|
|
+ db := orm.NewOrm()
|
|
|
+ _, err := db.Raw("update t_data_check_area_ied set ied_no=? where area_id=? and ied_name=?", no, areaid, iedname).Exec()
|
|
|
+ return err
|
|
|
+}
|
|
|
+
|
|
|
//获取指定SCD的IED类型列表
|
|
|
func (c *CheckAreaMgr) GetIedTypeList(scdid int64) ([]orm.Params, error) {
|
|
|
db := orm.NewOrm()
|
|
@@ -638,7 +646,7 @@ func (c *CheckAreaMgr) CheckIedFcda() error {
|
|
|
}
|
|
|
//获取该间隔下该类型的装置
|
|
|
s1 := []orm.Params{}
|
|
|
- _, err = db.Raw("select ied_name from t_data_check_area_ied where area_id=?", area_id).Values(&s1)
|
|
|
+ _, err = db.Raw("select ied_name,ied_no from t_data_check_area_ied where area_id=?", area_id).Values(&s1)
|
|
|
typeMappingMgr := new(SysCheckModelIedtypeMappingMgr)
|
|
|
pmCode := c.getIedTypeCode(modelid, "PM")
|
|
|
//循环处理关联关系
|
|
@@ -702,7 +710,7 @@ func (c *CheckAreaMgr) CheckIedFcda() error {
|
|
|
if extreflist == nil {
|
|
|
extreflist = getIedExtRefs(iedname)
|
|
|
}
|
|
|
- for outiedname, _ := range outiedlist {
|
|
|
+ for outiedname, outied := range outiedlist {
|
|
|
if iedname == outiedname {
|
|
|
continue
|
|
|
}
|
|
@@ -718,12 +726,24 @@ func (c *CheckAreaMgr) CheckIedFcda() error {
|
|
|
continue
|
|
|
}
|
|
|
outiedFcdaList := getIedFcdas(outiedname) //输入装置的信号输出端子
|
|
|
+ //是否设置的端子编号
|
|
|
+ noText := tools.IsEmpty(ied["ied_no"])
|
|
|
+ if noText == "" {
|
|
|
+ noText = tools.IsEmpty(outied["ied_no"])
|
|
|
+ }
|
|
|
//检查是否有错误和缺失的端子
|
|
|
for _, r := range refrow {
|
|
|
extref_name := tools.IsEmpty(r["to_fcda_name"])
|
|
|
fcda_name := tools.IsEmpty(r["from_fcda_name"])
|
|
|
extref_name_exp := tools.IsEmpty(r["to_fcda_match_exp"])
|
|
|
fcda_name_exp := tools.IsEmpty(r["from_fcda_match_exp"])
|
|
|
+ //端子编号处理
|
|
|
+ if strings.Index(extref_name_exp, "{no}") > -1 {
|
|
|
+ extref_name_exp = strings.ReplaceAll(extref_name_exp, "{no}", noText)
|
|
|
+ }
|
|
|
+ if strings.Index(fcda_name_exp, "{no}") > -1 {
|
|
|
+ fcda_name_exp = strings.ReplaceAll(fcda_name_exp, "{no}", noText)
|
|
|
+ }
|
|
|
funcExist := false //判断接收端设计的端子是否存在
|
|
|
extrefObj := new(node_attr.NExtRef)
|
|
|
fcda2Exist := false
|