コード例 #1
0
        public PatternMatchOfAvgGrayVariationInstance(PatternMatchOfAvgGrayVariationDefinition theDefinition, TestExecution testExecution)
            : base(theDefinition, testExecution)
        {
            if (theDefinition.VariationThreshhold == null)
            {
                throw new ArgumentException("Pattern Match tool '" + theDefinition.Name + "' doesn't have a value assigned to VariationThreshhold");
            }
            mVariationThreshhold = testExecution.DataValueRegistry.GetObject(theDefinition.VariationThreshhold.Name);

            if (theDefinition.Sloppiness == null)
            {
                throw new ArgumentException("Pattern Match tool '" + theDefinition.Name + "' doesn't have a value assigned to Sloppiness");
            }
            mSloppiness = testExecution.DataValueRegistry.GetObject(theDefinition.Sloppiness.Name);

            if (theDefinition.MinWindow == null)
            {
                throw new ArgumentException("Pattern Match tool '" + theDefinition.Name + "' doesn't have a value assigned to MinWindow");
            }
            mMinWindow = testExecution.DataValueRegistry.GetObject(theDefinition.MinWindow.Name);

            if (theDefinition.BrightPixelFactor == null)
            {
                throw new ArgumentException("Pattern Match tool '" + theDefinition.Name + "' doesn't have a value assigned to BrightPixelFactor");
            }
            mBrightPixelFactor = testExecution.DataValueRegistry.GetObject(theDefinition.BrightPixelFactor.Name);

            if (theDefinition.DarkPixelFactor == null)
            {
                throw new ArgumentException("Pattern Match tool '" + theDefinition.Name + "' doesn't have a value assigned to DarkPixelFactor");
            }
            mDarkPixelFactor = testExecution.DataValueRegistry.GetObject(theDefinition.DarkPixelFactor.Name);

            if (theDefinition.ROI == null)
            {
                throw new ArgumentException("Pattern Match tool '" + theDefinition.Name + "' doesn't have an ROI assigned");
            }
            mROI = testExecution.ROIRegistry.GetObject(theDefinition.ROI.Name);

            if (theDefinition.SourceImage == null)
            {
                throw new ArgumentException("Pattern Match tool '" + theDefinition.Name + "' doesn't have an image assigned to SourceImage");
            }
            mSourceImage = testExecution.ImageRegistry.GetObject(theDefinition.SourceImage.Name);

            mDeepAnalysisEnabled = theDefinition.DeepAnalysisEnabled;
            mDeepAnalysisTop     = theDefinition.DeepAnalysisTop;
            mDeepAnalysisBottom  = theDefinition.DeepAnalysisBottom;
            mDeepAnalysisRight   = theDefinition.DeepAnalysisRight;
            mDeepAnalysisLeft    = theDefinition.DeepAnalysisLeft;

            mResult = new GeneratedValueInstance(theDefinition.Result, testExecution);

            mCreateMarkedImage = theDefinition.CreateMarkedImage;
            if (mCreateMarkedImage)
            {
                mMarkedImage = new GeneratedImageInstance(theDefinition.MarkedImage, testExecution);
            }
            mMarkColor = theDefinition.MarkColor;
        }
コード例 #2
0
        public ImageCropInstance(ImageCropDefinition theDefinition, TestExecution testExecution)
            : base(theDefinition, testExecution)
        {
            if (theDefinition.LeftEdge == null)
            {
                throw new ArgumentException(theDefinition.Name + " doesn't have a value assigned to LeftEdge");
            }
            mLeftEdge = testExecution.DataValueRegistry.GetObject(theDefinition.LeftEdge.Name);

            if (theDefinition.Width == null)
            {
                throw new ArgumentException(theDefinition.Name + " doesn't have a value assigned to Width");
            }
            mWidth = testExecution.DataValueRegistry.GetObject(theDefinition.Width.Name);

            if (theDefinition.TopEdge == null)
            {
                throw new ArgumentException(theDefinition.Name + " doesn't have a value assigned to TopEdge");
            }
            mTopEdge = testExecution.DataValueRegistry.GetObject(theDefinition.TopEdge.Name);

            if (theDefinition.Height == null)
            {
                throw new ArgumentException(theDefinition.Name + " doesn't have a value assigned to Height");
            }
            mHeight = testExecution.DataValueRegistry.GetObject(theDefinition.Height.Name);

            if (theDefinition.SourceImage == null)
            {
                throw new ArgumentException(theDefinition.Name + " doesn't have a value assigned to SourceImage");
            }
            mSourceImage = testExecution.ImageRegistry.GetObject(theDefinition.SourceImage.Name);

            mCroppedImage = new GeneratedImageInstance(theDefinition.ResultantImage, testExecution);
        }
コード例 #3
0
        public IntensityVariationOverRectangleInstance(IntensityVariationOverRectangleDefinition theDefinition, TestExecution testExecution)
            : base(theDefinition, testExecution)
        {
            if (theDefinition.VariationThreshhold == null)
            {
                throw new ArgumentException("Intensity Variation tool '" + theDefinition.Name + "' doesn't have a value assigned to VariationThreshhold");
            }
            mVariationThreshhold = testExecution.DataValueRegistry.GetObject(theDefinition.VariationThreshhold.Name);
            mTestXAxis           = theDefinition.TestXAxis;
            mTestYAxis           = theDefinition.TestYAxis;
            ROIInstance theROI = testExecution.ROIRegistry.GetObject(theDefinition.ROI.Name);

            if (theROI is IRectangleROIInstance)
            {
                mROI = (IRectangleROIInstance)theROI;
            }
            else
            {
                throw new ArgumentException("IntensityVariation currently only supports Rectangle ROIs.");
            }
            mSourceImage = testExecution.ImageRegistry.GetObject(theDefinition.SourceImage.Name);
            mResult      = new GeneratedValueInstance(theDefinition.Result, testExecution);

            mCreateMarkedImage = theDefinition.CreateMarkedImage;
            if (mCreateMarkedImage)
            {
                mMarkedImage = new GeneratedImageInstance(theDefinition.MarkedImage, testExecution);
            }
        }
