예제 #1
0
파일: FrmCali9PtPara.cs 프로젝트: Gz1d/Gz
        private void LocalParaTeachBtn_Click(object sender, EventArgs e)
        {
            TeachCaliPara.localPara.localSetting.localModel = (LocalModelEnum)LocalModelCbx.SelectedIndex;
            FrmLocalParaTeach FrmLocal = new FrmLocalParaTeach(TeachCaliPara.localPara);

            FrmLocal.ShowDialog();
            if (FrmLocal.IsSaveVisionPara)
            {
                TeachCaliPara.localPara = FrmLocal.GetTeachLocalPara();
            }
        }
예제 #2
0
 private void VisionLocalParaDgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex < 0)
     {
         return;
     }
     if (!(e.RowIndex < TeachProjectPara.VisionParas.Count()))
     {
         return;
     }
     if (e.ColumnIndex == 1)//光源参数示教;
     {
         FrmCamLightCtrl frmCamLightDlg = new FrmCamLightCtrl(TeachProjectPara.VisionParas[e.RowIndex].camLightPara);
         frmCamLightDlg.ShowDialog();
         TeachProjectPara.VisionParas[e.RowIndex].camLightPara = frmCamLightDlg.GetTeachPara();
     }
     if (e.ColumnIndex == 2) //视觉枚举,用来表述工程第几组视觉参数,
     {
         TeachProjectPara.VisionParas[e.RowIndex].ProjectVisionItem
             = (ProjectVisionEnum)VisionLocalParaDgv.Rows[e.RowIndex].Cells[2].Value;
     }
     if (e.ColumnIndex == 3) //标定矩阵示教
     {
         TeachProjectPara.VisionParas[e.RowIndex].localPara.localSetting.CoordiCam
             = (CoordiCamHandEyeMatEnum)VisionLocalParaDgv.Rows[e.RowIndex].Cells[3].Value;
     }
     if (e.ColumnIndex == 4)  //定位模式示教
     {
         TeachProjectPara.VisionParas[e.RowIndex].localPara.localSetting.localModel
             = (LocalModelEnum)VisionLocalParaDgv.Rows[e.RowIndex].Cells[4].Value;
     }
     if (e.ColumnIndex == 5) //视觉参数示教
     {
         //将视觉参数传给视觉示教界面,
         TeachProjectPara.VisionParas[e.RowIndex].localPara.localSetting.localModel
             = (LocalModelEnum)VisionLocalParaDgv.Rows[e.RowIndex].Cells[4].Value;
         FrmLocalParaTeach FrmLocal = new FrmLocalParaTeach(TeachProjectPara.VisionParas[e.RowIndex].localPara);
         FrmLocal.ShowDialog();
         if (FrmLocal.IsSaveVisionPara)
         {
             TeachProjectPara.VisionParas[e.RowIndex].localPara = FrmLocal.GetTeachLocalPara();
         }
     }
     if (e.ColumnIndex == 6) //定位参数保存;
     {
         TeachProjectPara.VisionParas[e.RowIndex].ProjectVisionItem
             = (ProjectVisionEnum)VisionLocalParaDgv.Rows[e.RowIndex].Cells[2].Value;
         TeachProjectPara.VisionParas[e.RowIndex].localPara.localSetting.CoordiCam
             = (CoordiCamHandEyeMatEnum)VisionLocalParaDgv.Rows[e.RowIndex].Cells[3].Value;
         TeachProjectPara.VisionParas[e.RowIndex].localPara.localSetting.localModel
             = (LocalModelEnum)VisionLocalParaDgv.Rows[e.RowIndex].Cells[4].Value;
         TeachProjectPara.VisionParas[e.RowIndex].ProjectVisionName = VisionLocalParaDgv.Rows[e.RowIndex].Cells[8].Value.ToString();
     }
     if (e.ColumnIndex == 7) //删除当前组的视觉参数;
     {
         TeachProjectPara.VisionParas.RemoveAt(e.RowIndex);
         TeachProjectPara.ProjectVisionNames.RemoveAt(e.RowIndex);
     }
     if (e.ColumnIndex == 8)//保存描述参数
     {
         return;
     }
     UpDataVisionLocalParaDgv();
 }