Пример #1
0
 public FrmCali9PtPara(CaliParam CaliParaIn)
 {
     InitializeComponent();
     TeachCaliPara = CaliParaIn;
     MotionManager.Instance.SetCoordi(TeachCaliPara.coordi);
     view1 = DisplaySystem.GetViewControl("Cali");
     DisplaySystem.AddPanelForCCDView("Cali", panel1);
     this.LocalModelCbx.Items.Clear();
     foreach (LocalModelEnum temp in Enum.GetValues(typeof(LocalModelEnum)))
     {
         this.LocalModelCbx.Items.Add(temp);
     }
     LocalModelCbx.SelectedIndex = (int)TeachCaliPara.localPara.localSetting.localModel;
 }
Пример #2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try {
                if (e.RowIndex >= 0)
                {
                    switch (dataGridView1.Columns[e.ColumnIndex].Name)
                    {
                    case "ParaTeachBtn":
                        CaliParam   NowCaliPara = CaliParaManager.Instance.CaliParaList[e.RowIndex];
                        FrmCaliPara frmCali;
                        switch (NowCaliPara.caliModel)
                        {
                        case CaliModelEnum.UpDnCamCali:
                            FrmUpDnCamCali frmCaliNow = new FrmUpDnCamCali(NowCaliPara);
                            frmCaliNow.ShowDialog();
                            if (frmCaliNow.IsSavePara)
                            {
                                CaliParaManager.Instance.CaliParaList[e.RowIndex] = frmCaliNow.GetTeachedCaliPara();
                            }
                            break;

                        case CaliModelEnum.HandEyeCali:
                            frmCali = new FrmCaliPara(NowCaliPara);
                            frmCali.ShowDialog();
                            if (frmCali.IsSavePara)
                            {
                                CaliParaManager.Instance.CaliParaList[e.RowIndex] = frmCali.GetTeachedCaliPara();
                            }
                            break;

                        case CaliModelEnum.Cali9PtCali:
                            FrmCali9PtPara frmCali1 = new FrmCali9PtPara(NowCaliPara);
                            frmCali1.ShowDialog();
                            if (frmCali1.IsSavePara)
                            {
                                CaliParaManager.Instance.CaliParaList[e.RowIndex] = frmCali1.GetTeachedCaliPara();
                            }
                            break;

                        default:
                            frmCali = new FrmCaliPara(NowCaliPara);
                            break;
                        }
                        break;
                    }
                }
            }
            catch
            { }
        }
Пример #3
0
        public static CaliParam Load(string Path)
        {
            string path = Path + ConfigName + @"\";

            try {
                CaliParam obj = XML <CaliParam> .Read(path + "CaliPara.xml");

                if (obj == null)
                {
                    return(obj = new CaliParam());
                }
                obj.localPara.Read(path);
                return(obj);
            }
            catch (Exception ex) {
                throw new LoadException(path, ex.Message);
            }
        }
Пример #4
0
        public bool Read()
        {
            bool IsOk = true;

            string[] paths = new string[0];
            CaliParaList = new BindingList <CaliParam>();
            DirectoryInfo myDirectory = new DirectoryInfo(ParaPath);

            if (!FileLib.DirectoryEx.Exist(ParaPath))
            {
                FileLib.DirectoryEx.Create(ParaPath);
            }
            DirectoryInfo[] Directs  = myDirectory.GetDirectories();
            CaliParam       caliPara = new CaliParam();

            foreach (DirectoryInfo item in Directs)
            {
                caliPara = CaliParam.Load(item.FullName);
                CaliParaList.Add(caliPara);
            }
            return(IsOk);
        }