/// <summary> /// Handles the TestingRow event of the container. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RowEventArgs"/> instance containing the event data.</param> /// <remarks>Must be called within dom tx</remarks> private void container_TestingRow(object sender, RowEventArgs e) { if (Cancelled) { e.Cancel = true; return; } StopInfo stopInfo = RowsWithStopConditions.GetStopInfo(e.Row); var test = (ITest)sender; TestVerification testVerification = GetTestVerification(test); if (stopInfo != null) { if (!stopInfo.Reported) { stopInfo.Reported = TryReportStopInfo( stopInfo, e.Row, testVerification.QualityConditionVerification); } // cancel further testing on this row e.Cancel = true; return; } _currentRow = e.Row; if (LocationBasedQualitySpecification != null) { var feature = e.Row as IFeature; if (feature != null && !LocationBasedQualitySpecification.IsFeatureToBeTested( feature, e.Recycled, e.RecycleUnique, testVerification.QualityCondition, e.IgnoreTestArea)) { e.Cancel = true; } } }
private void container_OnProgressChanged(object sender, ProgressArgs args) { if (Cancelled && _executeContainer != null) { _executeContainer.StopExecute(); } VerificationTimeStats.Update(args); if (args.IsInfoOnly) { if (args.CurrentStep == Step.DataLoading || args.CurrentStep == Step.ITestProcessing || args.CurrentStep == Step.TestRowCreated || args.CurrentStep == Step.TileCompleting) { ClearCurrentRow(); if (_executeContainer == null || args.CurrentStep == Step.ITestProcessing) { if (args.CurrentStep == Step.ITestProcessing) { var test = (ITest)args.Tag; QualityCondition qualityCondition = GetQualityCondition(test); args = new ProgressArgs(args.CurrentStep, args.Current, args.Total, qualityCondition); } OnProgress(new VerificationProgressEventArgs( VerificationProgressType.ProcessNonCache, args)); } else { if (args.CurrentStep == Step.TileCompleting) { var test = (ITest)args.Tag; QualityCondition qualityCondition = GetQualityCondition(test); args = new ProgressArgs(args.CurrentStep, args.Current, args.Total, qualityCondition); } OnProgress(new VerificationProgressEventArgs( VerificationProgressType.ProcessContainer, args)); } } } else { int current = args.Current; if (args.CurrentStep == Step.TileProcessing) { LocationBasedQualitySpecification?.SetCurrentTile(args.CurrentEnvelope); current--; // TODO revise } else if (args.CurrentStep == Step.TileProcessed) { LocationBasedQualitySpecification?.SetCurrentTile(null); GC.Collect(); } OnProgress( new VerificationProgressEventArgs(args.CurrentStep, current, args.Total, args.CurrentEnvelope, args.AllBox)); } }
private void ClearCurrentRow() { _currentRow = null; LocationBasedQualitySpecification?.ResetCurrentFeature(); }