예제 #1
0
        /// <summary>
        /// 数据源读取
        /// </summary>
        private void LoadDataSource()
        {
            startTime = DateTime.Now;

            //星历数据源
            ephemerisDataSource = null;
            if (IsSetEphemerisFile)//读取星历数据
            {
                string            ephemerisPath = this.textBox_navPath.Text;
                FileEphemerisType ephType       = EphemerisDataSourceFactory.GetFileEphemerisTypeFromPath(ephemerisPath);
                ephemerisDataSource = EphemerisDataSourceFactory.Create(ephemerisPath);
            }
            //加载文件数据
            this.rovPath          = this.textBox_obsFile_rov.Text;
            this.RefObsDataSource = new RinexFileObsDataSource(this.textBox_obsPath_ref.Text);
            this.RovObsDataSource = new RinexFileObsDataSource(rovPath);

            //使用外部设置的概略坐标。
            if (this.rmsedXyzControl_rov.IsEnabled)
            {
                this.RovObsDataSource.SiteInfo.SetApproxXyz(this.rmsedXyzControl_rov.RmsedXyz.Value);
                this.RovObsDataSource.SiteInfo.EstimatedXyzRms = this.rmsedXyzControl_rov.RmsedXyz.Rms;
            }
            //概略坐标显示到界面上。
            rmsedXyzControl_rov.SetRmsedXyz(new RmsedXYZ(RovObsDataSource.SiteInfo.ApproxXyz, RovObsDataSource.SiteInfo.EstimatedXyzRms));


            //使用外部设置的概略坐标。
            if (this.rmsedXyzControl_ref.IsEnabled)
            {
                this.RefObsDataSource.SiteInfo.SetApproxXyz(this.rmsedXyzControl_ref.RmsedXyz.Value);
                this.RefObsDataSource.SiteInfo.EstimatedXyzRms = this.rmsedXyzControl_ref.RmsedXyz.Rms;
            }
            //概略坐标显示到界面上。
            rmsedXyzControl_ref.SetRmsedXyz(new RmsedXYZ(RefObsDataSource.SiteInfo.ApproxXyz, RefObsDataSource.SiteInfo.EstimatedXyzRms));



            //检查是否读取钟差数据
            clockFile = null;
            if (this.checkBox_enableClockFile.Checked)
            {
                clockFile = new Data.SimpleClockService(this.textBox_ClockPath.Text);
            }

            TimeSpan span = DateTime.Now - startTime;

            ShowInfo("数据已读入,时间(秒):" + span.TotalSeconds);
        }
예제 #2
0
        /// <summary>
        /// 创建单点定位
        /// </summary>
        /// <param name="obsPath">测站信息</param>
        /// <param name="startTime">起始计算时间</param>
        /// <returns></returns>
        private IonFreeDoubleDifferPositioner BuildPositioner(string obsPath, RinexFileObsDataSource refStationPath, BufferedTimePeriod startTime)
        {
            GnssProcessOption PositionOption = GetModel(startTime);

            #region 星历钟差数据源配置
            #region 星历数据配置
            FileEphemerisService ephemerisDataSource = null;
            if (IsSetEphemerisFile)
            {
                string ephemerisPath = this.textBox_navPath.Text;
                if (!File.Exists(ephemerisPath))
                {
                    throw new FileNotFoundException("指定星历文件不存在!\r\n" + ephemerisPath);
                }
                FileEphemerisType ephType = EphemerisDataSourceFactory.GetFileEphemerisTypeFromPath(ephemerisPath);
                ephemerisDataSource = EphemerisDataSourceFactory.Create(ephemerisPath);
            }
            #endregion
            #region 钟差数据配置
            Data.ISimpleClockService clock = null;
            if (this.checkBox_enableClockFile.Checked)
            {
                clock = new Data.SimpleClockService(this.textBox_ClockPath.Text);
            }
            #endregion
            #endregion

            #region 定位器构造


            //加载文件数据
            RinexFileObsDataSource refObservationDataSource = (refStationPath);

            var rovObservationDataSource = new RinexFileObsDataSource(obsPath);

            DataSourceContext             context = DataSourceContext.LoadDefault(PositionOption, rovObservationDataSource, ephemerisDataSource, clock);
            IonFreeDoubleDifferPositioner pp      = new IonFreeDoubleDifferPositioner(context, PositionOption);

            //pp.Produced += pp_ProgressIncreased;
            return(pp);

            #endregion
        }
예제 #3
0
 public void Init(GnsserConfig GnsserConfig, IEphemerisService ephemerisDataSource, Data.ISimpleClockService clockFile)
 {
     this.GnsserConfig        = GnsserConfig;
     this.EphemerisDataSource = ephemerisDataSource;
     this.ClockFile           = clockFile;
 }