示例#1
0
        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);
            //}
        }
        /// <summary>
        /// 默认多文件矫正器
        /// </summary>
        /// <param name="DataSourceContext"></param>
        /// <param name="Option"></param>
        /// <param name="MultiSiteSatTimeInfoManager"></param>
        /// <returns></returns>
        public static MultiSiteEpochInfoReviseManager GetDefault(DataSourceContext DataSourceContext, GnssProcessOption Option, MultiSiteSatTimeInfoManager MultiSiteSatTimeInfoManager)
        {
            var reviser = new MultiSiteEpochInfoReviseManager(DataSourceContext, Option);

            foreach (var item in DataSourceContext.ObservationDataSources.DataSources)
            {
                var SatTimeInfoManager = MultiSiteSatTimeInfoManager.GetOrCreate(item.Name);
                reviser[item.Name] = EpochInfoReviseManager.GetProducingReviser(DataSourceContext, Option, SatTimeInfoManager);
            }

            return(reviser);
        }
示例#3
0
        /// <summary>
        /// 构建矫正器
        /// </summary>
        /// <returns></returns>
        protected override IReviser <MultiSiteEpochInfo> BuildProducingReviser()
        {
            MultiSiteSatTimeInfoManager = new Gnsser.MultiSiteSatTimeInfoManager(DataSource.BaseDataSource.ObsInfo.Interval);

            return(MultiSiteEpochInfoReviseManager.GetDefault(Context, Option, MultiSiteSatTimeInfoManager));
        }