/// <summary> /// 执行单个 /// </summary> /// <param name="inputPath"></param> protected override void Run(string inputPath) { if (this.IsCancel) { return; } var reader = new RinexObsFileReader(inputPath, false); var header = reader.GetHeader(); var coord = SiteCoordService.Get(header.MarkerName, header.StartTime); if (coord == null) { FailedCount++; ShowInfo("Faild:\t" + inputPath); log.Error("坐标获取失败,本文件执行取消。 " + inputPath); return; } var outPath = Path.Combine(this.OutputDirectory, Path.GetFileName(inputPath)); Dictionary <string, string> dic = new Dictionary <string, string>(); dic[RinexHeaderLabel.APPROX_POSITION_XYZ] = RinexObsFileWriter.BuildApproxXyzLine(coord.Value); var replacer = new LineFileReplacer(inputPath, outPath, dic); replacer.EndMarkers.Add(RinexHeaderLabel.END_OF_HEADER); replacer.AddingLines.Add(RinexObsFileWriter.BuildGnsserCommentLines()); replacer.AddingLines.Add(RinexObsFileWriter.BuildCommentLine("Approx XYZ updated with " + SiteCoordService.Name + " " + Geo.Utils.DateTimeUtil.GetFormatedDateTimeNow())); replacer.Run(); log.Info("更新成功! " + coord.Value + ", " + inputPath); this.ProgressBar.PerformProcessStep(); }
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); //更新到对象 }