/// <summary> /// Fills gridvalues function with profiledata based on profileline over the grid /// </summary> /// <param name="function"></param> /// <param name="coverage"></param> /// <param name="polyline"></param> /// <param name="resolution">Defines the sample resolution along <paramref name="polyline"/> (each resolution step a sample). /// Null will cause 101 samples to be take along the line uniformly.</param> /// <exception cref="ArgumentException">When <paramref name="resolution"/> is 0.0 or less.</exception> public static void UpdateProfileFunctionValues(Function function, ICoverage coverage, ILineString polyline, DateTime?time, double?resolution = null) { // when coverage is empty (has no times), we cannot call Evaluate below... if (time != null && time.Equals(default(DateTime))) { return; } function.Clear(); double offset = 0; double step = resolution ?? polyline.Length / 100; var gridProfileCoordinates = GetGridProfileCoordinates(polyline, step).ToArray(); foreach (ICoordinate coordinate in gridProfileCoordinates) { var value = time != null?coverage.Evaluate(coordinate, time.Value) : coverage.Evaluate(coordinate); if (value == null) { offset += step; continue; } function[offset] = value; offset += step; } }
private void SetEvaluationTolerance(ICoverage coverage) { var featureCoverage1 = coverage as FeatureCoverage; if (featureCoverage1 != null) { var tolerance = Map.PixelSize * 5; var featureCoverage = featureCoverage1; if (featureCoverage.EvaluateTolerance != tolerance) { featureCoverage.EvaluateTolerance = tolerance; } } var networkCoverage = coverage as NetworkCoverage; if (networkCoverage != null) { var tolerance = Map.PixelSize * 20; if (networkCoverage.EvaluateTolerance != tolerance) { networkCoverage.EvaluateTolerance = tolerance; } } }
public Report(IReportOptions options, IEnviornmentVariables enviornmentVariables, ISourceCode sourceCode, ICoverage coverage) { _reportOptions = new Lazy <IReportOptions>(() => options); EnviornmentVariables = enviornmentVariables; SourceCode = sourceCode; Coverage = coverage; _reporter = new Lazy <string>(() => $"{Env}{Network}{CombinedCoverage}"); }
public bool IsSuperCoverage(ICoverage subCov) { if (Bitness != subCov.Bitness) { throw new ArgumentException(); } return(Intersection(subCov).Equals(subCov)); }
public ICube[] Intersection(ICoverage intrsctCov) { if (Bitness != intrsctCov.Bitness) { throw new ArgumentException(); } return(Cubes.Intersect(intrsctCov.ToCubesArray()).ToArray()); }
public ICube[] Except(ICoverage excptCov) { if (Bitness != excptCov.Bitness) { throw new ArgumentException(); } return(Cubes.Except(excptCov.ToCubesArray()).ToArray()); }
public UploadFacade(IContinuousIntegrationServer continuousIntegrationServer, IVersionControlSystem versionControlSystem, IYaml yaml, ICoverage coverage, IEnviornmentVariables enviornmentVariables, IUrl url, IUpload upload) { _continuousIntegrationServer = continuousIntegrationServer; _versionControlSystem = versionControlSystem; _yaml = yaml; _coverage = coverage; _enviornmentVariables = enviornmentVariables; _url = url; _upload = upload; }
/// <summary> /// Fills gridvalues function with profiledata based on profileline over the grid /// </summary> /// <param name="function"></param> /// <param name="grid"></param> /// <param name="polyline"></param> public static void UpdateCoverageValues(Function function, ICoverage grid, ILineString polyline, DateTime?time) { function.Clear(); double offset = 0; double step = polyline.Length / 100; foreach (ICoordinate coordinate in GetGridProfileCoordinates(polyline, step)) { function[offset] = time != null?grid.Evaluate(coordinate, time.Value) : grid.Evaluate(coordinate); offset += step; } }
private void UpdateCoverageTimeFilters(ICoverage coverage) { var currentTimeFilter = coverage.Filters .OfType<IVariableValueFilter>() .Where(f => f.Variable is Variable<DateTime>) .FirstOrDefault(); //update the time filter and we're done if (currentTimeFilter != null) { currentTimeFilter.Values[0] = CurrentTime; } }
private void UpdateCoverageTimeFilters(ICoverage coverage) { var currentTimeFilter = coverage.Filters .OfType <IVariableValueFilter>() .Where(f => f.Variable is Variable <DateTime>) .FirstOrDefault(); //update the time filter and we're done if (currentTimeFilter != null) { currentTimeFilter.Values[0] = CurrentTime; } }
/// <summary> /// Defines the gridProfile function /// </summary> /// <param name="grid"></param> /// <param name="polyline"></param> /// <param name="resolution">Defines the sample resolution along <paramref name="polyline"/> (each resolution step a sample). /// Null will cause 101 samples to be take along the line uniformly.</param> /// <exception cref="ArgumentException">When <paramref name="resolution"/> is 0.0 or less.</exception> public static Function GetCoverageValues(ICoverage grid, ILineString polyline, DateTime? time, double? resolution = null) { var function = new Function { Name = grid.Name }; function.Arguments.Add(new Variable<double>("offset")); function.Components.Add((IVariable)TypeUtils.CreateGeneric(typeof(Variable<>), grid.Components[0].ValueType, new object[] { "value" })); function.Components[0].NoDataValues = grid.Components[0].NoDataValues; if (null == polyline) { return function; } UpdateProfileFunctionValues(function, grid, polyline, time, resolution); return function; }
private void UpdateCoverageTimeFilters(ICoverage coverage) { var currentTimeFilter = coverage.Filters .OfType <IVariableValueFilter>() .FirstOrDefault(f => f.Variable is Variable <DateTime>); //update the time filter and we're done if (currentTimeFilter != null) { if (TimeSelectionStart.HasValue && TimeSelectionStart.Value == DateTime.MinValue) { SetCurrentTimeSelection(coverage.Time.AllValues.FirstOrDefault(), null); } currentTimeFilter.Values[0] = TimeSelectionStart; } }
private void btnBulid_Click(object sender, EventArgs e) { try { if (this.listView1.SelectedIndices.Count > 0) { ICoverage coverage = (this.icoverageName_0 as IName).Open() as ICoverage; ListViewItem item = this.listView1.SelectedItems[0]; ICoverageFeatureClassName tag = item.Tag as ICoverageFeatureClassName; coverage.Build(tag.FeatureClassType, ""); coverage = null; MessageBox.Show("Bulid成功!"); } } catch (Exception exception) { Logger.Current.Error("", exception, ""); MessageBox.Show("Bulid失败!"); } }
private void SetEvaluationTolerance(ICoverage coverage) { if (coverage is FeatureCoverage) { var tolerance = Map.PixelSize * 5; var featureCoverage = ((FeatureCoverage)coverage); if (featureCoverage.EvaluateTolerance != tolerance) { featureCoverage.EvaluateTolerance = tolerance; } } if (coverage is NetworkCoverage) { var tolerance = Map.PixelSize * 20; var networkCoverage = (NetworkCoverage)coverage; if (networkCoverage.EvaluateTolerance != tolerance) { networkCoverage.EvaluateTolerance = tolerance; } } }
private void btnClean_Click(object sender, EventArgs e) { try { if (this.listView1.SelectedIndices.Count > 0) { ICoverage coverage = (this.icoverageName_0 as IName).Open() as ICoverage; double dangleTolerance = coverage.get_Tolerance(esriCoverageToleranceType.esriCTTFuzzy); double fuzzyTolerance = coverage.get_Tolerance(esriCoverageToleranceType.esriCTTDangle); ListViewItem item = this.listView1.SelectedItems[0]; ICoverageFeatureClassName tag = item.Tag as ICoverageFeatureClassName; coverage.Clean(dangleTolerance, fuzzyTolerance, tag.FeatureClassType); coverage = null; MessageBox.Show("Clean成功!"); } } catch (Exception exception) { Logger.Current.Error("", exception, ""); MessageBox.Show("Clean失败!"); } }
private void UpdateCoverageTimeFilters(ICoverage coverage) { var currentTimeFilter = coverage.Filters .OfType<IVariableValueFilter>() .FirstOrDefault(f => f.Variable is Variable<DateTime>); //update the time filter and we're done if (currentTimeFilter != null) { if (TimeSelectionStart.HasValue && TimeSelectionStart.Value == DateTime.MinValue) SetCurrentTimeSelection(coverage.Time.AllValues.FirstOrDefault(), null); currentTimeFilter.Values[0] = TimeSelectionStart; } }
public ICube[] Intersection(ICoverage intrsctCov) { return(ToCubesArray()); }
public ICube[] Except(ICoverage subCov) { return(ToCubesArray()); }
public bool Equals(ICoverage coverage) { return(coverage.Bitness == Bitness && coverage.Size == Size && Intersection(coverage).Length == Size); }
private static DateTime GetDefaultTimeFromCoverage(ICoverage coverage) { //if no time is specified we set a default (first or minvalue) return(coverage.Time.AllValues.Count > 0 ? coverage.Time.AllValues[0] : DateTime.MinValue); }
public bool IsSubCoverage(ICoverage superCov) { return(true); }
public bool IsSuperCoverage(ICoverage subCov) { return(subCov.GetType() == typeof(EmptyCube)); }
public CoverageTask(NUnitTask nunit, DevenvTask task, ICoverage instrument) { _nunit = nunit; _builder = task; _instrument = instrument; }
/// <summary> /// Fills gridvalues function with profiledata based on profileline over the grid /// </summary> /// <param name="function"></param> /// <param name="coverage"></param> /// <param name="polyline"></param> /// <param name="resolution">Defines the sample resolution along <paramref name="polyline"/> (each resolution step a sample). /// Null will cause 101 samples to be take along the line uniformly.</param> /// <exception cref="ArgumentException">When <paramref name="resolution"/> is 0.0 or less.</exception> public static void UpdateProfileFunctionValues(Function function, ICoverage coverage, ILineString polyline, DateTime? time, double? resolution = null) { // when coverage is empty (has no times), we cannot call Evaluate below... if (time != null && time.Equals(default(DateTime))) return; function.Clear(); double offset = 0; double step = resolution ?? polyline.Length / 100; var gridProfileCoordinates = GetGridProfileCoordinates(polyline, step).ToArray(); foreach (ICoordinate coordinate in gridProfileCoordinates) { var value = time != null ? coverage.Evaluate(coordinate, time.Value) : coverage.Evaluate(coordinate); if (value == null) { offset += step; continue; } function[offset] = value; offset += step; } }
private static DateTime GetDefaultTimeFromCoverage(ICoverage coverage) { //if no time is specified we set a default (first or minvalue) return coverage.Time.AllValues.Count > 0 ? coverage.Time.AllValues[0] : DateTime.MinValue; }