public bool Load_Watt_Percent_Relate() { string File_Name = "Laser_Watt_Percent_Relate.csv"; string File_Path = @"./\Config/" + File_Name; if (File.Exists(File_Path)) { //获取矫正数据 if (CSV_RW.DataTable_Double_Fit_Data(CSV_RW.OpenCSV(File_Path)).Count >= 1) { Laser_Watt_Percent_Relate = new Double_Fit_Data(CSV_RW.DataTable_Double_Fit_Data(CSV_RW.OpenCSV(File_Path))[0]); Log.Info("Laser_Watt_Percent_Relate 矫正文件加载成功!!!"); return(true); } else { return(false); } } else { MessageBox.Show("Laser_Watt_Percent_Relate 矫正文件不存在!!!,禁止加工,请检查!"); Log.Info("Laser_Watt_Percent_Relate 矫正文件不存在!!!,禁止加工,请检查!"); return(false); } }
/// <summary> /// 加载相关矫正参数 /// </summary> public static void Load_Affinity_Matrix() { //file name string File_Name = ""; if (Para_List.Parameter.Rtc_Affinity_Type == 1) { File_Name = "Rtc_Affinity_Matrix_All.xml"; } else if (Para_List.Parameter.Rtc_Affinity_Type == 2) { File_Name = "Rtc_Line_Fit_Data.csv"; } else { File_Name = "Rtc_Affinity_Matrix_Three.xml"; } //file path string File_Path = @"./\Config/" + File_Name; //read file if (Para_List.Parameter.Rtc_Affinity_Type == 2) { if (File.Exists(File_Path)) { Fit_Matrices = new List <Double_Fit_Data>(CSV_RW.DataTable_Double_Fit_Data(CSV_RW.OpenCSV(File_Path))); Log.Info("Rtc 线性 矫正文件加载成功!!!,数据数量:" + Fit_Matrices.Count); } else { Fit_Matrices = new List <Double_Fit_Data>(); MessageBox.Show("Rtc 线性 矫正文件不存在,禁止加工,请检查!"); Log.Info("Rtc 线性 矫正文件不存在,禁止加工,请检查!"); } } else { if (File.Exists(File_Path)) { //获取矫正数据 if (Para_List.Parameter.Rtc_Affinity_Type == 1)//点阵匹配 { affinity_Matrices = new List <Affinity_Matrix>(Serialize_Data.Reserialize_Affinity_Matrix(File_Name)); Log.Info("Rtc Affinity_ALL 矫正文件加载成功!!!,数据数量:" + affinity_Matrices.Count); } else { affinity_Matrices = new List <Affinity_Matrix>(Serialize_Data.Reserialize_Affinity_Matrix(File_Name)); Log.Info("Rtc Affinity_Three 矫正文件加载成功!!!,数据数量:" + affinity_Matrices.Count); } } else { affinity_Matrices = new List <Affinity_Matrix>(); MessageBox.Show("Rtc Affinity_ALL/Affinity_Three 矫正文件不存在,禁止加工,请检查!"); Log.Info("Rtc Affinity_ALL/Affinity_Three 矫正文件不存在,禁止加工,请检查!"); } } }
/// <summary> /// 加载矫正数组 /// </summary> public static void Load_Affinity_Matrix() { string File_Name = ""; string File_Name1 = ""; string File_Name2 = ""; if (Para_List.Parameter.Gts_Affinity_Type == 1)//点阵匹配 { File_Name = "Gts_Affinity_Matrix_All.xml"; } else if (Para_List.Parameter.Gts_Affinity_Type == 2)//直线拟合 { File_Name1 = "Gts_Line_Fit_Data_AM.csv"; File_Name2 = "Gts_Line_Fit_Data_MA.csv"; } else { File_Name = "Gts_Affinity_Matrix_Three.xml"; } //file path string File_Path = @"./\Config/" + File_Name; string File_Path1 = @"./\Config/" + File_Name1; string File_Path2 = @"./\Config/" + File_Name2; //read file if (Para_List.Parameter.Gts_Affinity_Type == 2)//直线拟合 { if (File.Exists(File_Path1) && File.Exists(File_Path2)) { Fit_Matrices_AM = new List <Double_Fit_Data>(CSV_RW.DataTable_Double_Fit_Data(CSV_RW.OpenCSV(File_Path1))); Fit_Matrices_MA = new List <Double_Fit_Data>(CSV_RW.DataTable_Double_Fit_Data(CSV_RW.OpenCSV(File_Path2))); Log.Info("Gts AM 线性矫正文件加载成功!!!,数据数量:" + Fit_Matrices_AM.Count); Log.Info("Gts MA 线性矫正文件加载成功!!!,数据数量:" + Fit_Matrices_AM.Count); } else { Fit_Matrices_AM = new List <Double_Fit_Data>(); Fit_Matrices_MA = new List <Double_Fit_Data>(); MessageBox.Show("Gts AM/MA 线性矫正文件不存在,禁止加工,请检查!"); Log.Info("Gts AM/MA 线性矫正文件不存在,禁止加工,请检查!"); } } else { if (File.Exists(File_Path)) { //获取矫正数据 if (Para_List.Parameter.Gts_Affinity_Type == 1)//点阵匹配 { affinity_Matrices = new List <Affinity_Matrix>(Serialize_Data.Reserialize_Affinity_Matrix(File_Name)); Log.Info("Gts Affinity 矫正文件加载成功!!!,数据数量:" + affinity_Matrices.Count); } else { affinity_Matrices = new List <Affinity_Matrix>(Serialize_Data.Reserialize_Affinity_Matrix(File_Name)); Log.Info("Gts Affinity 矫正文件加载成功!!!,数据数量:" + affinity_Matrices.Count); } } else { affinity_Matrices = new List <Affinity_Matrix>(); MessageBox.Show("Gts Affinity 矫正文件文件不存在!!!,禁止加工,请检查!"); Log.Info("Gts Affinity 矫正文件文件不存在!!!,禁止加工,请检查!"); } } }