示例#1
0
        /// <summary>
        /// 计算,错误返回false。
        /// </summary>
        /// <param name="pathes"></param>
        /// <returns></returns>
        protected override bool BuildSolverAndRun(params string[] pathes)
        {
            IntegralGnssFileSolver Solver = null;

#if !DEBUG
            try
            {
#endif
            Solver = BuildSolver(pathes);

            this.InitProcess(Solver.Context.ObservationDataSource.ObsInfo.Count);
            Solver.ResultProduced += Solver_ResultProduced;


            Solver.Completed += Solver_Completed;
            Run(Solver);

            log.Info(Solver.Name + " 计算完成。");
            RunningSolvers.Remove(Solver);
            if (Solver != FisrtSolver)
            {
                Solver.Dispose();
                Solver = null;
            }

            return(true);

#if !DEBUG
        }

        catch (Exception ex)
        {
            var roverMsg = "";
            if (Solver != null)
            {
                roverMsg = Solver.Current + "";
            }
            var msg = Solver + ", " + roverMsg + " 计算发生致命错误:" + ex.Message + ",路径:\r\n" + path;
            log.Fatal(msg);
            if (Setting.GnsserConfig.IsDebug)
            {
                ex.Data["GNSSerMsg"] = msg;
                throw ex;
            }
        }
#endif
            return(false);
        }
示例#2
0
        /// <summary>
        /// 计算,错误返回false。
        /// </summary>
        /// <param name="fileNames"></param>
        /// <returns></returns>
        protected override bool BuildSolverAndRun(params string[] fileNames)
        {
            IntegralGnssFileSolver Solver = null;

#if !DEBUG
            try
            {
#endif
            Solver = BuildSolver(fileNames);
            if (Solver == null)
            {
                log.Error("GNSS 计算器创建失败!" + Geo.Utils.StringUtil.ToString(fileNames));
                return(false);
            }
            Solver.Completed += Solver_Completed;
            Run(Solver);

            log.Info(Solver.Name + " 计算完成。");
            RunningSolvers.Remove(Solver);
            if (Solver != FisrtSolver)
            {
                Solver.Dispose();
                Solver = null;
            }

            return(true);

#if !DEBUG
        }

        catch (Exception ex)
        {
            var roverMsg = "";
            if (Solver != null)
            {
                roverMsg = Solver.Current + "";
            }
            var msg = Solver + ", " + roverMsg + " 计算发生致命错误:" + ex.Message + ",路径:\r\n" + path;
            log.Fatal(msg);
            if (Setting.GnsserConfig.IsDebug)
            {
                ex.Data["GNSSerMsg"] = msg;
                throw ex;
            }
        }
#endif
            return(false);
        }
        /// <summary>
        /// 计算,错误返回false。
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        protected virtual bool BuildSolverAndRun(params string[] path)
        {
            TStreamer Solver = null;

#if !DEBUG
            try
            {
#endif
            Solver            = BuildSolver(path);
            Solver.Completed += Solver_Completed;
            Run(Solver);

            log.Info(Solver.Name + " 计算完成。");
            RunningSolvers.Remove(Solver);
            if (Solver != FisrtSolver)
            {
                Solver.Dispose();
                Solver = null;
            }

            return(true);

#if !DEBUG
        }

        catch (Exception ex)
        {
            var roverMsg = "";
            if (Solver != null)
            {
                roverMsg = Solver.Current + "";
            }
            var msg = Solver + ", " + roverMsg + " 计算发生致命错误:" + ex.Message + ",路径:\r\n" + path;
            log.Fatal(msg);
            if (Setting.GnsserConfig.IsDebug)
            {
                ex.Data["GNSSerMsg"] = msg;
                throw ex;
            }
            return(false);
        }
#endif
        }