/// <summary> /// 清空内存 /// </summary> public void ClearResultBuffer() { AdjustEquationFileBuilder.Clear(); AioAdjustFileBuilder.Clear(); if (this.IsClearTableWhenOutputted) { TableTextManager.Clear(); } }
/// <summary> /// GNSS 结果构造器 /// </summary> /// <param name="TableTextManager"></param> /// <param name="AioAdjustFileBuilder"></param> /// <param name="Option"></param> /// <param name="context"></param> /// <param name="AdjustEquationFileBuilder"></param> public GnssResultBuilder( ObjectTableManager TableTextManager, AioAdjustFileBuilder AioAdjustFileBuilder, AdjustEquationFileBuilder AdjustEquationFileBuilder, GnssProcessOption Option, DataSourceContext context) { this.Context = context; this.AdjustEquationFileBuilder = AdjustEquationFileBuilder; this.TableTextManager = TableTextManager; this.AioAdjustFileBuilder = AioAdjustFileBuilder; this.Option = Option; this.OutputMinInterval = this.Option.OutputMinInterval; var fileName = Path.Combine(Setting.TempDirectory, Geo.Utils.DateTimeUtil.GetDateTimePathStringNow() + ".sp3"); Sp3Writer = new Sp3Writer(fileName, null); PrevEpoch = Time.MinValue; this.EpochParamAnalyzer = new EpochParamAnalyzer(new List <string>(this.Option.AnalysisParamNames), this.Option.SequentialEpochCountOfAccuEval, this.Option.MaxDifferOfAccuEval, this.Option.MaxAllowedConvergenceTime, this.Option.KeyLabelCharCount, this.Option.MaxAllowedDifferAfterConvergence, this.Option.MaxAllowedRmsOfAccuEval); ResultFileNameBuilder = new ResultFileNameBuilder(Option.OutputDirectory); }
/// <summary> /// 输出结果 /// </summary> /// <param name="epoch"></param> /// <param name="result"></param> public void AddEpochResult(ISiteSatObsInfo epoch, SimpleGnssResult result) { //结果采样率过滤 var interval = Math.Abs(epoch.ReceiverTime - PrevEpoch); if (interval < this.OutputMinInterval) { return; } PrevEpoch = epoch.ReceiverTime; //总开关 if (!Option.IsOutputResult && !Option.IsOutputEpochResult) { return; } var Adjustment = result.ResultMatrix; var ParamNames = result.ParamNames; //各历元信息 #region 默认逐历元输出 //参数值 if (Option.IsOutputEpochParam) { AddEpochParam(epoch, result); } // RMS if (Option.IsOutputEpochParamRms) { AddParamRms(epoch, result); } //钟跳 if (Option.IsOutputJumpClockFile) { CheckOrAddClockJump(epoch, result); } //第二参数 if (result.ResultMatrix.SecondEstimated != null) { AddSecondParam(epoch, result); AddSecondParamRms(epoch, result); } //DOP if (this.Option.IsOutputEpochDop) { AddDop(epoch, result); } //两路滤波,模糊度固定解 AddAmbFixed(epoch, result); //动态定位,且坐标未固定,则添加 if (this.Option.IsOutputEpochCoord || (this.Option.PositionType == PositionType.动态定位 && !this.Option.IsFixingCoord)) { AddEpochCoord(epoch, result); } #endregion #region 择性历元输出 #region 平差文件 if (this.Option.IsOutputAdjust) { AioAdjustFileBuilder.AddAdjustment(Adjustment); } if (this.Option.IsOutputObsEquation) { AdjustEquationFileBuilder.AddAdjustment(Adjustment); } if (this.Option.IsOutputAdjustMatrix) { if (results == null) { results = new List <SimpleGnssResult>(); } results.Add(result); } #endregion #region 电离层产品 if (this.Option.IsOutputIono) { BuildIonoResult(epoch, Adjustment, ParamNames); } #endregion #region 对流层产品 if (this.Option.IsOutputWetTrop && Geo.Utils.StringUtil.Contanis(ParamNames, Gnsser.ParamNames.WetTropZpd, true) && epoch.ReceiverTime.SecondsOfDay % 300 == 0) { var table = TableTextManager.GetOrCreate(epoch.Name + "_" + Gnsser.ParamNames.WetTropZpd); table.NewRow(); table.AddItem("Epoch", epoch.ReceiverTime); EpochInformation epochInfo = epoch as EpochInformation; //var ionoResult = Adjustment.Estimated.GetAll(Gnsser.ParamNames.WetTrop); //天顶对流层总延迟,epochInfo[0].WetMap_ZTD=1 table.AddItem("Trop1", epochInfo[0].AppriorTropDelay + epochInfo[0].WetMap_ZTD * result.ResultMatrix.Estimated[4, 0]); table.AddItem("Trop2", epochInfo[1].WetMap_ZTD * result.ResultMatrix.Estimated[4, 0]); table.AddItem("Trop3", result.ResultMatrix.Estimated[4, 0]); //epoch[0].AppriorTropDelay + epoch[0].WetMap_ZTD * //foreach (var item in ionoResult) //{ // table.AddItem(item.Key, item.Value.Value); //} } #endregion #region 历元卫星观测信息 if (Option.IsOutputEpochSatInfo) { AddSiteEpochSatInfo(epoch); } #endregion #endregion if (Option.IsOutputObservation) { AddObservation(epoch, result); } if (Option.IsOutputResidual) { this.AddResidual(epoch, result); } //轨道产品输出 if (result is IOrbitResult) { var ephs = ((IOrbitResult)result).EphemerisResults; Sp3Section sp3Records = new Sp3Section(ephs.First.Original.Time); foreach (var eph in ephs) { sp3Records.Add(eph.Original.Prn, eph.Corrected); } Sp3Writer.Write(sp3Records); } this.PrevResult = result; }
/// <summary> /// 写入文件并清空内存 /// </summary> public void WriteResultsToFile() { TableTextManager.WriteAllToFileAndCloseStream(); AioAdjustFileBuilder.WriteToFile(); AdjustEquationFileBuilder.WriteToFile(); }