/// <summary> /// 执行 未经任何矫正的数据,包括坐标系匹配,用于原始振镜坐标系输出,进行桶形矫正 /// </summary> /// <param name="Rtc_Datas"></param> /// <param name="List_No"></param> public static void Draw_Cal(List <Interpolation_Data> Rtc_Datas, UInt32 List_No) { // wait list List_No to be not busy // load_list( List_No, 0) returns 1 if successful, otherwise 0 // 执行到POS 0 do { }while (RTC5Wrap.load_list(List_No, 0u) == 0); // Transmit the following list commands to the list buffer. //RTC5Wrap.set_start_list(List_No); //初始Jump到启动点位 RTC5Wrap.jump_abs(Convert.ToInt32(Rtc_Datas[0].Rtc_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Rtc_Datas[0].Rtc_y * Para_List.Parameter.Rtc_Pos_Reference)); //生成数据 foreach (var o in Rtc_Datas) { if (o.Type == 11)//arc_abs 绝对圆弧 { RTC5Wrap.arc_abs(Convert.ToInt32(o.Center_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.Center_y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToDouble(o.Angle)); } else if (o.Type == 12)//arc_rel { RTC5Wrap.arc_rel(Convert.ToInt32(o.Center_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.Center_y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToDouble(o.Angle)); } else if (o.Type == 13)//jump_abs { RTC5Wrap.jump_abs(Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_y * Para_List.Parameter.Rtc_Pos_Reference)); } else if (o.Type == 14)//jump_rel { RTC5Wrap.jump_rel(Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_y * Para_List.Parameter.Rtc_Pos_Reference)); } else if (o.Type == 15)//mark_abs { RTC5Wrap.mark_abs(Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_y * Para_List.Parameter.Rtc_Pos_Reference)); } else if (o.Type == 16)//mark_rel { RTC5Wrap.mark_rel(Convert.ToInt32(o.End_x * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(o.End_y * Para_List.Parameter.Rtc_Pos_Reference)); } } //结束Jump到启动点位 //RTC5Wrap.jump_abs(0,0); //设置List结束位置 RTC5Wrap.set_end_of_list(); //启动执行 RTC5Wrap.execute_list(1u); //Busy 运行等待结束 uint Busy; do { RTC5Wrap.get_status(out Busy, out uint Position); } while (Busy != 0U); }
/// <summary> /// 执行Rtc坐标系矫正后的数据 /// </summary> /// <param name="Rtc_Datas"></param> /// <param name="List_No"></param> public static void Draw_Rtc_Correct_AFF(List <Interpolation_Data> Rtc_Datas, UInt32 List_No) { //定义处理的变量 Vector Tmp_Point = new Vector(); decimal Tmp_R0_X = 0.0m; decimal Tmp_R0_Y = 0.0m; decimal Tmp_End_X = 0.0m; decimal Tmp_End_Y = 0.0m; decimal Tmp_Center_X = 0.0m; decimal Tmp_Center_Y = 0.0m; #if !DEBUG // wait list List_No to be not busy // load_list( List_No, 0) returns 1 if successful, otherwise 0 //执行到POS 0 do { }while (RTC5Wrap.load_list(List_No, 0u) == 0); // Transmit the following list commands to the list buffer. RTC5Wrap.set_start_list(List_No); #endif Tmp_Point = new Vector(Rtc_Cal_Data_Resolve.Correct_Rtc_Axes(Rtc_Datas[0].Rtc_x, Rtc_Datas[0].Rtc_y)); Tmp_R0_X = Tmp_Point.X; Tmp_R0_Y = Tmp_Point.Y; #if !DEBUG //初始Jump到启动点位 RTC5Wrap.jump_abs(Convert.ToInt32(-Tmp_R0_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_R0_X * Para_List.Parameter.Rtc_Pos_Reference)); #endif //生成数据 foreach (var o in Rtc_Datas) { Tmp_Point = new Vector(Rtc_Cal_Data_Resolve.Correct_Rtc_Axes(o.End_x, o.End_y)); Tmp_End_X = Tmp_Point.X; Tmp_End_Y = Tmp_Point.Y; Tmp_Point = new Vector(Rtc_Cal_Data_Resolve.Correct_Rtc_Axes(o.Center_x, o.Center_y)); Tmp_Center_X = Tmp_Point.X; Tmp_Center_Y = Tmp_Point.Y; #if !DEBUG if (o.Type == 11)//arc_abs 绝对圆弧 { RTC5Wrap.arc_abs(Convert.ToInt32(-Tmp_Center_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_Center_X * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToDouble(o.Angle)); } else if (o.Type == 12)//arc_rel { RTC5Wrap.arc_rel(Convert.ToInt32(-Tmp_Center_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_Center_X * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToDouble(o.Angle)); } else if (o.Type == 13)//jump_abs { RTC5Wrap.jump_abs(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference)); } else if (o.Type == 14)//jump_rel { RTC5Wrap.jump_rel(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference)); } else if (o.Type == 15)//mark_abs { RTC5Wrap.mark_abs(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference)); } else if (o.Type == 16)//mark_rel { RTC5Wrap.mark_rel(Convert.ToInt32(-Tmp_End_Y * Para_List.Parameter.Rtc_Pos_Reference), Convert.ToInt32(Tmp_End_X * Para_List.Parameter.Rtc_Pos_Reference)); } #endif } #if !DEBUG //结束Jump到启动点位 //RTC5Wrap.jump_abs(0, 0); //设置List结束位置 RTC5Wrap.set_end_of_list(); //启动执行 RTC5Wrap.execute_list(1u); //Busy 运行等待结束 uint Busy; do { RTC5Wrap.get_status(out Busy, out uint Position); } while (Busy != 0U); #endif }