public FetchClimateBatchResponce FetchClimate(ClimateParameter parameter, double[] latmin, double[] latmax, double[] lonmin, double[] lonmax, int[] starthour, int[] stophour, int[] startday, int[] stopday, int[] startyear, int[] stopyear, FetchingOptions options, ResearchVariationType variationType) { if (startday == null) { startday = Enumerable.Repeat(GlobalConsts.DefaultValue, latmin.Length).ToArray(); } if (stopday == null) { stopday = Enumerable.Repeat(GlobalConsts.DefaultValue, latmin.Length).ToArray(); } if (starthour == null) { starthour = Enumerable.Repeat(GlobalConsts.DefaultValue, latmin.Length).ToArray(); } if (stophour == null) { stophour = Enumerable.Repeat(GlobalConsts.DefaultValue, latmin.Length).ToArray(); } if (startyear == null) { startyear = Enumerable.Repeat(GlobalConsts.StartYear, latmin.Length).ToArray(); } if (stopyear == null) { stopyear = Enumerable.Repeat(GlobalConsts.EndYear, latmin.Length).ToArray(); } for (int i = 0; i < latmin.Length; i++) { AssertFcParameters(latmin[i], latmax[i], lonmin[i], lonmax[i], starthour[i], stophour[i], startday[i], stopday[i], startyear[i], stopyear[i]); } using (var requestDs = DataSet.Open("msds:memory")) { FetchClimateRequestBuilder.FillDataSetWithRequest(requestDs, parameter, latmin, latmax, lonmin, lonmax, starthour, stophour, startday, stopday, startyear, stopyear, options); requestDs.Metadata[Namings.metadataNameVariationType] = variationType.ToString(); requestDs.Commit(); using (var result = ServerProcess(requestDs)) { return(FetchClimateRequestBuilder.BuildBatchResult(result)); } } }
internal double[] FetchClimate(ClimateParameter parameter, double[] latmin, double[] latmax, double[] lonmin, double[] lonmax, int[] starthour, int[] stophour, int[] startday, int[] stopday, int[] startyear, int[] stopyear) { if (startday == null) { startday = Enumerable.Repeat(GlobalConsts.DefaultValue, latmin.Length).ToArray(); } if (stopday == null) { stopday = Enumerable.Repeat(GlobalConsts.DefaultValue, latmin.Length).ToArray(); } if (starthour == null) { starthour = Enumerable.Repeat(GlobalConsts.DefaultValue, latmin.Length).ToArray(); } if (stophour == null) { stophour = Enumerable.Repeat(GlobalConsts.DefaultValue, latmin.Length).ToArray(); } if (startyear == null) { startyear = Enumerable.Repeat(GlobalConsts.StartYear, latmin.Length).ToArray(); } if (stopyear == null) { stopyear = Enumerable.Repeat(GlobalConsts.EndYear, latmin.Length).ToArray(); } for (int i = 0; i < latmin.Length; i++) { AssertFcParameters(latmin[i], latmax[i], lonmin[i], lonmax[i], starthour[i], stophour[i], startday[i], stopday[i], startyear[i], stopyear[i]); } using (var requestDs = DataSet.Open("msds:memory")) { FetchClimateRequestBuilder.FillDataSetWithRequest(requestDs, parameter, latmin, latmax, lonmin, lonmax, starthour, stophour, startday, stopday, startyear, stopyear, new FetchingOptions()); using (var result = ServerProcess(requestDs)) { return(FetchClimateRequestBuilder.BuildBatchResult(result).Values.Select(v => v.GetValueInDefaultClientUnits()).ToArray()); } } }