public override void SaveParm(VisionSetpBase visionSetp)
        {
            if (visionSetp == null)
            {
                return;
            }
            m_visionShapMatch = (VisionShapMatch)visionSetp;

            m_visionShapMatch.visionShapParam.AngleStart      = textBox_StartAngle.Text.ToDouble();
            m_visionShapMatch.visionShapParam.AngleExtent     = textBox_AngleExtent.Text.ToDouble();
            m_visionShapMatch.visionShapParam.MinColScale     = textBox_ScaleColMin.Text.ToDouble();
            m_visionShapMatch.visionShapParam.MaxColScale     = textBox_ScaleColMax.Text.ToDouble();
            m_visionShapMatch.visionShapParam.nNum            = textBox_MatchNum.Text.ToInt();
            m_visionShapMatch.visionShapParam.dSorce          = textBox_MatchScore.Text.ToDouble();
            m_visionShapMatch.visionShapParam.MaxOverlap      = textBox_OverLapArea.Text.ToDouble();
            m_visionShapMatch.visionShapParam.ContrastHigh    = textBox_ContrastHigh.Text.ToDouble();
            m_visionShapMatch.visionShapParam.ContrastLow     = textBox_ContrastLow.Text.ToDouble();
            m_visionShapMatch.visionShapParam.MinSize         = textBox_MinSize.Text.ToDouble();
            m_visionShapMatch.visionShapParam.CratePyramid    = textBox_PyramidHierarchy.Text.ToInt();
            m_visionShapMatch.visionShapParam.MatchPyamidHigh = textBox_PyramidHierarchyHigh.Text.ToInt();
            m_visionShapMatch.visionShapParam.MatchPyamidLow  = textBox_PyramidHierarchyLow.Text.ToInt();
            m_visionShapMatch.visionShapParam.strPolaritySel  = comboSelPolarity.Text == null ? "use_polarity" : comboSelPolarity.Text;
            m_visionShapMatch.visionShapParam.ModeType        = (eModleType)Enum.Parse(typeof(eModleType), comBoSelMatch.Text);
            if (strPath == "")
            {
                m_visionShapMatch.Save();
            }
            else
            {
                m_visionShapMatch.Save(strPath);
            }
        }
