コード例 #1
0
ファイル: BaseLinePositionForm.cs プロジェクト: yxw027/GNSSer
        private void ShowMetaInfo()
        {
            BaseGnssResult last = _results[_results.Count - 1];

            TimeSpan      span = DateTime.Now - startTime;
            StringBuilder sb   = new StringBuilder();

            sb.AppendLine("耗时:" + DateTimeUtil.GetFloatString(span));
            sb.AppendLine("共处理 " + ProcessCount + " 条数据。");

            sb.AppendLine("数据处理类型: " + CaculateType + " ");
            //sb.AppendLine("        概略坐标:" + last.ApproxXyz.GetTabValues() + ", RMS : " + last.EstimatedXyzRms.GetTabValues());
            //sb.AppendLine("最后历元平差结果:" + last.EstimatedXyz.GetTabValues());
            //sb.AppendLine("最后历元偏差:" + (last.EstimatedXyz - last.ApproxXyz).GetTabValues());
            //var vector = (last.EstimatedXyz - this.RefObsDataSource.SiteInfo.EstimatedXyz);
            //sb.AppendLine("最后历元基线:" + vector.GetTabValues());

            //sb.AppendLine("最后基线长度:" + vector.Length);
            sb.AppendLine();
            sb.AppendLine("参考站概略坐标:" + this.RefObsDataSource.SiteInfo.EstimatedXyz.GetTabValues());
            sb.AppendLine("概略基线:" + (this.RovObsDataSource.SiteInfo.EstimatedXyz - this.RefObsDataSource.SiteInfo.ApproxXyz).GetTabValues());
            sb.AppendLine("基线长度:" + (this.RovObsDataSource.SiteInfo.EstimatedXyz - this.RefObsDataSource.SiteInfo.ApproxXyz).Radius());
            sb.AppendLine();
            //sb.AppendLine("接收机天线信息:" + last.Material.SiteInfo.Antenna == null ? "没有天线信息" : last.Material.SiteInfo.Antenna + "");

            this.Invoke(new Action(delegate() { this.textBox_resultInfo.Text = sb.ToString(); }));
        }
コード例 #2
0
        /// <summary>
        /// 写入总文件
        /// </summary>
        /// <param name="best">最后历元计算结果</param>
        /// <param name="directory">工程目录</param>
        private void WriteFinalResult(BaseGnssResult best, string directory)
        {
            if (best == null)
            {
                return;
            }

            lock (locker)//共享文档可能存在冲突
            {
                Geo.Utils.FileUtil.CheckOrCreateDirectory(directory);

                string allPath = ResultFileNameBuilder.BuildFinalResultFilePath(best.GetType());

                string str = AppentShortTabToFile(best, allPath);

                //所有汇总文件
                var globalPath = Setting.GnsserConfig.PppResultFile;

                try
                {
                    if (best is PppResult)
                    {
                        AppentShortTabToFile(best, globalPath);
                    }
                }
                catch (Exception ex)
                {
                    log.Error("写入 PPP 总汇总文件出现错误:" + ex.Message + "\r\n" + globalPath);
                }
            }
        }
コード例 #3
0
ファイル: GnssResultBuilder.cs プロジェクト: yxw027/GNSSer
        /// <summary>
        /// 追加一个测量结果信息
        /// </summary>
        /// <param name="simpleResult"></param>
        public string BuildResultInfo(SimpleGnssResult simpleResult)
        {
            StringBuilder sb = new StringBuilder();

            if (simpleResult is BaseGnssResult)
            {
                BaseGnssResult result = (BaseGnssResult)simpleResult;
                //数据源信息
                AppendLine(sb, "数据源", result.Material.Name);

                if (result.Material is EpochInformation)
                {
                    var epochInfo = result.Material as EpochInformation;
                    var ObsInfo   = epochInfo.ObsInfo;
                    var SiteInfo  = epochInfo.SiteInfo;
                    BuildObsInfo(sb, ObsInfo);
                    BuildSiteInfo(sb, SiteInfo);
                    BuildContextInfo(sb, Context);
                    BuildAdjustInfo(sb, result.ResultMatrix);
                }

                if (result.HasEstimatedXyz)
                {
                    AppendLine(sb, "最终估值坐标:", result.EstimatedXyz);
                    AppendLine(sb, "最终估值坐标RMS:", result.EstimatedXyzRms);
                    AppendLine(sb, "大地坐标:", result.GeoCoord);
                }
            }
            return(sb.ToString());
        }
