private void UpdateFaultsWhenUpdate() { ApplyFault.Clear(); NoAlarmCollection.Clear(); var lstfaultshow = (from t in FaultCollection select t.FaultCode).ToList(); foreach (var t in Wlst.Sr.EquipemntLightFault.Services.FaultBandtoTmlInfoSerices.InfoDictionary) { ApplyFault.Add(t.Key, new List <int>()); var lstssss = (from g in t.Value where lstfaultshow.Contains(g) select g).ToList(); if (t.Value.Contains(0)) { lstssss.Add(0); } ApplyFault[t.Key].AddRange(lstssss); } if (!ApplyFault.ContainsKey(0)) { ApplyFault.Add(0, new List <int>()); foreach (var t in this.FaultCollection) { ApplyFault[0].Add(t.FaultCode); } } else { if (ApplyFault[0].Count == 0) { foreach (var t in this.FaultCollection) { ApplyFault[0].Add(t.FaultCode); } } } FaultChecks(); UpdateRtuSelected(); OnCurrentSelectItemChange(); }
//加载终端节点 private void LoadNode() { ChildTreeItems.Clear(); NoAlarmCollection.Clear(); if (CurrentSlecteArea == null) { return; } var groups = (from t in Wlst.Sr.EquipmentInfoHolding.Services.ServicesGrpSingleInfoHold.InfoGroups where t.Key.Item1 == CurrentSlecteArea.Value orderby t.Value.Index ascending select t.Value).ToList(); if (groups.Count == 0) { Msg = CurrentSlecteArea.Name + " 未查询到分组信息..."; //return; } else { Msg = ""; } //正常分组 foreach (var t in groups) { var grp = Wlst.Sr.EquipmentInfoHolding.Services.ServicesGrpSingleInfoHold.GetGroupInfomation(CurrentSlecteArea.Value, t.GroupId); if (grp == null) { return; } var ordtml = Sr.EquipmentInfoHolding.Services.ServicesGrpSingleInfoHold.GetRtuOrGrpIndex(grp.LstTml); if (ordtml.Count > 0) { foreach (var g in ordtml) { if (!Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.ContainsKey(g)) { continue; } if (Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[g].EquipmentType == WjParaBase.EquType.Rtu) { this.ChildTreeItems.Add(new ListTreeGroupNode(CurrentSlecteArea.Value, t.GroupId)); } break; } } } foreach (var child in ChildTreeItems) { foreach (var rtu in child.ChildTreeItems) { rtu.NodeName = rtu.PhyId.ToString().PadLeft(3, '0') + "-" + rtu.NodeName; } } var spe = Wlst.Sr.EquipmentInfoHolding.Services.ServicesGrpSingleInfoHold.GetRtuNotInAnyGroup( CurrentSlecteArea.Value); if (spe.Count > 0) { foreach (var g in spe) { if (!Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.ContainsKey(g)) { continue; } if (Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[g].EquipmentType == WjParaBase.EquType.Rtu) { this.ChildTreeItems.Add(new ListTreeGroupNode(CurrentSlecteArea.Value, 0)); break; } } } FaultChecks(); //更新选项 UpdateRtuSelected(); }