예제 #1
0
        /// <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();
        }
예제 #2
0
 public void ReWriteHeader(RinexObsFileHeader obj)
 {
     if (!IsObsHeaderWrited)
     {
         WriteHeader(obj);
     }
     else
     {
         RinexObsFileWriter.ReWriteHeader(obj);
     }
 }
예제 #3
0
        private static void OutputFile(string outDir, double outVersion, string currentSiteName, RinexObsFile currentFile, string readiedFilePath)
        {
            var extension = Path.GetExtension(readiedFilePath);
            RinexFileNameBuilder builder = new RinexFileNameBuilder(outVersion);
            var fileName = builder.Build(currentFile);

            string outputPath = Path.Combine(outDir, fileName);

            using (RinexObsFileWriter writer = new RinexObsFileWriter(outputPath, outVersion))
            {
                writer.Write(currentFile);
            }
        }
예제 #4
0
        /// <summary>
        /// 输出
        /// </summary>
        /// <param name="outOPath"></param>
        /// <param name="oFile"></param>
        private void OutputRinexFile(string outOPath, RinexObsFile oFile)
        {
            if (!outOPath.Last().ToString().Equals("o", StringComparison.CurrentCultureIgnoreCase))
            {
                outOPath += "." + oFile.StartTime.SubYear + "o";
            }

            RinexObsFileWriter writer = new RinexObsFileWriter(outOPath);

            writer.Write(oFile);
            writer.Flush();
            writer.Dispose();
        }
예제 #5
0
        /// <summary>
        /// 已接收历元数据
        /// </summary>
        /// <param name="obj"></param>
        public void WriteEpochObservation(RinexEpochObservation obj)
        {
            if (!IsObsHeaderWrited && obj.Header != null)
            {
                this.WriteHeader(obj.Header);
            }
            if (obj.Header == null)
            {
                return;
            }

            RinexObsFileWriter.WriteEpochObservation(obj);
            RinexObsFileWriter.Flush();
        }
예제 #6
0
        /// <summary>
        /// 初始化
        /// </summary>
        public override void Init()
        {
            base.Init();

            var outPath = Path.Combine(OutputDirectory, Path.GetFileName(FilePath));

            RinexObsFileWriter = new Data.Rinex.RinexObsFileWriter(outPath, Option.Version);

            this.EpochInfoToRinex = new Domain.EpochInfoToRinex(Option.Version, false);

            this.RawReviser = new EpochInfoReviseManager();
            var dataSource = this.BufferedStream.DataSource as RinexFileObsDataSource;

            RawReviser.AddProcessor(new ClockJumpReviser(dataSource.ObsInfo.Interval));
            RawReviser.Init();
        }
예제 #7
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);


            //更新到对象
        }
        /// <summary>
        /// 初始化读取器
        /// </summary>
        /// <param name="outFilePath"></param>
        private void InitWriter(string outFilePath)
        {
            if (Writer != null)
            {
                Writer.Dispose();
            }
            //输出版本
            double version = OldHeader.Version;

            if (Option.IsEnableRinexVertion)
            {
                version = Option.Version;
            }
            //文件名称
            string fileName = BuildOutputFileName(outFilePath);
            //文件路径
            var savePath = "";

            if (!String.IsNullOrWhiteSpace(SubDirectory))
            {
                savePath = Path.Combine(Option.OutputDirectory, SubDirectory, fileName);
            }
            else
            {
                savePath = Path.Combine(Option.OutputDirectory, fileName);
            }
            if (!IsOverrite && File.Exists(savePath))
            {
                log.Warn("已存在:" + savePath);
                savePath = Gdp.Utils.PathUtil.GetAvailableName(savePath);
                log.Warn("采用替代路径:" + savePath);
            }
            if (String.IsNullOrWhiteSpace(FirstOutputPath))
            {
                FirstOutputPath = savePath;
            }

            Writer = new RinexObsFileWriter(savePath, version)
            {
                IsConcise = Option.IsConciseOutput
            };
            Writer.IsUseXCodeAsPLWhenEmpty = Option.IsUseXCodeAsPLWhenEmpty;
        }
예제 #9
0
        protected override void Run(string inputPath)
        {
            TableObsFileReader reader = new TableObsFileReader(inputPath);

            var ObsFile = new TableObsFileReader(inputPath).Read();
            var outPath = Path.Combine(this.OutputDirectory, Path.GetFileName(inputPath).Replace(FileNames.TextExcelFileExtension, ""));

            var Writer = new RinexObsFileWriter(outPath, namedFloatControl1Vertion.Value);


            Writer.WriteHeader(ObsFile.Header);
            foreach (var item in ObsFile)
            {
                Writer.WriteEpochObservation(item);
            }
            Writer.Dispose();

            base.Run(inputPath);
        }
예제 #10
0
        /// <summary>
        /// 初始化读取器
        /// </summary>
        /// <param name="outFilePath"></param>
        private void InitWriter(string outFilePath)
        {
            if (Writer != null)
            {
                Writer.Dispose();
            }

            var toPath = "";

            if (!String.IsNullOrWhiteSpace(SubDirectory))
            {
                toPath = Path.Combine(OutputDirectory, SubDirectory, Path.GetFileName(outFilePath));
            }
            else
            {
                toPath = Path.Combine(OutputDirectory, Path.GetFileName(outFilePath));
            }

            Writer = new RinexObsFileWriter(toPath, CurrentHeader.Version);
        }
예제 #11
0
        private void ChartControl1_DataDeleting(Dictionary <string, IntSegment> obj)
        {
            var segment    = obj.First().Value;
            var indexes    = Table.GetIndexValues <Time>();
            var startEpoch = indexes[segment.Start];
            var endEpoch   = indexes[segment.End];
            var timeperiod = new TimePeriod(startEpoch, endEpoch);

            var prns = new List <SatelliteNumber>();

            foreach (var kv in obj)
            {
                prns.Add(SatelliteNumber.Parse(kv.Key));
            }

            ObsFile.Remove(prns, timeperiod);

            RinexObsFileWriter.Write(ObsFile, ObsFilePath);

            this.ObsFile = RinexObsFileReader.Read(ObsFilePath);
            this.Table   = ObsFile.BuildObjectTable(isDrawAll);

            Draw(Table);
        }
예제 #12
0
 public void Dispose()
 {
     RinexObsFileWriter.Dispose();
     GpsNavFileWriter.Dispose();
 }
예제 #13
0
 /// <summary>
 /// 写头部信息
 /// </summary>
 /// <param name="obj"></param>
 public void WriteHeader(RinexObsFileHeader obj)
 {
     RinexObsFileWriter.WriteHeader(obj);
     IsObsHeaderWrited = true;
 }