예제 #1
0
        /// <summary>
        /// 振镜桶形畸变图形加工
        /// </summary>
        private void Rtc_Barrel_Distortion_Figure_Sculpture()
        {
            if (((Int16)(Program.SystemContainer.SysPara.Rtc_Distortion_Data_Limit / Program.SystemContainer.SysPara.Rtc_Distortion_Data_Interval) % 2) != 0)
            {
                appendInfo(string.Format("振镜矫正范围除以打标间距:{0}不为偶数,禁止加工!!!", Program.SystemContainer.SysPara.Rtc_Distortion_Data_Limit / Program.SystemContainer.SysPara.Rtc_Distortion_Data_Interval));
                return;
            }
            else
            {
                int            ScissorIndex = 0;
                Tech_Parameter ScissorPara  = new Tech_Parameter();                                                                                                                                                                                                                                                    //刀具参数
                //待加工数据
                List <Section_Entity_Data> Mark_Datas = new List <Section_Entity_Data>(Calibration.Create_Rtc_Calibrate_Data(0, Program.SystemContainer.SysPara.Rtc_Distortion_Data_Radius, Program.SystemContainer.SysPara.Rtc_Distortion_Data_Interval, Program.SystemContainer.SysPara.Rtc_Distortion_Data_Limit)); //十个一组
                //启用刀具参数
                ScissorIndex = Program.SystemContainer.ScissorList.FindIndex(t => t.Scissors_Name == Program.SystemContainer.SysPara.Calibrate_Mark_Scissor);                                                                                                                                                          //获取刀具索引
                if (ScissorIndex == -1)                                                                                                                                                                                                                                                                                //不含此刀具
                {
                    MessageBox.Show(string.Format("刀具:{0},不存在加工终止!!", Program.SystemContainer.SysPara.Calibrate_Mark_Scissor));
                    return;                                                                          //未指定刀具
                }
                ScissorPara = new Tech_Parameter(Program.SystemContainer.ScissorList[ScissorIndex]); //提取刀具参数
                //按照刀具参数进行加工
                for (int i = 1; i < ScissorPara.RepeatTime + 1; i++)                                 //加工次数
                {
                    /*********************************************/
                    //加工前动作
                    //Z轴动作
                    if (i == 1)//初始Z轴高度
                    {
                        //定位到Z轴高度
                    }
                    //循序步进Z轴高度
                    if ((ScissorPara.FocusCompensationTimes > 0) && ((i % ScissorPara.FocusCompensationTimes) == 0))
                    {
                        //Z轴步进值
                    }
                    /*********************************************/
                    //加工中
                    foreach (var p in Mark_Datas)
                    {
                        //关闭激光
                        Program.SystemContainer.RTC_Fun.Close_Laser();
                        //平台定位
                        Program.SystemContainer.GTS_Fun.Gts_Ready_Correct(p.Centre);

                        //运行和暂停切换
                        if (on_off)
                        {
                            ma = new ManualResetEvent(false);
                            ma.WaitOne();
                        }
                        //退出循环
                        if (stop)
                        {
                            return;
                        }

                        //振镜加工轨迹推入
                        Program.SystemContainer.RTC_Fun.Draw_Mark(p, 1, 1);

                        //关闭激光
                        Program.SystemContainer.RTC_Fun.Close_Laser();
                    }
                    /*********************************************/
                    //加工结束
                    //延时操作
                    if ((ScissorPara.DelayCompensationTimes > 0) && ((i % ScissorPara.DelayCompensationTimes) == 0))
                    {
                        Thread.Sleep(ScissorPara.DelayCompensation);//延时
                    }
                }
            }
        }