コード例 #1
0
        private static void UpdateNonContainerProgress(VerificationProgressMsg currentProgress,
                                                       VerificationProgressEventArgs e)
        {
            VerificationProgressStep newProgressStep = ToVerificationStep(e.ProgressStep);

            if (currentProgress.ProgressType != (int)e.ProgressType)
            {
                // First non-container progress
                ResetOverallStep(currentProgress);
                currentProgress.Message = string.Empty;
                currentProgress.ProcessingStepMessage = string.Empty;
            }

            if (newProgressStep == VerificationProgressStep.DataLoading)
            {
                SetOverallStep(currentProgress, e);
                ResetDetailStep(currentProgress);
                currentProgress.Message = $"Loading {((IDataset) e.Tag).Name}";
            }
            else if (newProgressStep == VerificationProgressStep.Testing)
            {
                SetDetailStep(currentProgress, e);
                currentProgress.Message = ((QualityCondition)e.Tag).Name;
            }

            currentProgress.ProgressStep = (int)newProgressStep;
        }
コード例 #2
0
        private static bool UpdateContainerProgress(VerificationProgressMsg currentProgress,
                                                    VerificationProgressEventArgs e)
        {
            VerificationProgressStep newProgressStep = ToVerificationStep(e.ProgressStep);

            switch (newProgressStep)
            {
            case VerificationProgressStep.TileProcessing:
                // New tile:
                SetOverallStep(currentProgress, e);
                ResetDetailStep(currentProgress);
                currentProgress.CurrentBox =
                    ProtobufGeometryUtils.ToEnvelopeMsg(e.CurrentBox);
                break;

            case VerificationProgressStep.DataLoading:
                //SetOverallStep(currentProgress, e);
                SetDetailStep(currentProgress, e);
                currentProgress.ProcessingStepMessage = "Loading data";
                currentProgress.Message = ((IDataset)e.Tag).Name;
                break;

            case VerificationProgressStep.Testing:

                if (currentProgress.ProgressStep != (int)newProgressStep)
                {
                    // First time
                    ResetDetailStep(currentProgress);
                    currentProgress.ProcessingStepMessage = "Testing rows";
                }

                double relativeProgress =
                    ((double)e.Current - currentProgress.DetailedProgressCurrentStep) /
                    e.Total;

                if (relativeProgress > 0.05)
                {
                    SetDetailStep(currentProgress, e);
                    var testRow = e.Tag as TestRow;
                    currentProgress.Message = testRow?.DataReference.DatasetName;
                }
                else
                {
                    return(false);
                }

                break;

            case VerificationProgressStep.TileCompleting:
                SetDetailStep(currentProgress, e);
                currentProgress.ProcessingStepMessage = "Completing tile";
                currentProgress.Message = ((QualityCondition)e.Tag).Name;
                break;
            }

            currentProgress.ProgressStep = (int)newProgressStep;

            string message = e.Tag as string;

            CallbackUtils.DoWithNonNull(message, s => currentProgress.Message = s);
            return(true);
        }