예제 #1
0
        private void ExAdd()
        {
            if (CurrentSelectItem != null && !CurrentSelectItem.IsGroup && !CurrentSelectItem.IsNoAlarm)
            {
                NoAlarmCollection.Add(new NoAlarmViewModel()
                {
                    PhyId   = CurrentSelectItem.PhyId,
                    RtuId   = CurrentSelectItem.NodeId,
                    RtuName = CurrentSelectItem.NodeName
                });

                CurrentSelectItem.IsNoAlarm = true;
            }
        }
예제 #2
0
        /// <summary>
        /// 根据缓存的故障信息 对终端列表Select进行设置
        /// </summary>
        private void UpdateRtuSelected()
        {
            var lst = ApplyFault.Keys.ToList();

            var ntsg = (from t in Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems
                        where t.Value.EquipmentType == WjParaBase.EquType.Rtu
                        orderby t.Key ascending
                        select t).ToList();


            foreach (var t in ListTreeTmlNode.Info)
            {
                if (lst.Contains(t.Key))
                {
                    if (ApplyFault[t.Key].Contains(0))
                    {
                        var phyid   = 0;
                        var rtuname = "";
                        if (Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems.ContainsKey(t.Key))
                        {
                            phyid   = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Key].RtuPhyId;
                            rtuname = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Key].RtuName;
                        }
                        else
                        {
                            continue;
                        }


                        NoAlarmCollection.Add(new NoAlarmViewModel()
                        {
                            PhyId   = phyid,
                            RtuId   = t.Key,
                            RtuName = rtuname
                        });
                        t.Value.IsNoAlarm = true;

                        if (ApplyFault[t.Key].Count == 1)
                        {
                            t.Value.IsSelected = false;
                        }
                        else
                        {
                            t.Value.IsSelected = true;
                        }
                    }
                    else
                    {
                        t.Value.IsSelected = true;
                        t.Value.IsNoAlarm  = false;
                    }
                }
                else
                {
                    t.Value.IsSelected = false;
                    t.Value.IsNoAlarm  = false;
                }
            }

            foreach (var t in ChildTreeItems)
            {
                if (t.IsGroup)
                {
                    t.UpdateNodeSelected();
                    t.UpdateNoAlarmSelected();
                }
            }
        }