コード例 #4
0
 void pp_ProgressIncreased(BaseGnssResult e, EpochInformation sender)
 {
     _processedEpochCount++;
     this.Invoke(new Action(delegate()
     {
         this.backgroundWorker1.ReportProgress(_processedEpochCount);
     }));
 }
コード例 #5
0
        private static Dictionary <string, string> BuildMetaInfo(BaseGnssResult product)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            //var positioner = product.GnssSolver;
            //if (positioner != null)
            //{
            //    if (positioner != null && positioner.DataSourceContext.ObservationDataSource != null)
            //    {
            //        keyDic.Add("数据源", positioner.DataSourceContext.ObservationDataSource.Name);
            //    }

            //    keyDic.Add("初始坐标", product.ApproxXyz.ToString());
            //    keyDic.Add("星历", positioner.DataSourceContext.EphemerisService.Name);
            //    if (positioner.DataSourceContext.HasClockService)
            //    {
            //        keyDic.Add("钟差", positioner.DataSourceContext.ClockService.Name);
            //    }
            //    else
            //    {
            //        keyDic.Add("钟差", "无钟差文件,计算收敛时间受影响");
            //    }
            //    if (positioner.DataSourceContext.HasErpService)
            //    {
            //        keyDic.Add("地球自转", positioner.DataSourceContext.ErpDataService.Name);
            //    }
            //    else
            //    {
            //        keyDic.Add("地球自转", "无数据,计算精度受少量影响");
            //    }

            //    //显示天线信息
            //    if (product.Material.SiteInfo.Antenna != null)
            //    {
            //        var ant = product.Material.SiteInfo.Antenna;
            //        keyDic.Add("接收机天线", ant.AntennaType + ", " + ant.AntennaSerial);
            //    }
            //    else
            //    {
            //        keyDic.Add("接收机天线", "无!将影响计算结果!!");
            //    }

            //    var option = positioner.Option;
            //    if (option != null)
            //    {
            //        keyDic.Add("计算方法", option.CaculateType.ToString());
            //        //keyDic.Add("起始历元数", option.DelayCount.ToString());
            //        keyDic.Add("高度截止角", option.VertAngleCut.ToString());
            //        keyDic.Add("缓存大小", option.BufferSize.ToString());
            //        keyDic.Add("最小连续历元数", option.MinContinuouObsCount.ToString());
            //        keyDic.Add("最大遍历循环数", option.MaxLoopCount.ToString());
            //        keyDic.Add("处理系统类型", String.Format(new EnumerableFormatProvider(), "{0}", option.SatelliteTypes));
            //    }
            //}
            return(dic);
        }
コード例 #6
0
ファイル: BaseLinePositionForm.cs プロジェクト: yxw027/GNSSer
        void pp_ProgressIncreased(BaseGnssResult e, MultiSitePeriodInfo sender)
        {
            BaseGnssResult result = e as BaseGnssResult;

            if (result == null)
            {
                return;
            }
            _results.Add(result);
            ShowCurrent(result);
        }
コード例 #7
0
        /// <summary>
        /// 检核是否满足要求
        /// </summary>
        /// <param name="adjust"></param>
        public override bool Check(BaseGnssResult adjust)
        {
            bool isTrue = (MaxStdDev >= adjust.ResultMatrix.StdDev);

            if (!isTrue)
            {
                var msg = adjust.Name + " " + adjust.Material.ReceiverTime + " 标准差超限!  " + adjust.ResultMatrix.StdDev + " > " + MaxStdDev;
                log.Error(msg);
                Exception = new SatCountException(msg);
            }
            return(isTrue);
        }
コード例 #8
0
 /// <summary>
 /// 写入最终结果
 /// </summary>
 /// <param name="best"></param>
 public void WriteFinal(BaseGnssResult best)
 {
     if (best == null)
     {
         return;
     }
     WriteFinalResult(best, ProjectOutputDirectory);
     if (best is SingleSiteGnssResult)
     {
         writer.Write(best as SingleSiteGnssResult);
     }
 }
