示例#1
0
        /// <summary>
        /// 根据节点修改监控范围
        /// </summary>
        public bool EditMonitorRange(PhysicalTopology pt)
        {
            var  initializer = new AreaTreeInitializer(db);
            Area area        = db.Areas.Find((i) => i.Id == pt.Id);

            if (area != null)
            {
                pt.InitBound.SetInitBound(pt.Transfrom);
                area.SetTransform(pt.Transfrom.ToDbModel());
                DbModel.Location.AreaAndDev.Bound InitBoundT = pt.InitBound.ToDbModel();
                db.Bounds.Edit(InitBoundT);
                area.SetBound(InitBoundT);
                var points = area.InitBound.Points;
                //foreach (DbModel.Location.AreaAndDev.Point p in points)
                //{
                //    DbModel.Location.AreaAndDev.Point pointT = db.Points.Find((i) => i.BoundId == InitBoundT.Id && i.Index == p.Index);
                //    if (pointT != null)
                //    {
                //        db.Points.Edit(pointT);
                //    }
                //    else
                //    {
                //        db.Points.Add(pointT);
                //    }
                //}
                db.Points.EditRange(points);
                return(db.Areas.Edit(area));
            }
            else
            {
                return(false);
            }
            //return db.Areas.Edit(pt.ToDbModel());
        }
        private void MenuInitDevs_Click(object sender, RoutedEventArgs e)
        {
            Bll bll = new Bll(false, false, false, false);
            AreaTreeInitializer initializer = new AreaTreeInitializer(bll);

            initializer.InitDevs();
            MessageBox.Show("完成");
        }
        private void MenuSaveTop_Click(object sender, RoutedEventArgs e)
        {
            Bll bll = new Bll(false, false, false, false);
            AreaTreeInitializer initializer = new AreaTreeInitializer(bll);

            initializer.SaveInitInfoXml();
            MessageBox.Show("完成");
        }
        // GET: DataInit
        public ActionResult SaveInitInfoXml()
        {
            Bll bll = Bll.NewBllNoRelation();
            AreaTreeInitializer initializer = new AreaTreeInitializer(bll);

            initializer.SaveInitInfoXml();
            return(View());
        }
        // GET: DataInit
        public ActionResult SaveInitInfoXml()
        {
            Bll bll = new Bll(false, false, false, false);
            AreaTreeInitializer initializer = new AreaTreeInitializer(bll);

            initializer.SaveInitInfoXml();
            return(View());
        }
 public override bool TickFunction()
 {
     using (Bll bll = new Bll())
     {
         AreaTreeInitializer initializer = new AreaTreeInitializer(bll);
         initializer.ClearRepeatDev(Name);
     }
     //throw new NotImplementedException();
     return(true);
 }
示例#7
0
        private void MenuInitTopo_Click(object sender, RoutedEventArgs e)
        {
            Thread thread = new Thread(() =>
            {
                AreaTreeInitializer initializer = new AreaTreeInitializer(new Bll());
                initializer.InitAreaAndDev();
                MessageBox.Show("完成");
            });

            thread.Start();
        }