コード例 #4
0
        public ImageDuplicatorInstance(ImageDuplicatorDefinition theDefinition, TestExecution testExecution)
            : base(theDefinition, testExecution)
        {
            if (theDefinition.SourceImage == null)
            {
                throw new ArgumentException("'" + theDefinition.Name + "' doesn't have a value assigned to SourceImage");
            }
            mSourceImage = testExecution.ImageRegistry.GetObject(theDefinition.SourceImage.Name);

            mEnabled = theDefinition.Enabled;

            mDuplicateImage = new GeneratedImageInstance(theDefinition.ResultantImage, testExecution);
        }
コード例 #5
0
        public CameraSnapshotInstance(CameraSnapshotDefinition theDefinition, TestExecution testExecution) : base(theDefinition, testExecution)
        {
            mCameraSnapshotDefintion = theDefinition;

            if (theDefinition.Camera == null)
            {
                throw new ArgumentException("'" + theDefinition.Name + "' doesn't have a camera assigned");
            }
            mCamera = theDefinition.Camera;

            if (theDefinition.Camera == null)
            {
                throw new ArgumentException("'" + theDefinition.Name + "' doesn't have a value assigned to Timeout");
            }
            mTimeout = theDefinition.Timeout;

            mSnapshotImage = new GeneratedImageInstance(theDefinition.ResultantImage, testExecution);
            mResolution    = theDefinition.Resolution;

            testExecution.RegisterTrigger(this);
        }
コード例 #6
0
        public IntensityVariationInstance(IntensityVariationDefinition theDefinition, TestExecution testExecution)
            : base(theDefinition, testExecution)
        {
            if (theDefinition.VariationThreshhold == null)
            {
                throw new ArgumentException("Intensity Variation tool '" + theDefinition.Name + "' doesn't have a value assigned to VariationThreshhold");
            }
            mVariationThreshhold = testExecution.DataValueRegistry.GetObject(theDefinition.VariationThreshhold.Name);
            mTestXAxis           = theDefinition.TestXAxis;
            mTestYAxis           = theDefinition.TestYAxis;
            mROI         = testExecution.ROIRegistry.GetObject(theDefinition.ROI.Name);
            mSourceImage = testExecution.ImageRegistry.GetObject(theDefinition.SourceImage.Name);
            mResult      = new GeneratedValueInstance(theDefinition.Result, testExecution);

            mCreateMarkedImage = theDefinition.CreateMarkedImage;
            if (mCreateMarkedImage)
            {
                mMarkedImage = new GeneratedImageInstance(theDefinition.MarkedImage, testExecution);
            }
            mMarkColor = theDefinition.MarkColor;
        }
コード例 #7
0
        public ImageSmootherInstance(ImageSmootherDefinition theDefinition, TestExecution testExecution) : base(theDefinition, testExecution)
        {
            if (theDefinition.XAxisRadius == null)
            {
                throw new ArgumentException("'" + theDefinition.Name + "' doesn't have a value assigned to XAxisRadius");
            }
            mXAxisRadius = theDefinition.XAxisRadius;

            if (theDefinition.YAxisRadius == null)
            {
                throw new ArgumentException("'" + theDefinition.Name + "' doesn't have a value assigned to YAxisRadius");
            }
            mYAxisRadius = theDefinition.YAxisRadius;

            if (theDefinition.SourceImage == null)
            {
                throw new ArgumentException("'" + theDefinition.Name + "' doesn't have a value assigned to SourceImage");
            }
            mSourceImage = testExecution.ImageRegistry.GetObject(theDefinition.SourceImage.Name);

            mSmoothedImage = new GeneratedImageInstance(theDefinition.ResultantImage, testExecution);
        }
コード例 #8
0
        public PatternMatchOfGrayValueInstance(PatternMatchOfGrayValueDefinition theDefinition, TestExecution testExecution)
            : base(theDefinition, testExecution)
        {
            if (theDefinition.VariationThreshhold == null)
            {
                throw new ArgumentException("Pattern Match tool '" + theDefinition.Name + "' doesn't have a value assigned to VariationThreshhold");
            }
            mVariationThreshhold = testExecution.DataValueRegistry.GetObject(theDefinition.VariationThreshhold.Name);
            mSloppiness          = testExecution.DataValueRegistry.GetObject(theDefinition.Sloppiness.Name);
            mMinWindow           = testExecution.DataValueRegistry.GetObject(theDefinition.MinWindow.Name);
            mBrightPixelFactor   = testExecution.DataValueRegistry.GetObject(theDefinition.BrightPixelFactor.Name);
            mDarkPixelFactor     = testExecution.DataValueRegistry.GetObject(theDefinition.DarkPixelFactor.Name);
            mROI         = testExecution.ROIRegistry.GetObject(theDefinition.ROI.Name);
            mSourceImage = testExecution.ImageRegistry.GetObject(theDefinition.SourceImage.Name);
            mResult      = new GeneratedValueInstance(theDefinition.Result, testExecution);

            mCreateMarkedImage = theDefinition.CreateMarkedImage;
            if (mCreateMarkedImage)
            {
                mMarkedImage = new GeneratedImageInstance(theDefinition.MarkedImage, testExecution);
            }
            mMarkColor = theDefinition.MarkColor;
        }