コード例 #9
0
ファイル: BaseLinePositionForm.cs プロジェクト: yxw027/GNSSer
        void pp_ProgressIncreased(BaseGnssResult e, MultiSiteEpochInfo sender)
        {
            BaseGnssResult result = e as BaseGnssResult;

            if (result == null)
            {
                return;
            }
            _results.Add(result);
            Adjustments.Add(result.ResultMatrix.Estimated.GetRmsedVector());
            ShowCurrent(result);
        }
コード例 #10
0
ファイル: BaseLinePositionForm.cs プロジェクト: yxw027/GNSSer
        private void ShowobsMinusApriori()
        {
            StringBuilder sb = new StringBuilder();

            BaseGnssResult last = _results[_results.Count - 1];

            sb.AppendLine(last.ResultMatrix.ToString());

            this.Invoke(new Action(delegate()
            {
                this.textBox_obsMinusApriori.Text = sb.ToString();
            }));
        }
コード例 #11
0
        /// <summary>
        /// 写入文件
        /// </summary>
        /// <param name="best"></param>
        /// <param name="allPath"></param>
        /// <returns></returns>
        private string AppentShortTabToFile(BaseGnssResult best, string allPath)
        {
            if (!File.Exists(allPath))
            {
                Geo.Utils.FileUtil.CheckOrCreateDirectory(Path.GetDirectoryName(allPath));
                var str1 = best.ToShortTabTitles();
                File.AppendAllText(allPath, str1 + "\r\n", Encoding);
            }

            string str = best.ToShortTabValue();

            File.AppendAllText(allPath, str + "\r\n", Encoding);
            return(str);
        }
コード例 #12
0
        /// <summary>
        /// 检核是否满足要求
        /// </summary>
        /// <param name="checkee">被检核者</param>
        public override bool Check(BaseGnssResult checkee)
        {
            bool result = true;

            foreach (var item in Checkers)
            {
                result = item.Check(checkee);
                if (!result)
                {
                    this.Exception = item.Exception;
                    return(result);
                }
            }
            return(result);
        }
コード例 #13
0
 static void pp_Produced(BaseGnssResult product, EpochInformation material)
 {
     ProcessCount++;
     if (GnsserConfig.IsShowResultOnTime)
     {
         ShowInfo(product.GetTabValues());
     }
     else
     {
         //简易进度条
         if (ProcessCount % 100 == 0)
         {
             System.Console.Write(".");
         }
     }
 }
コード例 #14
0
ファイル: BaseLinePositionForm.cs プロジェクト: yxw027/GNSSer
        private void ShowCurrent(BaseGnssResult result)
        {
            ProcessCount++;
            this.Invoke(new Action(delegate()
            {
                this.backgroundWorker1.ReportProgress(ProcessCount);

                if (this.radio_out100.Checked && ProcessCount > 100)
                {
                    return;
                }
                if (radio_noOut.Checked == true)
                {
                    return;
                }

                // this.textBox_rms.SuspendLayout();
                this.textBox_appriori.Text += "\r\n" + result.GetParamStdVectorString();
                this.textBox_estParam.Text += "\r\n" + result.GetEstimatedVectorString();
                this.textBox_result.Text   += "\r\n" + result.ToString();
                //   this.textBox_rms.Update();
                //   this.Update();
            }));
        }
コード例 #15
0
        public override BaseGnssResult CaculateKalmanFilter(MultiSitePeriodInfo recInfo, BaseGnssResult lastClockEstimationResult = null)
        {
            DifferClockEstimationResult last = null;

            if (lastClockEstimationResult != null)
            {
                last = (DifferClockEstimationResult)lastClockEstimationResult;
            }
            //  ISatWeightProvider SatWeightProvider = new SatElevateAndRangeWeightProvider();

            var matrixBuilder = (IonoFreeEpochDifferClockEstimationMatrixBuilder)MatrixBuilder;

            matrixBuilder.CurrentMaterial = recInfo;
            matrixBuilder.SetPreviousProduct(last);
            matrixBuilder.Build();


            //  this.Adjustment = new KalmanFilter( this.MatrixBuilder);
            this.Adjustment = this.RunAdjuster(BuildAdjustObsMatrix(this.CurrentMaterial));

            if (Adjustment.Estimated == null)
            {
                return(null);
            }

            ////尝试固定模糊度  cuiyang 2015.07
            //int fixFlag = Ppp_AR.Process(recInfo, Adjustment);

            DifferClockEstimationResult result = (DifferClockEstimationResult)BuildResult();

            return(result);
        }
