Exemplo n.º 1
0
 /// <summary>
 /// 加载矫正数组
 /// </summary>
 public bool Load_Affinity_MatrixBySpecificfile(string File_Path)
 {
     AffinityCountOK = false;//清除 仿射矫正矩阵数据匹配标志
     //read file
     if (File.Exists(File_Path))
     {
         //获取矫正数据
         affinity_Matrices = new List <Affinity_Matrix>(Serialize_Data.Reserialize_Affinity_Matrix(File_Path));
         if (affinity_Matrices.Count != Program.SystemContainer.SysPara.Gts_Affinity_Col_X * Program.SystemContainer.SysPara.Gts_Affinity_Row_Y)
         {
             affinity_Matrices = new List <Affinity_Matrix>();
             LogInfo?.Invoke("Gts Affinity 矫正文件文件不匹配!!!,禁止加工,请检查!");
             return(false);
         }
         LogInfo?.Invoke("Gts Affinity 矫正文件加载成功!!!,数据数量:" + affinity_Matrices.Count);
         AffinityCountOK = true;//置位 仿射矫正矩阵数据匹配标志
         return(true);
     }
     else
     {
         affinity_Matrices = new List <Affinity_Matrix>();
         LogInfo?.Invoke("Gts Affinity 矫正文件文件不存在!!!,禁止加工,请检查!");
         return(false);
     }
 }
Exemplo n.º 2
0
        /// <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 矫正文件不存在,禁止加工,请检查!");
                }
            }
        }
Exemplo n.º 3
0
        /// <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 矫正文件文件不存在!!!,禁止加工,请检查!");
                }
            }
        }