Пример #1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="context"></param>
        /// <param name="option"></param>
        public AbstractGnssSolver(DataSourceContext context, GnssProcessOption option) : base(context, option)
        {
            this.Name = context.ObservationDataSource == null ? "GNSS计算器" : context.ObservationDataSource.Name;
            //为所有测站附加天线信息,为了保险起见多赋值一次。
            if (context.AntennaDataSource != null)
            {
                foreach (var item in context.ObservationDataSources.DataSources)
                {
                    item.SiteInfo.Antenna = context.AntennaDataSource.Get(item.SiteInfo.AntennaType);
                }
            }

            //是否需要伪距预先定位
            if (Option.IsNeedPseudorangePositionWhenProcess && !(this is SimpleRangePositioner))
            {
                int interval          = (int)this.DataSourceContext.ObservationDataSource.ObsInfo.Interval;
                GnssProcessOption opt = GnssProcessOption.GetPsuedoRangeOption(interval, option.IsSmoothRangeWhenPrevPseudorangePosition);

                RangePositioner = new SimpleRangePositioner(DataSourceContext, opt);
            }

            this.IsUpdateEstimatePostition = option.IsUpdateEstimatePostition;
            this.EpochEphemerisSetter      = new EpochEphemerisSetter(DataSourceContext, option);

            //模糊度
            IsOutputAmbiguity = true;
            AmbiguityManager  = new AmbiguityManager(base.Option);
            IonoFreeAmbiguitySolverManager = new IonoFreeAmbiguitySolverManager();
        }
Пример #2
0
        /// <summary>
        /// 快速计算一个坐标。自动重置数据流。
        /// </summary>
        /// <param name="DataSourceContext"></param>
        /// <returns></returns>
        public static SingleSiteGnssResult GetApproxPosition(DataSourceContext DataSourceContext)
        {
            GnssProcessOption PositionOption = GnssProcessOption.GetDefaultSimplePseudoRangePositioningOption();
            var p = new SimpleRangePositioner(DataSourceContext, PositionOption)
            {
                IsUpdateEstimatePostition = true,
                IsPostCheckEnabled        = false,//取消检查,否则报错,2019.05.16, czs
            };

            var Reviser = EpochInfoReviseManager.GetDefaultEpochInfoReviser(DataSourceContext, PositionOption, null);
            var checker = EpochCheckingManager.GetDefaultCheckers(DataSourceContext, PositionOption);
            var EpochEphemerisSetter = new EpochEphemerisSetter(DataSourceContext, PositionOption);

            lock (locker)
            {
                var initMaxRms      = PositionOption.MaxStdDev;
                var initType        = PositionOption.CaculateType;
                var initUpdate      = PositionOption.IsUpdateEstimatePostition;
                var initPostCheck   = PositionOption.IsResidualCheckEnabled;
                var initResultCheck = PositionOption.IsResultCheckEnabled;

                PositionOption.CaculateType              = CaculateType.Independent;
                PositionOption.MaxStdDev                 = 9999999;
                PositionOption.IsResidualCheckEnabled    = false;
                PositionOption.IsResultCheckEnabled      = false;
                PositionOption.IsUpdateEstimatePostition = initUpdate;

                int i = 0;
                SingleSiteGnssResult        GnssResult = null;
                List <SingleSiteGnssResult> results    = new List <SingleSiteGnssResult>();
                foreach (var item in DataSourceContext.ObservationDataSource)
                {
                    i++;

                    if (!checker.Check(item))
                    {
                        continue;
                    }
                    var info = item;
                    // if (!Reviser.Revise(ref info)) { continue; }
                    Reviser.Revise(ref info);
                    if (info.EnabledSatCount < 4)
                    {
                        continue;
                    }
                    GnssResult = p.Get(item);
                    if (GnssResult != null)
                    {
                        item.SiteInfo.SetApproxXyz(item.SiteInfo.EstimatedXyz);
                        results.Add(GnssResult);
                    }
                    if (i > 5 && results.Count > 0)
                    {
                        results.Sort(new Comparison <SingleSiteGnssResult>(delegate(SingleSiteGnssResult a, SingleSiteGnssResult b) { return((int)(1000 * (a.EstimatedXyzRms.Length - b.EstimatedXyzRms.Length))); }));
                        GnssResult = results[0];
                        break;
                    }
                }
                PositionOption.IsResidualCheckEnabled    = initPostCheck;
                PositionOption.IsUpdateEstimatePostition = initUpdate;
                PositionOption.IsResultCheckEnabled      = initResultCheck;
                PositionOption.CaculateType = initType;
                DataSourceContext.ObservationDataSource.Reset();
                PositionOption.MaxStdDev = initMaxRms;
                return(GnssResult);
            }
        }