Example #1
0
        //初始化检查相关参数
        public void InitialCheckPara(IWorkspace workspace, DbConnection dbConnPara, string dbConnParaGeoOne, DbConnection dbConnRes, string errResTableName, string xmlPath)
        {
            IArcgisDataCheckParaSet dataCheckParaSet = new ArcgisDataCheckParaSet();

            //检查数据来接
            dataCheckParaSet.Workspace = workspace;

            //参数数据连接
            dataCheckParaSet.DbConnPara       = dbConnPara;
            dataCheckParaSet.DbConnParaGeoOne = dbConnParaGeoOne;

            //检查结果日志输出连接
            dataCheckParaSet.DbConnRes = dbConnRes;

            //检查结果日志表名
            dataCheckParaSet.ErrResTableName = errResTableName;

            //检查功能组合结构XML
            dataCheckParaSet.XmlDocDataCheckSet = new XmlDocument();
            try
            {
                dataCheckParaSet.XmlDocDataCheckSet.Load(xmlPath);
            }
            catch
            {
            }

            ArcgisDataCheck dataCheck = new ArcgisDataCheck(dataCheckParaSet);

            Hook = dataCheck as IDataCheckHook;
        }
 public void OnCreate(IDataCheckHook hook)
 {
     Hook = hook as IArcgisDataCheckHook;
 }
Example #3
0
        private static void DataCheckRelizeFunction(string name, int pValue, ProgressChangeEvent eInfo, IDataCheckHook hook, IDataCheckLogic dataCheckLogic)
        {
            object objLock = new object();

            lock (objLock)
            {
                if (DicCheck.ContainsKey(name))
                {
                    DicCheck[name].OnCreate(hook);
                    (DicCheck[name] as ICheckEvent).DataErrTreat += new DataErrTreatHandle(dataCheckLogic.DataCheckLogic_DataErrTreat);
                    (DicCheck[name] as ICheckEvent).ProgressShow += new ProgressChangeHandle(GeoDataChecker_ProgressShow);
                    DicCheck[name].OnDataCheck();
                    //进度条加1
                    pValue++;
                    eInfo.Value = pValue;
                    //_CheckForm.Invoke(new ChangeProgressBarOut(changeProgressOut), new object[] { pValue });
                    //进度条控制
                    GeoDataChecker_ProgressShow((object)_PrgressBarOut, eInfo);
                }
            }
        }
