Ejemplo n.º 1
0
        /// <summary>
        /// 从终端数据区域加载终端信息到ItemTmls中
        /// </summary>
        private void LoadTmlsData()
        {
            dictionaryC = new Dictionary <int, int>();
            TmlData.Clear();
            string type   = " ";
            int    i      = 0;
            var    tmpLst = new List <AreaTmlModel>();

            foreach (var t in Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems)
            {
                if (t.Value.RtuFid != 0)
                {
                    continue;
                }
                int    id   = t.Value.RtuId;
                string name = t.Value.RtuName;
                if (t.Value.RtuModel == EnumRtuModel.Wj3005)
                {
                    type = "3005终端";
                }
                else if (t.Value.RtuModel == EnumRtuModel.Wj3090)
                {
                    type = "3090终端";
                }
                else if (t.Value.RtuModel == EnumRtuModel.Wj3006)
                {
                    type = "3006终端";
                }
                else if (t.Value.RtuModel == EnumRtuModel.Wj2090)
                {
                    type = "单灯设备";
                }
                else if (t.Value.RtuModel == EnumRtuModel.Wj1080)
                {
                    type = "光控设备";
                }
                else if (t.Value.RtuModel == EnumRtuModel.Wj1050)
                {
                    type = "电表设备";
                }
                else if (t.Value.RtuModel == EnumRtuModel.Jd601)
                {
                    type = "节电设备";
                }
                else if (t.Value.RtuModel == EnumRtuModel.Wj1090)
                {
                    type = "线路检测";
                }
                else if (t.Value.RtuModel == EnumRtuModel.Wj4005)
                {
                    type = "4005终端";
                }
                var ttt = new AreaTmlModel();
                ttt.PhysicalId = Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.GetInfoById(id).RtuPhyId;
                ttt.TmlId      = id;
                ttt.AreaName   = AreaTreeItem[0].NodeName;
                ttt.IsChecked  = false;
                ttt.TmlName    = name;
                ttt.TmlType    = type;
                tmpLst.Add(ttt);
                //TmlData.Add(ttt);
                //dictionaryC.Add(ttt.TmlId, i);
                //i++;
            }
            var tmpLst2 = (from t in tmpLst orderby t.TmlType, t.PhysicalId ascending select t).ToList();

            foreach (var t in tmpLst2)
            {
                TmlData.Add(t);
                dictionaryC.Add(t.TmlId, i);
                i++;
            }
        }
Ejemplo n.º 2
0
        private void ExFastSearch()
        {
            if (string.IsNullOrEmpty(SearchText))
            {
                LoadTmlsData();
                ReLoadTmlsAreasBelong();
            }
            else
            {
                TmlData.Clear();
                dictionaryC = new Dictionary <int, int>();
                int    i    = 0;
                string type = "";
                foreach (var t in Wlst.Sr.EquipmentInfoHolding.Services.EquipmentDataInfoHold.InfoItems)
                {
                    if (t.Value.RtuName.Contains(this.SearchText) || StringContainKeyword(t.Value.RtuName, SearchText) || t.Value.RtuPhyId.ToString().PadLeft(4, '0').Contains(SearchText))
                    {
                        if (t.Value.RtuModel == EnumRtuModel.Wj3005)
                        {
                            type = "3005终端";
                        }
                        else if (t.Value.RtuModel == EnumRtuModel.Wj3090)
                        {
                            type = "3090终端";
                        }
                        else if (t.Value.RtuModel == EnumRtuModel.Wj3006)
                        {
                            type = "3006终端";
                        }
                        else if (t.Value.RtuModel == EnumRtuModel.Wj2090)
                        {
                            type = "单灯设备";
                        }
                        else if (t.Value.RtuModel == EnumRtuModel.Wj4005)
                        {
                            type = "4005终端";
                        }
                        else if (t.Value.RtuModel == EnumRtuModel.Wj1080)
                        {
                            type = "光控设备";
                            if (t.Value.RtuFid != 0)
                            {
                                continue;
                            }
                        }
                        else if (t.Value.RtuModel == EnumRtuModel.Wj1050)
                        {
                            type = "电表设备";
                            if (t.Value.RtuFid != 0)
                            {
                                continue;
                            }
                        }
                        else if (t.Value.RtuModel == EnumRtuModel.Jd601)
                        {
                            if (t.Value.RtuFid != 0)
                            {
                                continue;
                            }
                            type = "节电设备";
                        }
                        else if (t.Value.RtuModel == EnumRtuModel.Wj1090)
                        {
                            if (t.Value.RtuFid != 0)
                            {
                                continue;
                            }
                            type = "线路检测";
                        }
                        var SearchResult = new AreaTmlModel();
                        var areaId       = Sr.EquipmentInfoHolding.Services.AreaInfoHold.MySlef.GetRtuBelongArea(t.Value.RtuId);
                        SearchResult.AreaId     = areaId;
                        SearchResult.PhysicalId = t.Value.RtuPhyId;
                        SearchResult.TmlId      = t.Value.RtuId;
                        SearchResult.TmlName    = t.Value.RtuName;
                        SearchResult.TmlType    = type;


                        this.TmlData.Add(SearchResult);
                        dictionaryC.Add(SearchResult.TmlId, i);
                        i++;
                    }
                }
                ReLoadTmlsAreasBelong();
            }
        }