Beispiel #1
0
        private void ItemAdd_Load(object sender, EventArgs e)
        {
            comboBox_SelVisionProcessType.Items.Clear();
            List <Type> TypeList = AssemblyOperate.GetAllSubClassTypeOnRunDir(typeof(VisionSetpBase));

            foreach (var temp in TypeList)
            {
                string DescriptionName = AssemblyOperate.GetDescription(temp);
                if (DescriptionName != "NoDescription")
                {
                    comboBox_SelVisionProcessType.Items.Add(DescriptionName);
                    comboBox_SelVisionProcessType.SelectedIndex = 0;
                }
            }
        }
        private void Form_CameraDebug_Load(object sender, EventArgs e)
        {
            visionControl1.InitWindow();
            HOperatorSet.SetDraw(visionControl1.GetHalconWindow(), "margin");

            Thread.Sleep(10);
            List <string> camname = CameraMgr.GetInstance().GetCameraNameArr();

            foreach (var temp in camname)
            {
                this.Sel.Items.Add(temp.ToString());
                comboBox_SelCam.Items.Add(temp.ToString());
                CameraMgr.GetInstance().ClaerPr(temp.ToString());
            }
            if (camname.Count > 0)
            {
                comboBox_SelCam.SelectedIndex = 0;
            }
            DataGridViewComboBoxColumn sd = (DataGridViewComboBoxColumn)dataGridViewProcessItem.Columns[2];

            sd.Items.Clear();

            TypeLists = AssemblyOperate.GetAllSubClassTypeOnRunDir(typeof(VisionSetpBase));
            foreach (var temp in TypeLists)
            {
                string DescriptionName = AssemblyOperate.GetDescription(temp);
                if (DescriptionName != "NoDescription")
                {
                    sd.Items.Add(DescriptionName);
                }
            }
            dataGridViewProcessItem.Columns[1].ReadOnly = true;
            dataGridViewProcessItem.Columns[2].ReadOnly = true;
            dataGridViewProcessItem.Columns[3].ReadOnly = true;
            textBox_exposureTimeVal.Text = CameraMgr.GetInstance().GetCamExposure(comboBox_SelCam.Text).ToString();
            textBox_GainVal.Text         = CameraMgr.GetInstance().GetCamGain(comboBox_SelCam.Text).ToString();
            CameraMgr.GetInstance().BindWindow(comboBox_SelCam.Text, visionControl1);
            CameraMgr.GetInstance().SetAcquisitionMode(comboBox_SelCam.Text);
            UpdataVisionItems();
            ParamSetMgr.GetInstance().m_eventLoadProductFileUpadata += UpdataVisionItems;
        }