public void NavOnLoad(params object[] parsObjects)
        {
            InvalidTmlList.Clear();

            KGLSelect   = false;
            MNLSelect   = false;
            TYSelect    = false;
            BYSelect    = false;
            ZBZQSelect  = false;
            ZBZQThres   = 250;
            PBYDLSelect = false;
        }
 public void OnUserHideOrClosing()
 {
     InvalidTmlList.Clear();
 }
        private void ExQuery()
        {
            InvalidTmlList.Clear();
            int index = 1;

            foreach (var t in EquipmentDataInfoHold.InfoItems)
            {
                bool   add       = false;
                string faultType = string.Empty;

                if (t.Value.EquipmentType == WjParaBase.EquType.Rtu)
                {
                    if (MNLSelect == true)
                    {
                        var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Value.RtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu;

                        if (tt != null)
                        {
                            List <int> MoniliangID = new List <int>();

                            foreach (var ttt in tt.WjLoops.Values)
                            {
                                if (ttt.VectorMoniliang != 0)
                                {
                                    foreach (var m in MoniliangID)
                                    {
                                        if (m == ttt.VectorMoniliang)
                                        {
                                            add        = true;
                                            faultType += "模拟量缺省,";
                                            break;
                                        }
                                    }

                                    if (add)
                                    {
                                        break;
                                    }
                                    else
                                    {
                                        MoniliangID.Add(ttt.VectorMoniliang);
                                    }
                                }
                            }

                            foreach (var m in MoniliangID)
                            {
                                if ((m < 1) || (m > MoniliangID.Count))
                                {
                                    add        = true;
                                    faultType += "模拟量缺省,";
                                    break;
                                }
                            }
                        }
                    }

                    if (KGLSelect == true)
                    {
                        var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Value.RtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu;

                        bool fault = false;

                        if (tt != null)
                        {
                            foreach (var ttt in tt.WjSwitchOuts.Values)
                            {
                                if (ttt.SwitchVecotr != ttt.SwitchId)
                                {
                                    add        = true;
                                    faultType += "开关量缺省,";
                                    fault      = true;
                                    break;
                                }
                            }

                            int[] loopNum = new int[6];

                            if (fault == false)
                            {
                                foreach (var ttt in tt.WjLoops.Values)
                                {
                                    if (ttt.SwitchOutputId != 0)
                                    {
                                        loopNum[ttt.SwitchOutputId - 1]++;

                                        if (ttt.SwitchOutputId != ttt.VectorSwitchIn)
                                        {
                                            add        = true;
                                            faultType += "开关量缺省,";
                                            fault      = true;
                                            break;
                                        }
                                    }
                                }
                            }

                            if (fault == false)
                            {
                                for (int i = 1; i < 6; i++)
                                {
                                    if ((loopNum[i] != 0) && (loopNum[i - 1] == 0))
                                    {
                                        add        = true;
                                        faultType += "开关量缺省,";
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    if (TYSelect == true)
                    {
                        if (t.Value.RtuStateCode == 1)
                        {
                            add        = true;
                            faultType += "状态停运,";
                        }
                    }

                    if (BYSelect == true)
                    {
                        if (t.Value.RtuStateCode == 0)
                        {
                            add        = true;
                            faultType += "状态不用,";
                        }
                    }

                    if (ZBZQSelect == true)
                    {
                        var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Value.RtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu;

                        if (tt != null)
                        {
                            if (tt.WjGprs.RtuReportCycle < ZBZQThres)
                            {
                                add        = true;
                                faultType += "主报周期过小,";
                            }
                        }
                    }

                    if (PBYDLSelect == true)
                    {
                        var tt = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems[t.Value.RtuId] as Wlst.Sr.EquipmentInfoHolding.Model.Wj3005Rtu;

                        if (tt != null)
                        {
                            foreach (var ttt in tt.WjLoops.Values)
                            {
                                if (ttt.IsShieldLoop != 0)
                                {
                                }
                            }
                        }
                    }

                    if (add == true)
                    {
                        var tmp = ServicesGrpSingleInfoHold.GetRtuBelongGrp(t.Value.RtuId);

                        var grpName = "未分组";
                        if (tmp != null)
                        {
                            grpName =
                                (ServicesGrpSingleInfoHold.InfoGroups[new Tuple <int, int>(tmp.Item1, tmp.Item2)]).
                                GroupName;
                        }

                        InvalidTmlList.Add(new InvalidTmlModel
                        {
                            Index     = index,
                            RtuId     = t.Value.RtuId,
                            PhyId     = t.Value.RtuPhyId,
                            RtuName   = t.Value.RtuName,
                            GrpName   = grpName,
                            FaultType = faultType.Substring(0, faultType.Length - 1)
                        });

                        index++;
                    }
                    else
                    {
                    }
                }
            }

            if (InvalidTmlList.Count != 0)
            {
                ShowMsg = "共查询到" + InvalidTmlList.Count + "个记录";
            }
            else
            {
                ShowMsg = string.Empty;
            }
        }