Beispiel #1
0
        private void DrawNeedleCircleFindCaliperFunction(CogNeedleFindAlgo _CogNeedleFindAlgo)
        {
            if (eTeachStep.ALGO_SET != CurrentTeachStep)
            {
                MessageBox.Show("Not select \"Algorithm Set\" button"); return;
            }
            AlgorithmAreaDisplayRefresh();

            CogFindCircle _CogFindCircle = new CogFindCircle();

            _CogFindCircle.NumCalipers                    = _CogNeedleFindAlgo.CaliperNumber;
            _CogFindCircle.CaliperSearchLength            = _CogNeedleFindAlgo.CaliperSearchLength;
            _CogFindCircle.CaliperProjectionLength        = _CogNeedleFindAlgo.CaliperProjectionLength;
            _CogFindCircle.NumToIgnore                    = _CogNeedleFindAlgo.CaliperIgnoreNumber;
            _CogFindCircle.CaliperSearchDirection         = (CogFindCircleSearchDirectionConstants)_CogNeedleFindAlgo.CaliperSearchDirection;
            _CogFindCircle.CaliperRunParams.Edge0Polarity = (CogCaliperPolarityConstants)_CogNeedleFindAlgo.CaliperPolarity;

            _CogFindCircle.ExpectedCircularArc.CenterX    = _CogNeedleFindAlgo.ArcCenterX;
            _CogFindCircle.ExpectedCircularArc.CenterY    = _CogNeedleFindAlgo.ArcCenterY;
            _CogFindCircle.ExpectedCircularArc.Radius     = _CogNeedleFindAlgo.ArcRadius;
            _CogFindCircle.ExpectedCircularArc.AngleStart = _CogNeedleFindAlgo.ArcAngleStart;
            _CogFindCircle.ExpectedCircularArc.AngleSpan  = _CogNeedleFindAlgo.ArcAngleSpan;

            kpTeachDisplay.DrawFindCircleCaliper(_CogFindCircle);
        }
Beispiel #2
0
        public void DrawFindCircleCaliper(CogFindCircle _CogFindCircle = null)
        {
            ICogRecord           _Record;
            CogGraphicCollection _Region;

            CircleCaliperTool.InputImage = (CogImage8Grey)kCogDisplay.Image;
            CircleCaliperTool.RunParams  = _CogFindCircle;

            _Record = CircleCaliperTool.CreateCurrentRecord();
            InteractiveCircularArc = (CogCircularArc)_Record.SubRecords["InputImage"].SubRecords["ExpectedShapeSegment"].Content;
            _Region = (CogGraphicCollection)_Record.SubRecords["InputImage"].SubRecords["CaliperRegions"].Content;

            kCogDisplay.InteractiveGraphics.Add(InteractiveCircularArc, "CircleArc", false);
            foreach (ICogGraphic _ICogGra in _Region)
            {
                kCogDisplay.InteractiveGraphics.Add((ICogGraphicInteractive)_ICogGra, "", false);
            }
            GC.Collect();
        }