/// <summary> /// 根据时间获取路径 /// </summary> /// <param name="time">时间</param> /// <returns></returns> public override FileOption Get(Time time) { ELMarkerReplaceService service = new ELMarkerReplaceService(ELMarkerReplaceService.GetTimeKeyWordDictionary(time)); var list = service.Get(PathModels); return(new FileOption(list)); }
/// <summary> /// 构建远程路径 /// </summary> /// <param name="time"></param> /// <param name="urlModel"></param> /// <returns></returns> private List <string> BuildUrls(List <string> urlModel, Time time) { Dictionary <string, string> dic = ELMarkerReplaceService.GetTimeKeyWordDictionary(time); // dic.Add(ELMarker.ProductType, fileType.ToString()); ELMarkerReplaceService elService = new Gdp.ELMarkerReplaceService(dic); var url = elService.Get(urlModel); return(url); }
public void SetTemplates(Time timeUtc) { var hours = timeUtc.Hour + timeUtc.Minute / 60.0; if (hours < 6.1) // 当天尚未更新,回滚到前一天 { var models = new List <string>() { "ftp://cddis.gsfc.nasa.gov/pub/gps/products/{GpsWeek}/igu{GpsWeek}{DayOfWeek}_18.sp3.Z", "ftp://cddis.gsfc.nasa.gov/pub/gps/products/{GpsWeek}/igu{GpsWeek}{DayOfWeek}_12.sp3.Z", }; var lstDay = timeUtc - TimeSpan.FromHours(24); var dic = ELMarkerReplaceService.GetTimeKeyWordDictionary(lstDay); var elService = new Gdp.ELMarkerReplaceService(dic); var urls = elService.Get(models); this.UrlTemplates[SatelliteType.G] = urls; } else if (hours < 12.1) { var models = new List <string>() { "ftp://cddis.gsfc.nasa.gov/pub/gps/products/{GpsWeek}/igu{GpsWeek}{DayOfWeek}_18.sp3.Z", }; var lstDay = timeUtc - TimeSpan.FromHours(24); var dic = ELMarkerReplaceService.GetTimeKeyWordDictionary(lstDay); var elService = new Gdp.ELMarkerReplaceService(dic); var urls = elService.Get(models); urls.Add("ftp://cddis.gsfc.nasa.gov/pub/gps/products/{GpsWeek}/igu{GpsWeek}{DayOfWeek}_00.sp3.Z"); this.UrlTemplates[SatelliteType.G] = urls; } else if (hours < 18.1) { this.UrlTemplates[SatelliteType.G] = new List <string>() { "ftp://cddis.gsfc.nasa.gov/pub/gps/products/{GpsWeek}/igu{GpsWeek}{DayOfWeek}_12.sp3.Z", "ftp://cddis.gsfc.nasa.gov/pub/gps/products/{GpsWeek}/igu{GpsWeek}{DayOfWeek}_00.sp3.Z", }; } else { this.UrlTemplates[SatelliteType.G] = new List <string>() { "ftp://cddis.gsfc.nasa.gov/pub/gps/products/{GpsWeek}/igu{GpsWeek}{DayOfWeek}_18.sp3.Z", "ftp://cddis.gsfc.nasa.gov/pub/gps/products/{GpsWeek}/igu{GpsWeek}{DayOfWeek}_12.sp3.Z", }; } }