/// <summary> /// 只有一个,则实时显示输出。 /// </summary> /// <param name="obj"></param> private void Runner_SolverCreated(IntegralGnssFileSolver obj) { var Solver = obj; GnssSolver = obj; Solver.ResultProduced += Solver_ResultProduced;; //只保留第一个的结果在界面 Solver.IsClearTableWhenOutputted = false; //不清空表数据,用于图形显示 }
/// <summary> /// 计算完毕一个测站 /// </summary> /// <param name="Solver"></param> void OneSolver_Processed(IntegralGnssFileSolver Solver) { var entity = Solver.CurrentGnssResult; this.OutputFinalResult(entity); this.AppendFinalResultOnUI(entity); //只截获和显示这一个,文件输出将自动处理 if (Solver == GnssSolver) { this.SetResultsToUITable(this.GnssSolver.TableTextManager); } }
/// <summary> /// 具体的执行 /// </summary> /// <param name="baseline"></param> /// <param name="outPath"></param> protected void Execute(Baseline baseline, string outPath) { 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); } } } 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); } } } var refPath = ObsFiles.Find(m => m.ToLower().Contains(baseline.StartName.ToLower())); var rovPath = ObsFiles.Find(m => m.ToLower().Contains(baseline.EndName.ToLower())); if (refPath == null || rovPath == null) { throw new ArgumentException("没有找到基线对应的文件!" + baseline.ToString()); return; } var inputPathes = new string[] { refPath, rovPath }; RinexFileObsDataSource refObsDataSource = new RinexFileObsDataSource(refPath, true); RinexFileObsDataSource rovObsDataSource = new RinexFileObsDataSource(rovPath, true); if (SiteInfoDics != null) { var siteName = baseline.StartName.ToUpper(); if (SiteInfoDics.ContainsKey(siteName)) { refObsDataSource.SiteInfo.SetApproxXyz(SiteInfoDics[siteName].EstimatedXyz); } siteName = baseline.EndName.ToUpper(); if (SiteInfoDics.ContainsKey(siteName)) { rovObsDataSource.SiteInfo.SetApproxXyz(SiteInfoDics[siteName].EstimatedXyz); } } GnssProcessOption option = GnssProcessOption.GetDefault(GnsserConfig, refObsDataSource.ObsInfo); option.GnssSolverType = GnssSolverType.无电离层双差; var source = new MultiSiteObsStream(inputPathes, BaseSiteSelectType.GeoCenter, true, ""); DataSourceContext context = DataSourceContext.LoadDefault(option, source, EphemerisDataSource, ClockFile); IntegralGnssFileSolver Solver = new IntegralGnssFileSolver(); Solver.Completed += Solver_Completed; Solver.Option = option; Solver.IsCancel = false; Solver.Solver = GnssSolverFactory.Create(context, option);; Solver.Init(inputPathes); Solver.Run(); var last = Solver.CurrentGnssResult; lock (locker) { Geo.Utils.FileUtil.CheckOrCreateDirectory(Path.GetDirectoryName(outPath)); SaveLastResult(last); } }