示例#2
0
        public override void SaveParm(VisionSetpBase visionSetp)
        {
            if (visionSetp != null)
            {
                FitCircircle.visionFitCircleParam.startAngledeg = textBox_TestStartAngle.Text.ToDouble();
                FitCircircle.visionFitCircleParam.endAngleDeg   = textBox_TestEndAngle.Text.ToDouble();
                FitCircircle.visionFitCircleParam.nTestNum      = textBox_TestNum.Text.ToInt();
                FitCircircle.visionFitCircleParam.thresoldVal   = textBox_TestThreasoldVal.Text.ToDouble();
                FitCircircle.visionFitCircleParam.nLen1         = textBox_Len1.Text.ToInt();
                FitCircircle.visionFitCircleParam.nLen2         = textBox_Len2.Text.ToInt();
                FitCircircle.visionFitCircleParam.testDir       = (TestDir)Enum.Parse(typeof(TestDir), comboBox_TestDir.Text);
                FitCircircle.visionFitCircleParam.testPolarity  = (TestPolarity)Enum.Parse(typeof(TestPolarity), comboBox_TestPolarity.Text);
                FitCircircle.visionFitCircleParam.testPos       = (TestPos)Enum.Parse(typeof(TestPos), comboBox_TestPos.Text);

                FitCircircle = (VisionFitCircircle)visionSetp;

                if (strPath == "")
                {
                    FitCircircle.Save();
                }
                else
                {
                    FitCircircle.Save(strPath);
                }
            }
        }
 public override void FlushToDlg(VisionSetpBase visionSetp, VisionControl visionControl, Control Farther = null)
 {
     if (visionSetp == null)
     {
         return;
     }
     //if (Farther != null)
     //    this.Location = new Point(Farther.Location.X, Farther.Location.Y);
     m_visionControl = visionControl;
     m_vision2dCode  = visionSetp as Vision2dCode;
     if (m_vision2dCode == null)
     {
         return;
     }
     m_vision2dCode = (Vision2dCode)visionSetp;
     if (m_vision2dCode == null)
     {
         MessageBox.Show("视觉类型为空 刷新失败,请选择", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (m_vision2dCode != null)
     {
         comboBox_CodeSystem.Text        = m_vision2dCode.vision2dCodeParam.Code2dSystem;
         comboBox_ContrastTolerance.Text = m_vision2dCode.vision2dCodeParam.ContrastTolerance;
     }
 }
示例#4
0
 public void Add(string strName, VisionSetpBase visionSetpBase)
 {
     if (dicVision.ContainsKey(strName))
     {
         dicVision[strName] = visionSetpBase;
     }
     else
     {
         dicVision.Add(strName, visionSetpBase);
     }
 }
 public override void SaveParm(VisionSetpBase visionSetp)
 {
     //  m_vision1dCode.vision1dCodeParam.Code2dSystem = comboBox_CodeSystem.Text;
     //  m_vision1dCode.vision1dCodeParam.ContrastTolerance = comboBox_ContrastTolerance.Text;
     if (strPath == "")
     {
         m_vision1dCode?.Save();
     }
     else
     {
         m_vision1dCode?.Save(strPath);
     }
 }
 public override void SaveParm(VisionSetpBase visionSetp)
 {
     if (m_vision2dCode == null)
     {
         MessageBox.Show("视觉类型为空 保存失败,请选择", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     m_vision2dCode.vision2dCodeParam.Code2dSystem      = comboBox_CodeSystem.Text;
     m_vision2dCode.vision2dCodeParam.ContrastTolerance = comboBox_ContrastTolerance.Text;
     if (strPath == "")
     {
         m_vision2dCode.Save();
     }
     else
     {
         m_vision2dCode.Save(strPath);
     }
 }
        public override void FlushToDlg(VisionSetpBase visionSetp, VisionControl visionControl, Control Farther = null)
        {
            if (visionSetp == null)
            {
                return;
            }
            m_visionControl = visionControl;
            //if(Farther!=null)
            //   this.Location = new Point(Farther.Location.X, Farther.Location.Y);
            m_vision1dCode = visionSetp as Vision1dCode;
            if (m_vision1dCode == null)
            {
                return;
            }
            m_vision1dCode = (Vision1dCode)visionSetp;

            //  comboBox_CodeSystem.Text = m_vision1dCode.vision2dCodeParam.Code2dSystem;
            //  comboBox_ContrastTolerance.Text = m_vision1dCode.vision2dCodeParam.ContrastTolerance;
        }
        public override void FlushToDlg(VisionSetpBase visionSetp, VisionControl visionControl, Control Farther = null)
        {
            if (visionSetp == null)
            {
                return;
            }
            //if (Farther != null)
            //    this.Location = new Point(Farther.Location.X, Farther.Location.Y);
            m_visionShapMatch = visionSetp as VisionShapMatch;
            if (m_visionShapMatch == null)
            {
                return;
            }
            m_visionShapMatch = (VisionShapMatch)visionSetp;
            m_visionControl   = visionControl;
            if (Farther != null)
            {
                this.Location = new Point(Farther.Location.X, Farther.Location.Y);
            }

            textBox_StartAngle.Text  = m_visionShapMatch.visionShapParam.AngleStart.ToString();
            textBox_AngleExtent.Text = m_visionShapMatch.visionShapParam.AngleExtent.ToString();
            textBox_ScaleColMin.Text = m_visionShapMatch.visionShapParam.MinColScale.ToString();
            textBox_ScaleColMax.Text = m_visionShapMatch.visionShapParam.MaxColScale.ToString();

            textBox_MatchNum.Text             = m_visionShapMatch.visionShapParam.nNum.ToString();
            textBox_MatchScore.Text           = m_visionShapMatch.visionShapParam.dSorce.ToString();
            textBox_OverLapArea.Text          = m_visionShapMatch.visionShapParam.MaxOverlap.ToString();
            textBox_PyramidHierarchy.Text     = m_visionShapMatch.visionShapParam.CratePyramid.ToString();
            textBox_PyramidHierarchyHigh.Text = m_visionShapMatch.visionShapParam.MatchPyamidHigh.ToString();
            textBox_PyramidHierarchyLow.Text  = m_visionShapMatch.visionShapParam.MatchPyamidLow.ToString();

            textBox_ContrastHigh.Text       = m_visionShapMatch.visionShapParam.ContrastHigh.ToString();
            textBox_ContrastLow.Text        = m_visionShapMatch.visionShapParam.ContrastLow.ToString();
            textBox_MinSize.Text            = m_visionShapMatch.visionShapParam.MinSize.ToString();
            roundButton_SetOutPoint.Enabled = m_visionShapMatch.visionShapParam.bSetOutPoint;
            roundButton_SetOutPoint.Enabled = m_visionShapMatch.visionShapParam.bSetOutPoint;
            comboSelPolarity.Text           = m_visionShapMatch.visionShapParam.strPolaritySel;
            comBoSelMatch.Text = m_visionShapMatch.visionShapParam.ModeType.ToString();
            regionOut1.Flush(visionControl, m_visionShapMatch.shapeslist);
            this.Show();
        }
示例#9
0
 public override void FlushToDlg(VisionSetpBase visionSetp, VisionControl visionControl, Control Farther = null)
 {
     m_visionControl = visionControl;
     if (visionSetp != null)
     {
         FitCircircle = visionSetp as VisionFitCircircle;
         if (FitCircircle == null)
         {
             return;
         }
         FitCircircle = (VisionFitCircircle)visionSetp;
         textBox_TestStartAngle.Text   = FitCircircle.visionFitCircleParam.startAngledeg.ToString();
         textBox_TestEndAngle.Text     = FitCircircle.visionFitCircleParam.endAngleDeg.ToString();
         textBox_TestNum.Text          = FitCircircle.visionFitCircleParam.nTestNum.ToString();
         textBox_TestThreasoldVal.Text = FitCircircle.visionFitCircleParam.thresoldVal.ToString();
         textBox_Len1.Text             = FitCircircle.visionFitCircleParam.nLen1.ToString();
         textBox_Len2.Text             = FitCircircle.visionFitCircleParam.nLen2.ToString();
         comboBox_TestDir.Text         = FitCircircle.visionFitCircleParam.testDir.ToString();
         comboBox_TestPolarity.Text    = FitCircircle.visionFitCircleParam.testPolarity.ToString();
         comboBox_TestPos.Text         = FitCircircle.visionFitCircleParam.testPos.ToString();
     }
 }
示例#10
0
 public void Add(string strName, VisionSetpBase visionSetpBase, StepVisionInfo stepVisionInfo)
 {
     if (dicVisionType.ContainsKey(strName))
     {
         dicVisionType[strName] = stepVisionInfo;
     }
     else
     {
         dicVisionType.Add(strName, stepVisionInfo);
     }
     if (dicVision.ContainsKey(strName))
     {
         dicVision[strName] = visionSetpBase;
     }
     else
     {
         dicVision.Add(strName, visionSetpBase);
     }
     dicVision[strName].m_camparam = stepVisionInfo.CamParam;
     if (PrItemChangedEvent != null)
     {
         PrItemChangedEvent(strName);
     }
 }
示例#11
0
 public virtual void FlushToDlg(VisionSetpBase visionSetp, VisionControl visionControl, Control Farther = null)
 {
 }
示例#12
0
 public virtual void SaveParm(VisionSetpBase visionSetp)
 {
 }