예제 #1
0
        public void LoadWasterPipe()
        {
            TPipeInfo        pipeinfo = new TPipeInfo(App._dbpath, App.PassWord);        //读取数据库
            List <CPipeInfo> pipelist = pipeinfo.Sel_PipeInfo((int)PIPETYPE.PIPE_WASTE); //仅仅读取污水管道

            //读取管道内窥数据
            TUSInfo        usinfo = new TUSInfo(App._dbpath, App.PassWord);
            List <CUSInfo> uslist = usinfo.Load_USInfo();

            foreach (CPipeInfo info in pipelist)
            {
                WastePipe  pipe     = null;
                WasteCover starjunc = FindStartWJunc(info);                    //找到起始点坐标
                WasteCover endjunc  = FindEndWJunc(info);                      //找到终止点坐标
                if (starjunc == null || endjunc == null)
                {
                    continue;
                }

                pipe = new WastePipe(starjunc, endjunc);

                pipe.pipeInfo = info;
                pipe.UsInfo   = FindUSInfo(uslist, info.ID);
                WastePipeList.Add(pipe);
            }
        }
예제 #2
0
        WasteCover FindEndWJunc(CPipeInfo cp)
        {
            WasteCover c = null;

            c = WasterCoverList.Find(cc => cc.juncInfo.ID == cp.Out_JunID);
            return(c);
        }
예제 #3
0
        public void LoadWasterCover() {

            TJuncInfo juninfo = new TJuncInfo(App._dbpath, App.PassWord);
            List<CJuncInfo> tmplist = juninfo.Sel_JuncInfoByCaty((int)JUNCTYPE.JUNC_WASTE);            //仅仅加载污水检查井
            //进行坐标转换
            foreach (CJuncInfo mJunc in tmplist)
            {
                if (mJunc.X_Coor == 0)                                           //无座标
                    continue;
                WasteCover cover = null;
                Point p = new Point(mJunc.X_Coor - Constants.COOR_X_OFFSET, mJunc.Y_Coor - Constants.COOR_Y_OFFSET);

                cover = new WasteCover(mJunc.JuncName, GISConverter.WGS842Merator(p), mJunc.SystemID);
                cover.juncInfo = mJunc;
                WasterCoverList.Add(cover);
            }
        }
예제 #4
0
        public void LoadWasterCover()
        {
            TJuncInfo        juninfo = new TJuncInfo(App._dbpath, App.PassWord);
            List <CJuncInfo> tmplist = juninfo.Sel_JuncInfoByCaty((int)JUNCTYPE.JUNC_WASTE);            //仅仅加载污水检查井

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

                cover          = new WasteCover(mJunc.JuncName, GISConverter.WGS842Merator(p), mJunc.SystemID);
                cover.juncInfo = mJunc;
                WasterCoverList.Add(cover);
            }
        }
예제 #5
0
        public new  void OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (CurrentMode == ADDMODE)
            {
                Point cp = e.GetPosition(context);      //获取相关坐标
                cp.X = cp.X + 7;
                cp.Y = cp.Y + 7;                        //设置为中心
                WasteCover c = new WasteCover("污水检查井", 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);                //若都不是添加或删除命令,则交给父类进行处理
        }