Example #4
0
        //加载执行检查功能
        public static void LoadDataCheckLogicFunction(string logicFunName, IDataCheckHook hook, IDataCheckLogic dataCheckLogic)
        {
            IArcgisDataCheckHook dataCheckHook = hook as IArcgisDataCheckHook;

            if (dataCheckHook == null)
            {
                return;
            }
            IArcgisDataCheckParaSet checkParaSet = dataCheckHook.DataCheckParaSet as IArcgisDataCheckParaSet;

            if (checkParaSet == null)
            {
                return;
            }
            if (checkParaSet.XmlDocDataCheckSet == null)
            {
                return;
            }
            XmlNode aNode = checkParaSet.XmlDocDataCheckSet.DocumentElement.SelectSingleNode(".//LogicCheckFunction[@Name='" + logicFunName + "']");

            if (aNode == null)
            {
                return;
            }
            if (aNode.ChildNodes.Count == 0)
            {
                return;
            }
            if (DicCheck == null)
            {
                return;
            }
            //设置进度条
            //int pMax = aNode.ChildNodes.Count;
            //_CheckForm.Invoke(new IntiProgressBarOut(intiaProgressout), new object[] { pMax });

            m_DicTopoDataCheck = new Dictionary <string, string>();
            int pValue = 0;
            ProgressChangeEvent eInfo = new ProgressChangeEvent();

            eInfo.Max = aNode.ChildNodes.Count;

            foreach (XmlNode childNode in aNode.ChildNodes)
            {
                XmlElement childElement = childNode as XmlElement;
                if (!childElement.HasAttribute("Name"))
                {
                    continue;
                }
                string name  = childElement.GetAttribute("Name");
                string pText = childElement.GetAttribute("text").Trim();
                string pType = childElement.GetAttribute("type").Trim();
                if (pType == "拓扑检查")
                {
                    if (!m_DicTopoDataCheck.ContainsKey(name))
                    {
                        m_DicTopoDataCheck.Add(name, pText);
                    }
                    continue;
                }

                //if (DicCheck.ContainsKey(name))
                //{
                //    _CheckForm.Invoke(new ShowErrorInfo(showEInfo), new object[] { pText });

                //    DicCheck[name].OnCreate(hook);
                //    (DicCheck[name] as ICheckEvent).DataErrTreat += new DataErrTreatHandle(dataCheckLogic.DataCheckLogic_DataErrTreat);
                //    (DicCheck[name] as ICheckEvent).ProgressShow += new ProgressChangeHandle(GeoDataChecker_ProgressShow);
                //    DicCheck[name].OnDataCheck();
                //    //进度条加1
                //    pValue++;
                //    eInfo.Value = pValue;
                //    //进度条控制
                //    GeoDataChecker_ProgressShow((object)_PrgressBarOut, eInfo);
                //}
            }

            if (m_DicTopoDataCheck != null && m_DicTopoDataCheck.Count != 0)
            {
                //进行拓扑检查
                if (DicCheck.ContainsKey("GeoDataChecker.GeoTopologyCheck"))
                {
                    _CheckForm.Invoke(new ShowErrorInfo(showEInfo), new object[] { "进行拓扑检查" });

                    DicCheck["GeoDataChecker.GeoTopologyCheck"].OnCreate(hook);
                    (DicCheck["GeoDataChecker.GeoTopologyCheck"] as ICheckEvent).DataErrTreat += new DataErrTreatHandle(dataCheckLogic.DataCheckLogic_DataErrTreat);
                    (DicCheck["GeoDataChecker.GeoTopologyCheck"] as ICheckEvent).ProgressShow += new ProgressChangeHandle(GeoDataChecker_ProgressShow);
                    DicCheck["GeoDataChecker.GeoTopologyCheck"].OnDataCheck();

                    pValue++;
                    eInfo.Value = pValue;
                    //进度条控制
                    GeoDataChecker_ProgressShow((object)_PrgressBarOut, eInfo);
                }
            }
            foreach (XmlNode childNode in aNode.ChildNodes)
            {
                XmlElement childElement = childNode as XmlElement;
                if (!childElement.HasAttribute("Name"))
                {
                    continue;
                }
                string name  = childElement.GetAttribute("Name");
                string pText = childElement.GetAttribute("text").Trim();
                string pType = childElement.GetAttribute("type").Trim();
                if (pType == "拓扑检查")
                {
                    continue;
                }
                if (DicCheck.ContainsKey(name))
                {
                    _CheckForm.Invoke(new ShowErrorInfo(showEInfo), new object[] { pText });

                    DicCheck[name].OnCreate(hook);
                    (DicCheck[name] as ICheckEvent).DataErrTreat += new DataErrTreatHandle(dataCheckLogic.DataCheckLogic_DataErrTreat);
                    (DicCheck[name] as ICheckEvent).ProgressShow += new ProgressChangeHandle(GeoDataChecker_ProgressShow);
                    DicCheck[name].OnDataCheck();
                    //进度条加1
                    pValue++;
                    eInfo.Value = pValue;
                    //进度条控制
                    GeoDataChecker_ProgressShow((object)_PrgressBarOut, eInfo);
                }
            }


            /*
             * int pValue = 0;
             * ProgressChangeEvent eInfo = new ProgressChangeEvent();
             * eInfo.Max=aNode.ChildNodes.Count;
             *
             * foreach (XmlNode childNode in aNode.ChildNodes)
             * {
             *  XmlElement childElement = childNode as XmlElement;
             *  if (!childElement.HasAttribute("Name")) continue;
             *  string name = childElement.GetAttribute("Name");
             *  string pText = childElement.GetAttribute("text").Trim();
             *
             *  //如果不是库体结构检查,就用多线程
             *  //Thread pThread = new Thread(new ThreadStart(delegate { DataCheckRelizeFunction(name, pValue, eInfo, hook, dataCheckLogic); }));
             *  //pThread.Start();
             *  if (DicCheck.ContainsKey(name))
             *  {
             *      _CheckForm.Invoke(new ShowErrorInfo(showEInfo), new object[] { pText });
             *
             *      DicCheck[name].OnCreate(hook);
             *      (DicCheck[name] as ICheckEvent).DataErrTreat += new DataErrTreatHandle(dataCheckLogic.DataCheckLogic_DataErrTreat);
             *      (DicCheck[name] as ICheckEvent).ProgressShow += new ProgressChangeHandle(GeoDataChecker_ProgressShow);
             *      DicCheck[name].OnDataCheck();
             *      //进度条加1
             *      pValue++;
             *      eInfo.Value = pValue;
             *      //_CheckForm.Invoke(new ChangeProgressBarOut(changeProgressOut), new object[] { pValue });
             *      //进度条控制
             *      GeoDataChecker_ProgressShow((object)_PrgressBarOut, eInfo);
             *  }
             * }
             * */
        }
Example #5
0
 public void OnCreate(IDataCheckHook hook)
 {
     Hook = hook;
 }