Exemplo n.º 1
0
        /// <summary>
        /// 具体的执行
        /// </summary>
        /// <param name="inPath"></param>
        /// <param name="outPath"></param>
        protected override void Execute(string inPath, string outPath)
        {
            if (this.IsCancel)
            {
                return;
            }
            var Solver = new SingleSiteGnssSolveStreamer();

            if (PathUtil.IsValidPath(CurrentParam.EphemerisPath))
            {
                if (this.EphemerisDataSource == null || this.EphemerisDataSource.Name != Path.GetFileName(CurrentParam.EphemerisPath))
                {
                    var sp3 = InputFileManager.GetLocalFilePath(CurrentParam.EphemerisPath, "*.sp3");
                    if (PathUtil.IsValidPath(sp3))
                    {
                        this.EphemerisDataSource   = EphemerisDataSourceFactory.Create(sp3);
                        Solver.EphemerisDataSource = this.EphemerisDataSource;
                    }
                }
            }
            if (PathUtil.IsValidPath(CurrentParam.ClockPath))
            {
                if (this.ClockFile == null || this.ClockFile.Name != Path.GetFileName(CurrentParam.ClockPath))
                {
                    var clk = InputFileManager.GetLocalFilePath(CurrentParam.ClockPath, "*.clk");
                    if (PathUtil.IsValidPath(clk))
                    {
                        this.ClockFile   = new Data.SimpleClockService(clk);
                        Solver.ClockFile = this.ClockFile;
                    }
                }
            }
            if (Option == null)
            {
                Option = GnssProcessOptionManager.Instance[GnssSolverType.无电离层组合PPP];
            }
            //Solver.InfoProduced += Solver_InfoProduced;
            //Solver.ResultProduced += Solver_ResultProduced;
            //Solver.EpochEntityProduced += Solver_EpochEntityProduced;
            Solver.Completed += Solver_Completed;
            Solver.Option     = Option;
            Solver.Option.IsOutputEpochResult = false;
            Solver.Init(inPath);

            var count = Solver.DataSource.ObsInfo.Count;

            //串行进度条初始化,阶段计算的第一个
            //if (!ParallelConfig.EnableParallel) { this.ProgressBar.InitFirstProcessCount(count); }

            log.Info(Solver.Name + " 初始化完毕,开始计算。");

            Solver.Run();
            log.Info(Solver.Name + " 计算完成。");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 计算完毕一个测站
        /// </summary>
        /// <param name="Solver"></param>
        void OneSolver_Processed(SingleSiteGnssSolveStreamer Solver)
        {
            var entity = Solver.CurrentGnssResult;
            SingleSiteGnssResult result = entity as SingleSiteGnssResult;

            this.OutputFinalResult(result);
            this.AppendFinalResultOnUI(result);

            //只截获和显示这一个,文件输出将自动处理
            if (Solver == GnssSolver)
            {
                this.SetResultsToUITable(this.GnssSolver.TableTextManager);
            }
        }
Exemplo n.º 3
0
        private void Runner_SolverCreated(SingleSiteGnssSolveStreamer obj)
        {
            if (this.Option.TopSpeedModel)
            {
                return;
            }

            if (isFirstSolver)
            {
                isFirstSolver = false;
                var solver = obj;
                GnssSolver                       = obj;
                solver.ResultProduced           += Solver_ResultProduced;; //只保留第一个的结果在界面
                solver.IsClearTableWhenOutputted = false;                  //不清空表数据,用于图形显示
            }
        }
Exemplo n.º 4
0
        private void PppRunner_Processed(SingleSiteGnssSolveStreamer Solver)
        {
            var site = this.ObsSiteInfos.Get(Solver.Path);

            if (site == null)
            {
                return;
            }
            var entity = Solver.CurrentGnssResult as SingleSiteGnssResult; if (entity == null)
            {
                return;
            }
            var xyz = entity.EstimatedXyz;

            site.SiteObsInfo.ApproxXyz = xyz; //实时更新
            site.EstimatedSite         = new EstimatedSite(site.SiteName, entity.EstRmsedXYZ, entity.MaterialObj.ReceiverTime);


            var temptempDir = Path.Combine(site.TempDirectory, "Temp");

            Geo.Utils.FileUtil.CheckOrCreateDirectory(temptempDir);

            var outPath = Path.Combine(temptempDir, site.SiteObsInfo.FileInfo.FileName);
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic[RinexHeaderLabel.APPROX_POSITION_XYZ] = RinexObsFileWriter.BuildApproxXyzLine(xyz);
            var replacer = new LineFileReplacer(site.FilePath, outPath, dic);

            replacer.EndMarkers.Add(RinexHeaderLabel.END_OF_HEADER);
            //replacer.AddingLines.Add(RinexObsFileWriter.BuildGnsserCommentLines());
            replacer.AddingLines.Add(RinexObsFileWriter.BuildCommentLine("Approx XYZ updated with GNSSer PPP " + Geo.Utils.DateTimeUtil.GetFormatedDateTimeNow()));
            replacer.Run();

            Geo.Utils.FileUtil.MoveFile(outPath, site.TempFilePath, true);
            log.Info("更新成功! 输出到 : " + site.TempFilePath);

            log.Info(entity.Name + ", " + entity.ReceiverTime + ", 输出到结果文件");
            var writer = new GnssResultWriter(Solver.Option, Solver.Option.IsOutputEpochResult,
                                              Solver.Option.IsOutputEpochSatInfo);

            writer.WriteFinal(entity);


            //更新到对象
        }