Пример #1
0
        //加载终端节点
        private void LoadMainEquipmentInfo()
        {
            int x = 0;

            MainEquipmentList.Clear();
            // ZoomLevel = 16;

            Random rand = new Random();
            int    min  = 0;
            int    max  = 999999;

            //int a = rand.Next(min, max);

            //main equipment
            foreach (
                var f in Sr.EquipmentInfoHolding.Services.ServicesEquipemntInfoHold.EquipmentInfoDictionary.Values)
            {
                try
                {
                    if (f.AttachRtuId > 0)
                    {
                        continue;
                    }

                    x++;
                    if (f.Xmap.Equals(0))
                    {
                        f.Xmap = 0.0001;
                        //if (f.Xgis > 0.25) f.Xgis = f.Xgis - 0.25;
                    }
                    if (f.Ymap.Equals(0))
                    {
                        f.Ymap = 0.0001;
                        //if (f.Ygis > 0.20) f.Ygis = f.Ygis - 0.20;
                    }


                    var ggg = new MapNodeViewModel()
                    {
                        EquipmentRtuId    = f.RtuId,
                        EquipmentLocation = new Location(f.Xmap, f.Ymap),
                        Visi          = Visibility.Visible,
                        EquipmentName = f.RtuName
                    };


                    MainEquipmentList.Add(ggg);
                    ggg.UpdateTmlStateInfomation();
                }
                catch (Exception ex)
                {
                    WriteLog.WriteLogError("RadMapJpeg LoadEquipmentInfo Error when conver to IIEquipmentInfo:" + ex);
                }
            }
        }
Пример #2
0
        //public void ReloadAttachEquipment()
        //{
        //    LoadAttachEquipmentInfo();
        //}

        public void AddMainEquipment(int rtuId)
        {
            try
            {
                if (
                    !Sr.EquipmentInfoHolding.Services.ServicesEquipemntInfoHold.EquipmentInfoDictionary.
                    ContainsKey(rtuId))
                {
                    return;
                }
                if (Sr.EquipmentInfoHolding.Services.ServicesEquipemntInfoHold.EquipmentInfoDictionary[rtuId].AttachRtuId != 0)
                {
                    return;
                }
                foreach (var t in MainEquipmentList)
                {
                    if (t.EquipmentRtuId == rtuId)
                    {
                        return;
                    }
                }

                var f =
                    Sr.EquipmentInfoHolding.Services.ServicesEquipemntInfoHold.EquipmentInfoDictionary [
                        rtuId]
                ;
                // if (f.RtuModel != 1050) return;

                if (f.Xmap.Equals(0))
                {
                    f.Xmap = 0.005;
                }
                if (f.Ymap.Equals(0))
                {
                    f.Ymap = 0.005;
                }

                var ggg = new MapNodeViewModel()
                {
                    EquipmentRtuId      = f.RtuId,
                    EquipmentLocation   = new Location(f.Xmap, f.Ymap),
                    EquipmentImageState = 2,
                    Visi          = Visibility.Visible,
                    EquipmentName = f.RtuName
                };

                MainEquipmentList.Add(ggg);
                ggg.UpdateTmlStateInfomation();
            }
            catch (Exception ex)
            {
                WriteLog.WriteLogError(
                    "RadMapJpeg LoadAttachEquipmentInfo Error when conver to IIEquipmentInfo:" + ex);
            }
        }