コード例 #16
0
        /// <summary>
        /// 处理一个历元
        /// </summary>
        /// <param name="mEpochInfo"></param>
        public override SimpleGnssResult Produce(MultiSiteEpochInfo mEpochInfo)
        {
            //3.计算
            // this.CurrentGnssResult
            BaseGnssResult GnssResult = null;

            if (Solver is MultiSitePeriodSolver) //多站多历元
            {
                if (this.MultiSitePeriodInfoBuilder == null)
                {
                    this.MultiSitePeriodInfoBuilder = new Domain.MultiSitePeriodInfoBuilder(Option);
                }

                MultiSitePeriodInfoBuilder.Add(mEpochInfo);
                var period = MultiSitePeriodInfoBuilder.Build();
                if (period == null || !period.Enabled)
                {
                    return(null);
                }

                GnssResult = ((MultiSitePeriodSolver)Solver).Get(period);
            }
            else if (Solver is SingleSitePeriodSolver)  //单站多历元
            {
                PeriodInformationBuilder.Add(mEpochInfo.First);
                var period = PeriodInformationBuilder.Build();
                if (period == null || !period.Enabled)
                {
                    return(null);
                }

                GnssResult = ((SingleSitePeriodSolver)Solver).Get(period);
            }
            else if (Solver is MultiSiteEpochSolver)
            {
                GnssResult = ((MultiSiteEpochSolver)Solver).Get(mEpochInfo);
            }
            else if (Solver is SingleSiteGnssSolver) //此处只计算基准流
            {
                if (mEpochInfo.Contains(BaseSiteName))
                {
                    GnssResult = ((SingleSiteGnssSolver)Solver).Get(mEpochInfo[BaseSiteName]);
                }
                else
                {
                    GnssResult = null;
                }
            }

            if (GnssResult == null)
            {
                return(null);
            }

            //4.结果后处理
            if (Option.IsFixingAmbiguity)
            {
                //PPP模糊度处理
                if (GnssResult is PppResult)
                {
                    var PppResult = GnssResult as PppResult;
                }

                if (GnssResult is PeriodDoubleDifferPositionResult)
                {
                    var result = GnssResult as PeriodDoubleDifferPositionResult;
                    AmbiguityManager.Regist(result);
                }
            }
            return(GnssResult);
        }
