コード例 #1
0
        /// <summary>
        /// 响应鼠标按下事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            if(CurrentMode==ADDMODE)
            {
                Point cp = e.GetPosition(context);      //获取相关坐标
                cp.X = cp.X + 7-App.StrokeThinkness/2;
                cp.Y = cp.Y + 7-App.StrokeThinkness/2;  //设置为中心
                RainCover c = new RainCover("雨水检查井", GetMercator(cp), "双击查看详细信息");
                //添加其他相关信息
                c.Location = GetMercator(cp);

                JuncAddCommand cmd = new JuncAddCommand(this, c);
                cmd.Excute();
                CmdManager.getInstance().PushCmd(cmd);
            }
            else if(CurrentMode==DELMODE)
            {
                Path path = e.Source as Path;
                if (path == null)
                {
                    base.OnMouseDown(sender, e);          //若都不是添加或删除命令,则交给父类进行处理
                    return;
                }
                JuncDelCommand cmd = new JuncDelCommand(this, path);
                cmd.Excute();
                CmdManager.getInstance().PushCmd(cmd);
            }
            base.OnMouseDown(sender, e);                //若都不是添加或删除命令,则交给父类进行处理
        }
コード例 #2
0
ファイル: ArcMap.cs プロジェクト: chijianfeng/PNManager
        public void LoadRainPipe()
        {
            TPipeInfo        pipeinfo = new TPipeInfo(App._dbpath, App.PassWord);       //读取数据库
            List <CPipeInfo> pipelist = pipeinfo.Sel_PipeInfo((int)PIPETYPE.PIPE_RAIN); //仅仅读取雨水管道

            TUSInfo        usinfo = new TUSInfo(App._dbpath, App.PassWord);
            List <CUSInfo> uslist = usinfo.Load_USInfo();

            foreach (CPipeInfo info in pipelist)
            {
                RainPipe  pipe     = null;
                RainCover starjunc = FindStartRJunc(info);                    //找到起始点坐标
                RainCover endjunc  = FindEndRJunc(info);                      //找到终止点坐标
                if (starjunc == null || endjunc == null)
                {
                    continue;
                }

                pipe = new RainPipe(starjunc, endjunc);

                pipe.pipeInfo = info;
                pipe.UsInfo   = FindUSInfo(uslist, info.ID);
                RainPipeList.Add(pipe);
            }
        }
コード例 #3
0
ファイル: ArcMap.cs プロジェクト: chijianfeng/PNManager
        RainCover FindEndRJunc(CPipeInfo cp)
        {
            RainCover c = null;

            c = RainCoverList.Find(cc => cc.juncInfo.ID == cp.Out_JunID);
            return(c);
        }
コード例 #4
0
 public void AddJunc(RainCover c)           //添加雨水检查井
 {
     listRains.Add(c);
     //计算点的坐标
     mListScreenpoint.Add(state.Mercator2Screen(c.Location));
  
 }
コード例 #5
0
ファイル: ArcMap.cs プロジェクト: chijianfeng/PNManager
        public void LoadRainCover() 
        {
            TJuncInfo juninfo = new TJuncInfo(App._dbpath, App.PassWord);
            List<CJuncInfo> tmplist = juninfo.Sel_JuncInfoByCaty((int)JUNCTYPE.JUNC_RAIN);            //仅仅加载雨水检查井
            //进行坐标转换
            foreach (CJuncInfo mJunc in tmplist)
            {
                if (mJunc.X_Coor == 0)                                           //无座标
                    continue;
                RainCover cover = null;
                Point p = new Point(mJunc.X_Coor - Constants.COOR_X_OFFSET, mJunc.Y_Coor - Constants.COOR_Y_OFFSET);

                cover = new RainCover(mJunc.JuncName, GISConverter.WGS842Merator(p), mJunc.SystemID);
                cover.juncInfo = mJunc;
                RainCoverList.Add(cover);
            }
        }
コード例 #6
0
 public void DelJunc(RainCover c)
 {
     int index = 0;
     foreach(RainCover tmpc in listRains)
     {
         if(c.Name.Equals(tmpc.Name))
         {
             break;
         }
         index++;
     }
     if (index < listRains.Count)
     {
         listRains.RemoveAt(index);
         mListScreenpoint.RemoveAt(index);
     }
 }
コード例 #7
0
ファイル: ArcMap.cs プロジェクト: chijianfeng/PNManager
        public void LoadRainCover()
        {
            TJuncInfo        juninfo = new TJuncInfo(App._dbpath, App.PassWord);
            List <CJuncInfo> tmplist = juninfo.Sel_JuncInfoByCaty((int)JUNCTYPE.JUNC_RAIN);            //仅仅加载雨水检查井

            //进行坐标转换
            foreach (CJuncInfo mJunc in tmplist)
            {
                if (mJunc.X_Coor == 0)                                           //无座标
                {
                    continue;
                }
                RainCover cover = null;
                Point     p     = new Point(mJunc.X_Coor - Constants.COOR_X_OFFSET, mJunc.Y_Coor - Constants.COOR_Y_OFFSET);

                cover          = new RainCover(mJunc.JuncName, GISConverter.WGS842Merator(p), mJunc.SystemID);
                cover.juncInfo = mJunc;
                RainCoverList.Add(cover);
            }
        }