Ejemplo n.º 1
0
 private void 切换模板ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //changeModelDlg.SendModelName = this.Receiver;
     if (changeModelDlg.ShowDialog() == DialogResult.OK)
     {
         PublicData.CheckModel = IniManager.ReadFromIni <CheckModel>(changeModelDlg.sChangeModelPath + "\\CheckModel.jason");
         if (PublicData.CheckModel == null)
         {
             PublicData.CheckModel = new CheckModel();
         }
         PublicData.CheckModel.ReadModel(changeModelDlg.sChangeModelPath);
         label2.Text = changeModelDlg.ModelName;
     }
 }
Ejemplo n.º 2
0
 private void Form1_Load(object sender, EventArgs e)
 {
     HOperatorSet.OpenWindow(0, 0, pictureBox1.Width, pictureBox1.Height, pictureBox1.Handle, "visible", "", out PublicData.WindowsHandle);
     HalconCommonFunc.SetPart(PublicData.WindowsHandle, 1920, 1200, pictureBox1.Width, pictureBox1.Height);
     PublicData.settingMessage = IniManager.ReadFromIni <SettingMessage>(Application.StartupPath + "\\Config" + "\\SettingMessage.Jason");
     HkCameraCltr.EnumDevices();
     PublicData.OpenCrame = PublicData.hkCameraCltr.OpenDevices(PublicData.settingMessage.CaremerName);
     if (0 == PublicData.OpenCrame)
     {
         MessageBox.Show("相机连接成功");
     }
     else
     {
         MessageBox.Show("相机连接失败");
     }
 }