コード例 #17
0
ファイル: BaseLinePositionForm.cs プロジェクト: yxw027/GNSSer
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            startTime = DateTime.Now;
            //线程访问,避免等待。
            this.Invoke(new Action(delegate() { LoadDataSource(); }));

            ObsDataAnalyst = null;
            if (checkBox_preAnalysis.Checked && this.CaculateType == CaculateType.Filter) // 分析一次就够了,否则浪费时间。
            {
                Analysis();
            }

            ShowInfo("数据分析时间:" + (DateTime.Now - startTime));

            //  try
            //{
            ProcessCount = 0;
            startTime    = DateTime.Now;

            int MaxProcessCount = int.Parse(this.textBox_caculateCount.Text);
            int startEphoch     = int.Parse(textBox_startEpoch.Text);

            _results.Clear();
            Adjustments.Clear();

            GnssProcessOption option = GetModel(RovObsDataSource.ObsInfo.StartTime);
            //统计共同卫星
            //   SourcePrnStatistics sta = new SourcePrnStatistics(RefObsDataSource, RovObsDataSource, option.SatelliteTypes, 6);
            //   option.CommonPrns = sta.CommonPRNs;
            List <string> oPathes = new List <string>()
            {
                this.textBox_obsPath_ref.Text, rovPath
            };
            var MultiSiteObsDataSource = new MultiSiteObsStream(oPathes, option.BaseSiteSelectType, true, option.IndicatedBaseSiteName);

            DataSourceContext context = DataSourceContext.LoadDefault(option, MultiSiteObsDataSource, ephemerisDataSource, clockFile);

            //选择适当的差分算法
            if (radioButton_pppResidualDiffer.Checked)
            {
                _positioner = new IonFreeDoubleDifferPositioner(context, option);
                ((IonFreeDoubleDifferPositioner)_positioner).Produced += pp_ProgressIncreased;
            }
            if (radioButton_phaseSingleDiffer.Checked)
            {
                //   option.IsUseFiexedSats = true;
                _positioner = new SingleDifferPositioner(context, option);
                ((SingleDifferPositioner)_positioner).Produced += pp_ProgressIncreased;
            }
            if (radioButton_norelevant.Checked)
            {
                //   option.IsUseFiexedSats = true;
                _positioner = new SingleDifferNoRelevantPositioner(context, option);
                ((SingleDifferNoRelevantPositioner)_positioner).Produced += pp_ProgressIncreased;
            }
            if (radioButton_doubleDiffer.Checked)
            {
                // option.IsUseFiexedSats = true;
                _positioner = new PeriodDoublePhaseDifferPositioner(context, option);
                ((PeriodDoublePhaseDifferPositioner)_positioner).Produced += pp_ProgressIncreased;
            }


            int CurrentIndex = 0;
            var MultiSiteSatTimeInfoManager = new Gnsser.MultiSiteSatTimeInfoManager(MultiSiteObsDataSource.BaseDataSource.ObsInfo.Interval);
            var checker                    = MultiSiteEpochCheckingManager.GetDefault(context, option);
            var reviser                    = MultiSiteEpochInfoReviseManager.GetDefault(context, option, MultiSiteSatTimeInfoManager);
            var rawreviser                 = MultiSiteEpochInfoReviseManager.GetDefaultRaw(context, option);
            var bufferedStream             = new Geo.BufferedStreamService <MultiSiteEpochInfo>(context.ObservationDataSources, option.BufferSize);
            var MultiSitePeriodInfoBuilder = new Domain.MultiSitePeriodInfoBuilder(option);

            foreach (var item in bufferedStream)
            {
                if (IsCancel)
                {
                    log.Info("计算被手动取消。"); break;
                }
                if (CurrentIndex < option.StartIndex)
                {
                    log.Info("略过历元编号 " + CurrentIndex + ", 将开始于 " + option.StartIndex); continue;
                }
                if (CurrentIndex > option.StartIndex + option.CaculateCount)
                {
                    log.Info("计算达到设置的最大数量" + option.CaculateCount); break;
                }
                //if (key.First.ReceiverTime > this.EphemerisEndTime)
                //{
                //    log.Error("星历服务停止!无法继续计算。");
                //    break;
                //}
                if (!checker.Check(item))
                {
                    continue;
                }
                var val = item;
                if (!rawreviser.Revise(ref val))
                {
                    continue;
                }

                if (!reviser.Revise(ref val))
                {
                    continue;
                }

                BaseGnssResult GnssResult = null;
                if (_positioner is MultiSitePeriodSolver)
                {
                    MultiSitePeriodInfoBuilder.Add(item);
                    var period = MultiSitePeriodInfoBuilder.Build();
                    if (period == null || !period.Enabled)
                    {
                        continue;
                    }

                    GnssResult = ((MultiSitePeriodSolver)_positioner).Get(period);
                }
                else
                {
                    GnssResult = ((MultiSiteEpochSolver)_positioner).Get(item);
                }

                if (GnssResult == null)
                {
                    continue;
                }


                //GnssResults.Add(GnssResult);

                ////注册参数名称
                //NamedValueRowManager.Regist(GnssResult.ParamNames);

                //if (IsCancel) { break; }
                //ShowNotice("当前进度:" + CurrentIndex++);
            }

            //_positioner.Gets(startEphoch, MaxProcessCount);
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
        }
コード例 #18
0
 /// <summary>
 /// 检核是否满足要求
 /// </summary>
 /// <param name="positionResult">历元计算结果</param>
 public abstract bool Check(BaseGnssResult positionResult);