/// <summary> /// 加载所有数据源.//2015.05.12, czs, 应该采用懒加载模式,用则加载,不用则不加载,可以提高效率 /// </summary> public void LoadDataSource() { //如果没有设置输入源,则判断是否有路径 if (ObservationDataSources == null && this.Option.IsObsDataRequired) { AddObservationDataSources(); } if (Session == null) { Session = new SessionInfo(ObservationDataSources.TimePeriod, Option.SatelliteTypes); } if (this.Option.IsSiteCoordServiceRequired) { AddSiteCoordService(); } if (this.Option.IsStationInfoRequired) { AddStaionInfoService(); } SetAntennaDataSource(); //为所有测站附加天线信息 if (this.AntennaDataSource != null) { foreach (var item in ObservationDataSources.DataSources) { item.SiteInfo.Antenna = this.AntennaDataSource.Get(item.SiteInfo.AntennaType); } } if ((EphemerisService == null || EphemerisService.SatCount == 0) && this.Option.IsEphemerisRequired) { this.EphemerisService = new EphemerisServiceProvider(this.GlobalDataOption, Option, ObservationDataSources).GetService(); //第二星历 ObservationDataSources.TryLoadEphemerisServices(); if (ObservationDataSources.EphemerisServices.Count > 0) { this.SecondEphemerisService = ObservationDataSources.EphemerisServices.First; var msg = "自带了导航星历,加入备用星历服务之中" + this.SecondEphemerisService; log.Info(msg); } } if (!HasClockService && Option.IsPreciseClockFileRequired && Option.IsUsingFullClockService) { this.ClockService = new ClockServiceProvider(GlobalDataOption, Option).GetService(); } if (!HasClockService && Option.IsPreciseClockFileRequired) { this.SimpleClockService = new SimpleClockServiceProvider(GlobalDataOption, Option).GetService(); } var isIgsProductAwailable = IgsProductTimeAvailable.IsFinalAvailableGps(Session.TimePeriod.Start); if (isIgsProductAwailable && ErpDataService == null && Option.IsErpFileRequired) { var msg = "没有手动设置ERP文件,也没有启用文件自动匹配功能。"; if (!this.GlobalDataOption.EnableAutoFindingFile) { log.Info(msg); // throw new ArgumentException(msg); } else { this.ErpDataService = new ErpServiceProvider(GlobalDataOption, Option).GetService(); // this.ErpDataService = new CommonErpServiceProvider(IgsProductSourceOption).GetDataSourceService(); //this.ErpDataService = new ErpServiceProvider(GlobalDataOption, Option).GetService(); //this.Add(GnssDataType.ERP, new ErpFileService(Option.GetErpFileOption())); } } LoadIonoDataSourceService(isIgsProductAwailable); if (this.Option.IsTropAugmentEnabled && File.Exists(Option.TropAugmentFilePath)) { log.Info("即将加载对流层增强文件 " + Option.TropAugmentFilePath); this.TropAugService = new TropAugService(Option.TropAugmentFilePath); } //钟跳 if (Option.IsOpenClockJumpSwitcher && File.Exists(Option.OuterClockJumpFile)) { ClockJumpFile = new ObjectTableReader(Option.OuterClockJumpFile).Read(); } }
/// <summary> /// 通用构造函数 /// </summary> /// <param name="GlobalDataOption"></param> /// <param name="option"></param> /// <param name="session"></param> public DataSourceContext(GnsserConfig GlobalDataOption, GnssProcessOption option, SessionInfo session) : this() { this.GlobalDataOption = GlobalDataOption; this.Option = option; this.Session = session; }
/// <summary> ///获取IGS产品数据源选项。 /// </summary> /// <param name="sessionInfo"></param> /// <returns></returns> public IgsProductSourceOption GetIgsProductSourceOption(SessionInfo sessionInfo) { return(GetIgsProductSourceOption(sessionInfo.TimePeriod, sessionInfo.SatelliteTypes)); }