private static UrlBuilderParam ParseDic(Dictionary <string, List <string> > dic) { UrlBuilderParam UrlBuilderParam = new UrlBuilderParam(); foreach (var item in dic) { var type = Gdp.Utils.EnumUtil.TryParse <UrlBuildParamType>(item.Key); var listVal = item.Value; switch (type) { case UrlBuildParamType._: break; case UrlBuildParamType.B: break; case UrlBuildParamType.UrlModels: UrlBuilderParam.UrlModels = listVal; break; case UrlBuildParamType.UrlDirectories: UrlBuilderParam.UrlDirectories = listVal; break; case UrlBuildParamType.Source: UrlBuilderParam.Source = listVal; break; case UrlBuildParamType.IntervalSecond: UrlBuilderParam.IntervalSecond = (int)int.Parse(listVal[0]); break; case UrlBuildParamType.StartTime: UrlBuilderParam.StartTime = Time.Parse(listVal.ToArray()); break; case UrlBuildParamType.EndTime: UrlBuilderParam.EndTime = Time.Parse(listVal.ToArray()); break; case UrlBuildParamType.ProductType: UrlBuilderParam.ProductType = (IgsProductType)Enum.Parse(typeof(IgsProductType), listVal[0]); break; case UrlBuildParamType.OutputPath: UrlBuilderParam.OutputPath = (listVal[0]); break; default: log.Warn(type + " Not implemented "); break; } } return(UrlBuilderParam); }
private static FormatObsParam ParseDic(Dictionary <string, List <string> > dic) { FormatObsParam FormatObsParam = new FormatObsParam(); var Option = FormatObsParam.Option; foreach (var item in dic) { var type = Gdp.Utils.EnumUtil.TryParse <FormatObsParamType>(item.Key); var listVal = item.Value; switch (type) { case FormatObsParamType._: break; case FormatObsParamType.F: break; case FormatObsParamType.OutputDirectory: Option.OutputDirectory = (listVal[0]); break; case FormatObsParamType.InputPath: FormatObsParam.InputPath = (listVal); break; case FormatObsParamType.OutVersion: Option.IsEnableRinexVertion = true; Option.Version = Gdp.Utils.DoubleUtil.TryParse(listVal[0]); break; case FormatObsParamType.SatelliteType: var sats = new List <SatelliteType>(); foreach (var val in listVal) { var satType = Utils.EnumUtil.TryParse <SatelliteType>(val); sats.Add(satType); } Option.IsEnableSatelliteTypes = true; Option.SatelliteTypes = sats; break; case FormatObsParamType.StartTime: Option.IsEnableTimePeriod = true; Option.TimePeriod.Start = Time.Parse(listVal.ToArray()); break; case FormatObsParamType.EndTime: Option.IsEnableTimePeriod = true; Option.TimePeriod.End = Time.Parse(listVal.ToArray()); break; case FormatObsParamType.Interval: Option.Interval = Utils.IntUtil.ParseInt(listVal[0]); break; default: log.Warn(type + " Not implemented "); break; } } return(FormatObsParam); }
private static SelectObsParam ParseDic(Dictionary <string, List <string> > dic) { SelectObsParam SelectObsParam = new SelectObsParam(); var Option = SelectObsParam.Option; foreach (var item in dic) { var type = Gdp.Utils.EnumUtil.TryParse <SelectObsParamType>(item.Key); var listVal = item.Value; switch (type) { case SelectObsParamType._: break; case SelectObsParamType.F: break; case SelectObsParamType.OutputDirectory: SelectObsParam.OutputDirectory = (listVal[0]); break; case SelectObsParamType.InputPath: SelectObsParam.InputPath = (listVal); break; case SelectObsParamType.SatelliteType: var sats = new List <SatelliteType>(); foreach (var val in listVal) { var satType = Utils.EnumUtil.TryParse <SatelliteType>(val); sats.Add(satType); } Option.IsEnableSatelliteTypes = true; Option.SatelliteTypes = sats; break; case SelectObsParamType.StartTime: Option.IsEnableTimePeriod = true; Option.TimePeriod.Start = Time.Parse(listVal.ToArray()); break; case SelectObsParamType.EndTime: Option.IsEnableTimePeriod = true; Option.TimePeriod.End = Time.Parse(listVal.ToArray()); break; case SelectObsParamType.IncludeSiteNames: Option.IsEnableIncludeSiteNames = true; Option.IncludeSiteNames = (listVal); break; case SelectObsParamType.ExcludeSiteNames: Option.ExcludeSiteNames = (listVal); break; case SelectObsParamType.ObsCodes: Option.IsEnableObsCodes = true; Option.ObsCodes = (listVal); break; case SelectObsParamType.MinEpochCount: Option.IsEnableMinEpochCount = true; Option.MinEpochCount = Utils.IntUtil.ParseInt(listVal[0]); break; case SelectObsParamType.MinFrequencyCount: Option.IsEnableMinFrequencyCount = true; Option.MinFrequencyCount = Utils.IntUtil.ParseInt(listVal[0]); break; case SelectObsParamType.MinFileSizeMB: Option.IsEnableMinFileSizeMB = true; Option.MinFileSizeMB = Utils.DoubleUtil.TryParse(listVal[0]); break; default: log.Warn(type + " Not implemented "); break; } } return(SelectObsParam); }