فهرست منبع

合并dev提交

zhangjiaxin 3 سال پیش
والد
کامیت
0037692dbf

+ 1 - 1
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -522,7 +522,7 @@ namespace OTSIncAReportGrids
                 dgV_ParticlesDevidePage.Columns.Add(ElementTypeSort[i], ElementTypeSort[i]);
             }
 
-            RecordCount = fielddata.GetAllInfo(condition).Rows.Count;
+            RecordCount = fielddata.GetParticleAll(condition).Rows.Count;
 
             double jd = 95f / (double)particles.Rows.Count;//计算进度刻度
 

+ 80 - 267
OTSIncAReportApp/1-UI/frmReportConditionChoose.cs

@@ -4,6 +4,7 @@ using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
 using OTSIncAReportGB;
 using OTSIncAReportGrids;
+using OTSModelSharp.ResourceManage;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -187,6 +188,49 @@ namespace OTSIncAReportApp
             }
             return true;
         }
+
+
+        private ConditionItem NewGridData(int tbindex, OTS_REPORT_PROP_GRID_ITEMS iItemId, int number, OTS_ITEM_TYPES iItemValType, bool bReadOnly, object itemVal, List<string> comboDownList)
+        {
+            string text = "";
+            string des = "";
+            string downlist = "";
+            OTSDataType.XmlResourceData.GetInstance().GetStringByKey(tbindex, number, ref text, ref des, ref downlist);
+            ConditionItem sampleData = new ConditionItem();
+            sampleData.iItemId = iItemId;
+            sampleData.sSCaptionName = text;
+            sampleData.iItemValType = iItemValType;
+            sampleData.bReadOnly = bReadOnly;
+            sampleData.sDescriptionInfo = des;
+
+            if (comboDownList.Count == 0)
+            {
+                List<string> liststr = new List<string>();
+                if (downlist != "")
+                {
+                    string[] arrTemp = downlist.Split(',');
+                    for (int i = 0; i < arrTemp.Count(); i++)
+                    {
+                        liststr.Add(arrTemp[i]);
+                    }
+                    sampleData.itemVal = liststr[0];
+                    sampleData.comboDownList = liststr;
+                }
+                else
+                {
+                    sampleData.itemVal = "0";
+                    sampleData.comboDownList = liststr;
+                }
+            }
+            else
+            {
+                sampleData.itemVal = itemVal;
+                sampleData.comboDownList = comboDownList;
+            }
+
+            return sampleData;
+        }
+
         /// <summary>
         /// 初始化加载sourceGrid各项
         /// </summary>
@@ -198,300 +242,69 @@ namespace OTSIncAReportApp
             if (tbindex == DisplayPicutureType.AnalyzeImg)//分布图页
             {
                 //测量结果数据
-                List<string> list_source_str =m_DataMgr. GetSampleListName();
-                string sSCaptionName1 = table["sscaptionname1"].ToString();
-                ConditionItem sampleData = new ConditionItem();
-                sampleData.iItemId = 0;
-                sampleData.sSCaptionName = sSCaptionName1;
-                sampleData.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData.bReadOnly = false;
-                sampleData.sDescriptionInfo = "Select Measurement Result";
-                sampleData.itemVal = list_source_str[m_DataMgr. WorkingResult];
-                sampleData.comboDownList = list_source_str;
-                list.Add(sampleData);
-                string sSCaptionName2 = table["sscaptionname2"].ToString();
-                string sSCaptionName13 = table["sscaptionname13"].ToString();
-                ConditionItem sampleData1 = new ConditionItem();
-                sampleData1.iItemId = OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE;
-                sampleData1.sSCaptionName = sSCaptionName2;//测量图类型
-                sampleData1.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData1.bReadOnly = false;
-                sampleData1.sDescriptionInfo = "Survey Chart Type";
-                sampleData1.itemVal = "BSE";
-                sampleData1.comboDownList = new List<string>() { "BSE", sSCaptionName13, "Original", "原图颗粒分布" };//bse,颗粒分类图
-                list.Add(sampleData1);
-
-                //测量图类型
-                List<string> list_datasourcetypelist =m_DataMgr. GetDataSourceTypeList();
-                string sSCaptionName3 = table["sscaptionname3"].ToString();
-                string sscaptionname14 = table["sscaptionname14"].ToString();
-                string sscaptionname15 = table["sscaptionname15"].ToString();
-                List<string> list1 = new List<string>() { sscaptionname14, sscaptionname15 };
-                ConditionItem sampleData2 = new ConditionItem();
-                sampleData2.iItemId = OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE;
-                sampleData2.sSCaptionName = sSCaptionName3;
-                sampleData2.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData2.bReadOnly = false;
-                sampleData2.sDescriptionInfo = "chart display mode";
-                sampleData2.itemVal = list1[0];
-                sampleData2.comboDownList = list1;
-                list.Add(sampleData2);
-
+                List<string> list_source_str = m_DataMgr.GetSampleListName();
+                list.Add(NewGridData((int)tbindex, 0, ResourceID.Measurement_Result_Data_0, OTS_ITEM_TYPES.COMBO, false, list_source_str[m_DataMgr.WorkingResult], list_source_str));
+                //测量图类型  bse,颗粒分类图
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE, ResourceID.Type_Of_Survey_Drawing_0, OTS_ITEM_TYPES.COMBO, false, "", new List<string>() { }));
                 //测量图显示方式
-                string sSCaptionName4 = table["sscaptionname4"].ToString();
-                string sscaptionname16 = table["sscaptionname16"].ToString();
-                string sscaptionname17 = table["sscaptionname17"].ToString();
-                List<string> list2 = new List<string>() { sscaptionname16, sscaptionname17 };
-                ConditionItem sampleData3 = new ConditionItem();
-                sampleData3.iItemId = OTS_REPORT_PROP_GRID_ITEMS.PARTICLE_TYPE;
-                sampleData3.sSCaptionName = sSCaptionName4;
-                sampleData3.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData3.bReadOnly = false;
-                sampleData3.sDescriptionInfo = "Particle Type";
-                sampleData3.itemVal = list2[0];
-                sampleData3.comboDownList = list2;
-                list.Add(sampleData3);
-
-
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE, ResourceID.Display_mode_Of_Measurement_Diagram_0, OTS_ITEM_TYPES.COMBO, false, "", new List<string>() { }));
+                //颗粒类型
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.PARTICLE_TYPE, ResourceID.Particle_Type_0, OTS_ITEM_TYPES.COMBO, false, "", new List<string>() { }));
                 //粒级表
-                string sSCaptionName_partsizefile = "粒级表";
-                List<string> list_partsizelist =m_DataMgr. GetPartSizeFileList();//从系统默认的路径中查找出所有的粒级表文件
-                ConditionItem sampleData_partsizefile = new ConditionItem();
-                sampleData_partsizefile.iItemId = OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE;
-                sampleData_partsizefile.sSCaptionName = sSCaptionName_partsizefile;
-                sampleData_partsizefile.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData_partsizefile.bReadOnly = false;
-                sampleData_partsizefile.sDescriptionInfo = "Particle Table";
-                sampleData_partsizefile.itemVal = list_partsizelist[0];
-                sampleData_partsizefile.comboDownList = list_partsizelist;
-                list.Add(sampleData_partsizefile);
-
+                List<string> list_partsizelist = m_DataMgr.GetPartSizeFileList();//从系统默认的路径中查找出所有的粒级表文件
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE, ResourceID.Particle_Size_Table_0, OTS_ITEM_TYPES.COMBO, false, list_partsizelist[0], list_partsizelist));
                 //粒级
-                string sscaptionname18 = table["sscaptionname18"].ToString();
-                ConditionItem sampleData4 = new ConditionItem();
-                List<string> sizeList = new List<string>();
-                sizeList =m_DataMgr. GetPartSizeList();//获取粒级后额外增加全部,自定义,选项
-                sizeList.Insert(0, sscaptionname16);//全部
-                sizeList.Insert(1, sscaptionname18);//自定义
-
-                string sSCaptionName5 = table["sscaptionname5"].ToString();
-                sampleData4.iItemId = OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS;
-                sampleData4.sSCaptionName = sSCaptionName5;
-                sampleData4.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData4.bReadOnly = false;
-                sampleData4.sDescriptionInfo = "Grain Size";
-                sampleData4.itemVal = sscaptionname16;
-                sampleData4.comboDownList = sizeList;
-                list.Add(sampleData4);
-
+                List<string> sizeList = m_DataMgr.GetPartSizeList();//获取粒级后额外增加全部,自定义,选项
+                sizeList.Insert(0, OTSDataType.XmlResourceData.GetInstance().GetStringByKey((int)tbindex, ResourceID.All_0));//全部
+                sizeList.Insert(1, OTSDataType.XmlResourceData.GetInstance().GetStringByKey((int)tbindex, ResourceID.custom_0));//自定义
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS, ResourceID.Particle_Size_0, OTS_ITEM_TYPES.COMBO, false, sizeList[0], sizeList));
                 //自定义最小
-                string sSCaptionName6 = table["sscaptionname6"].ToString();
-                ConditionItem sampleData41 = new ConditionItem();
-                sampleData41.iItemId = OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN;
-                sampleData41.sSCaptionName = sSCaptionName6;
-                sampleData41.iItemValType = OTS_ITEM_TYPES.DOUBLE;
-                sampleData41.bReadOnly = false;
-                sampleData41.sDescriptionInfo = "Smallest Particle";
-                sampleData41.itemVal = "0";
-                list.Add(sampleData41);
-
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MIN, ResourceID.Minimum_Particle_0, OTS_ITEM_TYPES.DOUBLE, false, "0", new List<string> { }));
                 //自定义最大
-                string sSCaptionName7 = table["sscaptionname7"].ToString();
-                ConditionItem sampleData42 = new ConditionItem();
-                sampleData42.iItemId = OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MAX;
-                sampleData42.sSCaptionName = sSCaptionName7;
-                sampleData42.iItemValType = OTS_ITEM_TYPES.DOUBLE;
-                sampleData42.bReadOnly = false;
-                sampleData42.sDescriptionInfo = "Maximum Particle";
-                sampleData42.itemVal = "0";
-                list.Add(sampleData42);
-
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_MAX, ResourceID.Maximum_Particle_0, OTS_ITEM_TYPES.DOUBLE, false, "0", new List<string> { }));
                 //测量数据
-                string sSCaptionName22 = table["sscaptionname22"].ToString();
-                string sSCaptionName19 = table["sscaptionname19"].ToString();
-                string sSCaptionName20 = table["sscaptionname20"].ToString();
-                string sSCaptionName21 = table["sscaptionname21"].ToString();
-                List<string> list3 = new List<string>() { sSCaptionName19, sSCaptionName20, sSCaptionName21 };
-                ConditionItem sampleData6 = new ConditionItem();
-                sampleData6.iItemId = OTS_REPORT_PROP_GRID_ITEMS.MEASURE_DATA_TYPE;
-                sampleData6.sSCaptionName = sSCaptionName22;
-                sampleData6.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData6.bReadOnly = false;
-                sampleData6.sDescriptionInfo = "Measured Data";
-                sampleData6.itemVal = list3[0];
-                sampleData6.comboDownList = list3;
-                list.Add(sampleData6);
-
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.MEASURE_DATA_TYPE, ResourceID.measured_Data_0, OTS_ITEM_TYPES.COMBO, false, "", new List<string> { }));
                 //计算方式
-                string sSCaptionName8 = table["sscaptionname8"].ToString();
-                ConditionItem sampleData5 = new ConditionItem();
-                sampleData5.iItemId = OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE;
-                sampleData5.sSCaptionName = sSCaptionName8;
-                sampleData5.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData5.bReadOnly = false;
-                sampleData5.sDescriptionInfo = "Dimension calculation method";
-                sampleData5.itemVal = "DMAX";
-                sampleData5.comboDownList =m_DataMgr. GetSizeCalMethodTypeList();
-                list.Add(sampleData5);
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, ResourceID.Dimension_Calculation_Method_0, OTS_ITEM_TYPES.COMBO, false, m_DataMgr.GetSizeCalMethodTypeList()[0], m_DataMgr.GetSizeCalMethodTypeList()));
             }
             else if (tbindex == DisplayPicutureType.AnalyzeDataTable)//Grid表格页
             {
                 //测量结果数据
-                List<string> list_source_str =m_DataMgr. GetSampleListName();
-                string sSCaptionName1 = table["sscaptionname1"].ToString();
-                ConditionItem sampleData = new ConditionItem();
-                sampleData.iItemId = 0;
-                sampleData.sSCaptionName = sSCaptionName1;
-                sampleData.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData.bReadOnly = false;
-                sampleData.sDescriptionInfo = "Select Measurement Result";
-                sampleData.itemVal = list_source_str[m_DataMgr. WorkingResult];
-                sampleData.comboDownList = list_source_str;
-                list.Add(sampleData);
-
+                List<string> list_source_str = m_DataMgr.GetSampleListName();
+                list.Add(NewGridData((int)tbindex, 0, ResourceID.Measurement_Result_Data_1, OTS_ITEM_TYPES.COMBO, false, list_source_str[m_DataMgr.WorkingResult], list_source_str));
                 //数据类型
-                List<string> list_datasourcetypelist =m_DataMgr. GetDataSourceTypeList();
-                string sSCaptionName9 = table["sscaptionname9"].ToString();
-                ConditionItem sampleData1 = new ConditionItem();
-                sampleData1.iItemId = OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE;
-                sampleData1.sSCaptionName = sSCaptionName9;
-                sampleData1.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData1.bReadOnly = false;
-                sampleData1.sDescriptionInfo = "Data Type";
-                sampleData1.itemVal = list_datasourcetypelist[0];
-                sampleData1.comboDownList = list_datasourcetypelist;
-                list.Add(sampleData1);
-
-                //数据表类型
-                string sSCaptionName10 = table["sscaptionname10"].ToString();
-                List<string> list2 = new List<string>() { table["sscaptionname25"].ToString(), table["sscaptionname26"].ToString(), table["sscaptionname27"].ToString(), table["sscaptionname28"].ToString(), table["sscaptionname29"].ToString(), table["sscaptionname30"].ToString() };
-                string[] aa = m_ReportApp.Text.Split('-');
-                List<string> listStd = new List<string>() { "国标一", "国标二", "美标", "德标" };
-                list2.AddRange(listStd);
-                ConditionItem sampleData3 = new ConditionItem();
-                sampleData3.iItemId = OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE;
-                sampleData3.sSCaptionName = sSCaptionName10;
-                sampleData3.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData3.bReadOnly = false;
-                sampleData3.sDescriptionInfo = "Data table type";
-                sampleData3.itemVal = list2[0];
-                sampleData3.comboDownList = list2;
-                list.Add(sampleData3);
-
+                List<string> list_datasourcetypelist = m_DataMgr.GetDataSourceTypeList();
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE, ResourceID.data_type_1, OTS_ITEM_TYPES.COMBO, false, list_datasourcetypelist[0], list_datasourcetypelist));
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE, ResourceID.Data_Table_Type_1, OTS_ITEM_TYPES.COMBO, false, "", new List<string> { }));
                 //粒级表
-                string sSCaptionName_partsizefile = "粒级表";
-                List<string> list_partsizelist =m_DataMgr. GetPartSizeFileList();//从系统默认的路径中查找出所有的粒级表文件
-                ConditionItem sampleData_partsizefile = new ConditionItem();
-                sampleData_partsizefile.iItemId = OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE;
-                sampleData_partsizefile.sSCaptionName = sSCaptionName_partsizefile;
-                sampleData_partsizefile.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData_partsizefile.bReadOnly = false;
-                sampleData_partsizefile.sDescriptionInfo = "Particle Table";
-                sampleData_partsizefile.itemVal = list_partsizelist[0];
-                sampleData_partsizefile.comboDownList = list_partsizelist;
-                list.Add(sampleData_partsizefile);
-
+                List<string> list_partsizelist = m_DataMgr.GetPartSizeFileList();//从系统默认的路径中查找出所有的粒级表文件
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE, ResourceID.Particle_Size_Table_1, OTS_ITEM_TYPES.COMBO, false, list_partsizelist[0], list_partsizelist));
                 //尺寸计算方法
-                string sSCaptionName8 = table["sscaptionname8"].ToString();
-                ConditionItem sampleData13 = new ConditionItem();
-                sampleData13.iItemId = OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE;
-                sampleData13.sSCaptionName = sSCaptionName8;
-                sampleData13.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData13.bReadOnly = false;
-                sampleData13.sDescriptionInfo = "Dimension Calculation Method";
-                sampleData13.itemVal = "DMAX";
-                sampleData13.comboDownList =m_DataMgr. GetSizeCalMethodTypeList();
-                list.Add(sampleData13);
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, ResourceID.Dimension_Calculation_Method_1, OTS_ITEM_TYPES.COMBO, false, m_DataMgr.GetSizeCalMethodTypeList()[0], m_DataMgr.GetSizeCalMethodTypeList()));
             }
             else if (tbindex == DisplayPicutureType.AnalyzeDataChart)//Chart图页
             {
                 //测量结果数据
-                List<string> list_source_str =m_DataMgr. GetSampleListName();
-                string sSCaptionName1 = table["sscaptionname1"].ToString();
-                ConditionItem sampleData = new ConditionItem();
-                sampleData.iItemId = 0;
-                sampleData.sSCaptionName = sSCaptionName1;
-                sampleData.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData.bReadOnly = false;
-                sampleData.sDescriptionInfo = "Select Measurement Result";
-                sampleData.itemVal = list_source_str[m_DataMgr. WorkingResult];
-                sampleData.comboDownList = list_source_str;
-                list.Add(sampleData);
-
+                List<string> list_source_str = m_DataMgr.GetSampleListName();
+                list.Add(NewGridData((int)tbindex, 0, ResourceID.Measurement_Result_Data_2, OTS_ITEM_TYPES.COMBO, false, list_source_str[m_DataMgr.WorkingResult], list_source_str));
                 //数据类型
-                List<string> list_datasourcetypelist =m_DataMgr. GetDataSourceTypeList();
-                string sSCaptionName9 = table["sscaptionname9"].ToString();
-                ConditionItem sampleData1 = new ConditionItem();
-                sampleData1.iItemId = OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE;
-                sampleData1.sSCaptionName = sSCaptionName9;
-                sampleData1.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData1.bReadOnly = false;
-                sampleData1.sDescriptionInfo = "Data Type";
-                sampleData1.itemVal = list_datasourcetypelist[0];
-                sampleData1.comboDownList = list_datasourcetypelist;
-                list.Add(sampleData1);
-
+                List<string> list_datasourcetypelist = m_DataMgr.GetDataSourceTypeList();
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE, ResourceID.data_type_2, OTS_ITEM_TYPES.COMBO, false, list_datasourcetypelist[0], list_datasourcetypelist));
                 //数据图类型
-                string sSCaptionName10 = table["sscaptionname10"].ToString();
-                List<string> list2 = new List<string>() { "常用夹杂物分类", table["sscaptionname27"].ToString(), table["sscaptionname28"].ToString(), table["sscaptionname29"].ToString(), table["sscaptionname12"].ToString() };
-                ConditionItem sampleData3 = new ConditionItem();
-                sampleData3.iItemId = OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE;
-                sampleData3.sSCaptionName = sSCaptionName10;
-                sampleData3.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData3.bReadOnly = false;
-                sampleData3.sDescriptionInfo = "Data graph type";
-                sampleData3.itemVal = list2[0];
-                sampleData3.comboDownList = list2;
-                list.Add(sampleData3);
-
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, ResourceID.Data_Table_Type_2, OTS_ITEM_TYPES.COMBO, false, "", new List<string> { }));
                 //三元相图模板
-                string sSCaptionName12 = table["sscaptionname12"].ToString();
-                ConditionItem sampleData15 = new ConditionItem();
-                List<string> trio_listname =m_DataMgr. GetTriTemplateNameList();
-                sampleData15.iItemId = OTS_REPORT_PROP_GRID_ITEMS.TRIO_CHART_TYPE;
-                sampleData15.sSCaptionName = sSCaptionName12;
-                sampleData15.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData15.bReadOnly = false;
-                sampleData15.sDescriptionInfo = "Ternary phase diagram";
-                sampleData15.itemVal = trio_listname.First();
-                sampleData15.comboDownList = trio_listname;
-                list.Add(sampleData15);
-
+                List<string> trio_listname = m_DataMgr.GetTriTemplateNameList();
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.TRIO_CHART_TYPE, ResourceID.Ternary_Phase_Diagram_2, OTS_ITEM_TYPES.COMBO, false, trio_listname.First(), trio_listname));
                 //粒级表
-                string sSCaptionName_partsizefile = "粒级表";
-                List<string> list_partsizelist =m_DataMgr. GetPartSizeFileList();
-                ConditionItem sampleData_partsizefile = new ConditionItem();
-                sampleData_partsizefile.iItemId = OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE;
-                sampleData_partsizefile.sSCaptionName = sSCaptionName_partsizefile;
-                sampleData_partsizefile.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData_partsizefile.bReadOnly = false;
-                sampleData_partsizefile.sDescriptionInfo = "Particle Table";
-                sampleData_partsizefile.itemVal = list_partsizelist[0];
-                sampleData_partsizefile.comboDownList = list_partsizelist;
-                list.Add(sampleData_partsizefile);
-
+                List<string> list_partsizelist = m_DataMgr.GetPartSizeFileList();
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE, ResourceID.Particle_Size_Table_2, OTS_ITEM_TYPES.COMBO, false, list_partsizelist[0], list_partsizelist));
                 //尺寸计算法
-                string sSCaptionName8 = table["sscaptionname8"].ToString();
-                ConditionItem sampleData13 = new ConditionItem();
-                sampleData13.iItemId = OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE;
-                sampleData13.sSCaptionName = sSCaptionName8;
-                sampleData13.iItemValType = OTS_ITEM_TYPES.COMBO;
-                sampleData13.bReadOnly = false;
-                sampleData13.sDescriptionInfo = "Dimension Calculation Method";
-                sampleData13.itemVal = "DMAX";
-                sampleData13.comboDownList =m_DataMgr. GetSizeCalMethodTypeList();
-                list.Add(sampleData13);
+                list.Add(NewGridData((int)tbindex, OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE, ResourceID.Dimension_Calculation_Method_2, OTS_ITEM_TYPES.COMBO, false, m_DataMgr.GetSizeCalMethodTypeList().First(), m_DataMgr.GetSizeCalMethodTypeList()));
             }
 
             return list;
         }
-        //public List<string> GetDataSourceTypeList()
-        //{
-        //    string sscaptionname23 = table["sscaptionname23"].ToString();
-        //    string sscaptionname24 = table["sscaptionname24"].ToString();
-        //    List<string> ret_list = new List<string>() { sscaptionname23, sscaptionname24 };
-        //    return ret_list;
-        //}
+        
 
 
         /// <summary>

+ 0 - 56
OTSIncAReportApp/2-CommonFunction/Baseobject.cs

@@ -1,56 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace OTSIncAReportGraph
-{
-    #region 基类,抽像类
-    /// <summary>
-    /// 绘制的基本类,下面的画布,多边形,线都要从这里派生
-    /// </summary>
-    public abstract class BaseObject : ICloneable
-    {
-        //自动生成的ID
-        public abstract Guid guid { get; set; }
-
-        //画布的坐标
-        public abstract RectangleF Rect { get; set; }
-
-        //OTS的坐标
-        public abstract PointF OTSPointF { get; set; }
-
-        //画布是否被选择
-        public abstract bool IsSelect { get; set; }
-
-        //画布是否被拖动
-        public abstract bool IsDragging { get; set; }
-
-        //画布被拖动到的位置
-        public abstract PointF DraggingPoint { get; set; }
-
-        //线的颜色
-        public abstract Color Color { get; set; }
-
-        //画布的背景色
-        public abstract Color BackColor { get; set; }
-
-        //绘制函数
-        public abstract void OnPaint(PaintEventArgs e);
-
-        //多边形路径
-        public abstract GraphicsPath GPath { get; set; }
-
-
-        //克隆
-        public virtual object Clone()
-        {
-            return null;
-        }
-    }
-    #endregion
-}

+ 0 - 126
OTSIncAReportApp/2-CommonFunction/ClassDiagram1.cd

@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ClassDiagram MajorVersion="1" MinorVersion="1">
-  <Class Name="OTSIncAReportApp.OTSDataMgrFunction.DataMgrFun">
-    <Position X="0.5" Y="3.25" Width="2.75" />
-    <TypeIdentifier>
-      <HashCode>QgEAgAAAAAAAAABAQAAAAAAAAABgACCAAAAAAgIAlAA=</HashCode>
-      <FileName>FunctionClass\OTSDataMgrFunction\DataMgrFun.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="m_ReportApp" />
-    </ShowAsAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmReportApp">
-    <Position X="4.5" Y="3.25" Width="3.75" />
-    <TypeIdentifier>
-      <HashCode>JyaZIk8FwCBcZMbKREDEqQXrFmZhhLCNnlAQgA4moAM=</HashCode>
-      <FileName>frmReportApp.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="SourceGridData" />
-      <Field Name="m_PropWindow" />
-      <Field Name="m_DataMgrFun" />
-      <Field Name="m_CChartsWindow" />
-      <Field Name="m_CTablesWindow" />
-      <Field Name="m_RstWindow" />
-    </ShowAsAssociation>
-    <ShowAsCollectionAssociation>
-      <Field Name="SelectedParticles" />
-    </ShowAsCollectionAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.DataOperation.Model.Particle" Collapsed="true">
-    <Position X="1.75" Y="8" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>ABQAAAAACACAAEAAAggEwAAAwSMAQBJgAACBY0YEIAQ=</HashCode>
-      <FileName>DataOperation\Model\Particle.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSSampleReportInfo.OTSSampleMeaInfo" Collapsed="true">
-    <Position X="9.5" Y="3.25" Width="1.75" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAAEAAAIAAAAAACAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
-      <FileName>FunctionClass\OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSDataMgrFunction.SampleGrid" Collapsed="true">
-    <Position X="9" Y="6.25" Width="2.75" />
-    <TypeIdentifier>
-      <HashCode>AAIAMgAEAAABAARMABAQAgCBFAAEAAgkIAJEAAmggAA=</HashCode>
-      <FileName>FunctionClass\OTSDisplaySGridData\SampleGrid.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="m_RstProp" />
-    </ShowAsAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSSampleReportInfo.CTreeSampleParam">
-    <Position X="9.25" Y="7.75" Width="2" />
-    <TypeIdentifier>
-      <HashCode>AAAAABAAIAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
-      <FileName>FunctionClass\OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsCollectionAssociation>
-      <Field Name="List_ShowGrid_Items" />
-    </ShowAsCollectionAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSSampleReportInfo.SampleData">
-    <Position X="17" Y="8.5" Width="2.5" />
-    <TypeIdentifier>
-      <HashCode>AAAAAEAAAAAEAAAAAEAAAAAAAEAIAAAAAAAAAAAAASA=</HashCode>
-      <FileName>FunctionClass\OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportGraph.Class.DrawFunction">
-    <Position X="13.25" Y="9.25" Width="2.5" />
-    <TypeIdentifier>
-      <HashCode>QAABAAAABAAAgAAgBQAACAAAAAAAACEAABBIAAAQAAA=</HashCode>
-      <FileName>FunctionClass\Common\DrawFunction.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportGraph.OTSIncAReportGraphFuncation.OTSIncAReportFun" Collapsed="true">
-    <Position X="10.75" Y="1" Width="3.25" />
-    <TypeIdentifier>
-      <HashCode>BQAAKMAAAAQAEAAAgAgACgACAgAQAMAwIAAAAAACIAA=</HashCode>
-      <FileName>Control_Graph\OTSIncAReportGraphFuncation\OTSIncAReportFun.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmMeasureRstProp" Collapsed="true">
-    <Position X="9.5" Y="4.5" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAACAAAAAAAQCAAAACAAAQACEABAAAAAACgAA=</HashCode>
-      <FileName>frmMeasureRstProp.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="m_SampleGrid" />
-      <Field Name="m_ReportApp" />
-    </ShowAsAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmCharts" Collapsed="true">
-    <Position X="5.5" Y="1.25" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAQACBAAABAAACAAAACAAAAACAAAAAAAAAAAAA=</HashCode>
-      <FileName>frmCharts.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmTables" Collapsed="true">
-    <Position X="7.25" Y="1.25" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAACAAAAAAAACAAAACAAAAACAAAAAAAAAABAA=</HashCode>
-      <FileName>frmTables.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmMeasureRstMgr" Collapsed="true">
-    <Position X="3.5" Y="1.25" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>ogAIQAEBACAAggVEACCBIAQKAKIIACIABkAAAAAkACI=</HashCode>
-      <FileName>frmMeasureRstMgr.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Enum Name="OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS" Collapsed="true">
-    <Position X="13.5" Y="7.75" Width="2.75" />
-    <TypeIdentifier>
-      <HashCode>AIAAAJQAkAAAAACCIEAAAAQAEAAAABABKAAEAAAAABA=</HashCode>
-      <FileName>FunctionClass\OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Enum>
-  <Font Name="Microsoft YaHei UI" Size="9" />
-</ClassDiagram>

+ 0 - 273
OTSIncAReportApp/2-CommonFunction/DisplayField.cs

@@ -1,273 +0,0 @@
-using OTSIncAReportApp.DataOperation.Model;
-using OTSIncAReportGraph.Class;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace OTSIncAReportGraph
-{
-    /// <summary>
-    /// 包含DParticle类的field类,目前只用于绘制背景色,按理说应该有更多的作用,比如做多线程分式运算
-    /// </summary>
-    public class DisplayField : BaseObject
-    {
-        Guid  m_id;
-        string m_tagid;
-        string m_fieldid;
-        bool m_IsDragging;
-        Color m_backcolor;
-        List<DisplayParticle> m_list_dparticle;
-
-        List<DisplayParticle> m_list_Useparticle;
-        PointF m_ots_point;  //按底层设计结构,底层返回的物理坐标位置及大小,OTS坐标大小
-        RectangleF m_pix_rect; //与底层返回物理坐标及位置大小对应转换成,pixel像素分率下的坐标位置大小
-        RectangleF m_show_rect;//最后换算到在显示器上显示的坐标位置大小
-        RectangleF m_current_rect;//当前field在显示器上显示的坐标位置大小
-        PointF m_dragingpoint;//鼠标拖动的位置
-        //private string m_GBContent;
-        private PointF m_OTSPointF;
-        private bool m_IsSelect;
-        private Color m_color;
-        private GraphicsPath m_GPath;
-
-        /// <summary>
-        /// 构造函数
-        /// </summary>
-        public DisplayField(Field fld, int fldwidth, int fldheight,Point screenPos)
-        {
-            m_list_dparticle = new List<DisplayParticle>();
-            m_list_Useparticle = new List<DisplayParticle>();
-            m_id = System.Guid.NewGuid();
-            Point thisfield_point = new Point() { X = fld.FieldPosX, Y = fld.FieldPosY };
-           
-            FieldID = fld.FieldID.ToString();
-            Show_Rect = new Rectangle(screenPos, new Size(fldwidth, fldheight));
-            Current_Rect = new Rectangle(screenPos, new Size(fldwidth, fldheight));
-            OTSCoordinatePos = new PointF(thisfield_point.X, thisfield_point.Y);
-            //先获取该Field中的所有Particle
-            List<Particle> list_particle;
-            list_particle = fld.ParticleList;
-
-            //然后将取出的数据,转换成Bitmap对象
-            Bitmap fieldbitmap = DrawFunction.ReadImageFile(fld.FieldImage);
-
-            //再循环计算所有的Particle对象
-            foreach (Particle particle in list_particle)
-            {
-
-
-                //创建DParticle颗粒
-                DisplayParticle dp = new DisplayParticle(particle);
-
-                List<Segment> list_seg;
-                list_seg = particle.SegmentList;
-
-                //创建颗粒分布图对应的类对象
-                List<DisplaySegment> list_dsegment = new List<DisplaySegment>();
-
-
-                //再循环取出里面所有的segment
-                foreach (Segment seg in list_seg)
-                {
-                    #region 创建DSegment对象,并将STD分析出的化合物颜色保存到DSegment对象中
-                    //对Particle里的Segment进行偏移的计算等,创建了DSegment的大小
-                    DisplaySegment ds = new DisplaySegment();
-                    ds.Rect = new Rectangle(seg.Start + screenPos.X,
-                       //i_field_height - ls_cotssegmentclr.GetHeight() + offset_point.Y,//这是让单个Field的图像按Y轴反过来
-                       seg.Height + screenPos.Y,
-                        seg.Length,
-                        1);
-
-
-                    ds.Color = dp.Color;//将线的颜色对应到颗粒的颜色
-                    #endregion
-
-                    #region //这里是在Field中,抠取出原BSE图像到DSegment中--------------------------------
-                    //ls_bt.RotateFlip(RotateFlipType.Rotate180FlipX);//使用系统带的图像处理方法,进行Y轴的翻转,与上面记录位置对应
-                    //合成图像完成,开始抠取像素-----------------------------------------------------------------
-                    int f_length = seg.Length;
-                    List<Color> ls_list_colors = new List<Color>();
-                    for (int m = 0; m < f_length; m++)
-                    {
-                        //这里实现一下代码保护
-                        int lsjs_x = seg.Start + m;
-                        //int lsjs_y = i_field_height - ls_cotssegmentclr.GetHeight();//这个反转要与上面对应
-                        int lsjs_y = seg.Height;
-                        //if (lsjs_x < 0)
-                        //    lsjs_x = 0;
-                        //if (lsjs_x >= fieldwidth)
-                        //    lsjs_x = fieldwidth - 1;
-                        //if (lsjs_y < 0)
-                        //    lsjs_y = 0;
-                        //if (lsjs_y >= fieldheight)
-                        //    lsjs_y = fieldheight - 1;
-
-                        //按理说这里应该加上个横向抠取像素颜色,这里需要再处理一下
-                        ls_list_colors.Add(fieldbitmap.GetPixel(lsjs_x,
-                           lsjs_y));
-                    }
-                    //保存原BSE图中的颜色列表
-                    ds.List_Colors = ls_list_colors;
-                    #endregion //------------------------------------------------------------------------------
-
-                    list_dsegment.Add(ds);
-
-                }
-
-                //设置Particle在0.5F倍数以上时才进行显示
-                //dp.Zoom_DisPlayThreshold = 0.5f;
-                //dp.Zoom_DisPlay = true;
-                dp.displayState = DisplayState.NORMALDISPLAY;
-
-                //将segment对应的设置到particle中
-                dp.DSegments = list_dsegment;
-
-                //并对DParticle相关信息进行计算
-                dp.Rect = dp.GetRectFromDSegment();
-                dp.GPath = dp.GetRegionFromDSegments();
-                dp.SmallRect = dp.GetSmallRectangleFromRect();
-
-                //将每个颗粒添加到颗粒分布图中的列表中
-                m_list_dparticle.Add(dp);
-                if (dp.XRayId > -1)
-                {
-                    m_list_Useparticle.Add(dp);
-                }
-
-            }
-
-
-
-
-
-        }
-
-        public DisplayField(List<DisplayParticle> in_list_dparticle)
-        {
-            m_list_dparticle = in_list_dparticle;
-        }
-
-
-
-        public override Guid guid { get => m_id; set => m_id = value; }
-
-        /// <summary>
-        /// 记录与底层对应的TagID
-        /// </summary>
-        public string TagID
-        {
-            get { return m_tagid; }
-            set { m_tagid = value; }
-        }
-        /// <summary>
-        /// 是否被拖动标识
-        /// </summary>
-
-
-        public override bool IsDragging { get => m_IsDragging; set => m_IsDragging = value; }
-
-        /// <summary>
-        /// 被拖动到的位置坐标
-        /// </summary>
-
-
-        public override PointF DraggingPoint { get => m_dragingpoint; set => m_dragingpoint = value; }
-
-        /// <summary>
-        /// 与底层对应的ID,这里叫成FieldID
-        /// </summary>
-        public string FieldID
-        {
-            get { return m_fieldid; }
-            set { m_fieldid = value; }
-        }
-
-        public override Color BackColor { get => m_backcolor; set => m_backcolor = value; }
-
-        /// <summary>
-        /// 包含的Particle列表
-        /// </summary>
-        public List<DisplayParticle> List_DParticle
-        {
-            get { return m_list_dparticle; }
-            set { m_list_dparticle = value; }
-        }
-        public List<DisplayParticle> List_Useparticle
-        {
-            get { return m_list_Useparticle; }
-            set { m_list_Useparticle = value; }
-        }
-        /// <summary>
-        /// 该Field的OTS坐标及大小
-        /// </summary>
-        public PointF OTSCoordinatePos
-        {
-            get { return m_ots_point; }
-            set { m_ots_point = value; }
-        }
-
-        /// <summary>
-        /// 该Field物理坐标大小转换出,对应的像素坐标及大小
-        /// </summary>
-        public RectangleF Pix_Rect
-        {
-            get { return m_pix_rect; }
-            set { m_pix_rect = value; }
-        }
-
-        /// <summary>
-        /// 该Field最后在屏幕上显示的坐标及大小
-        /// </summary>
-        public RectangleF Show_Rect
-        {
-            get { return m_show_rect; }
-            set { m_show_rect = value; }
-        }
-
-        /// <summary>
-        /// Field当前在屏幕上显示的坐标及大小
-        /// </summary>
-        public RectangleF Current_Rect
-        {
-            get { return m_current_rect; }
-            set { m_current_rect = value; }
-        }
-
-        public override RectangleF Rect { get => m_show_rect; set => m_show_rect = value; }
-        public override PointF OTSPointF { get => m_OTSPointF; set => m_OTSPointF = value; }
-        public override bool IsSelect { get => m_IsSelect; set => m_IsSelect = value; }
-        public override Color Color { get => m_color; set => m_color = value; }
-        public override GraphicsPath GPath { get => m_GPath; set => m_GPath = value; }
-
-        public override void OnPaint(PaintEventArgs e)
-        {
-
-            //开始向下传递并进行绘制
-            foreach (BaseObject item in m_list_dparticle)
-            {
-                DisplayParticle dp = (DisplayParticle)item;
-                if (dp.IsDeleted==false)
-                {
-                    if (dp.displayState == DisplayState.NORMALDISPLAY)
-                    {
-                        item.OnPaint(e);
-                    }
-                    //获取矩形的rectangle
-                    dp.Rect = dp.GetRectFromDSegment();
-
-                    //通过line获取路径边缘
-                    dp.GPath = dp.GetRegionFromDSegments();
-
-                    //重新计算小矩形边框
-                    dp.SmallRect = dp.GetSmallRectangleFromRect();
-
-                }
-            }
-        }
-    }
-}

+ 0 - 771
OTSIncAReportApp/2-CommonFunction/DisplayParticle.cs

@@ -1,771 +0,0 @@
-using OTSIncAReportApp.DataOperation.Model;
-using OTSIncAReportGraph.Class;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace OTSIncAReportGraph
-{
-    
-    /// <summary>
-    /// Particle对象上操作状态的枚举,显示,不显示,已删除,已选择
-    /// </summary>
-    public enum DisplayState
-    {
-        NORMALDISPLAY = 0,
-        NODISPLAY = 1,
-        CONCISEDISPLAY=2,// display as a "+"
- 
-       
-    }
-
-    /// <summary>
-    /// Particle对象上操作xray的枚举状态,显示xray数据,不显示
-    /// </summary>
-    public enum ParticleOperatorShowXray
-    {
-        SELECTANDDISPLAYXRAY = 0,
-        NODISPLAY = 1,
-    }
-
-    /// <summary>
-    /// Segment对象绘制的枚举,以点绘制,还是以线绘制
-    /// </summary>
-    public enum SegmentShowMode
-    {
-        DRAWPOINT = 0,
-        DRAWLINE = 1,
-    }
-
-    /// <summary>
-    /// 颗粒类
-    /// </summary>
-    public class DisplayParticle : BaseObject, ICloneable, IComparable<DisplayParticle>
-    {
-        private const float m_zoom_displaymultiplier = 0.5f;
-        public Particle objParticleData;
-        private Guid m_id;
-        private RectangleF m_rect;
-        private PointF m_OTSPointF;
-        private RectangleF m_small_rect;
-        private bool m_isSelected_smallrect;
-        private bool m_showSmallx;
-        private bool m_isSelected;
-        private bool m_isDeleted;
-        private bool m_isMouseOver;
-        private DisplayState m_displayState = DisplayState.NORMALDISPLAY;//显示,不显示,删除,选择,默认应为(不显示)
-        private ParticleOperatorShowXray m_operator_showxray = ParticleOperatorShowXray.NODISPLAY;//选定显示XRAY,不显示XRAY,默认应为(不显示XRAY)
-        private bool m_isdragging;
-        private PointF m_dragingpoint;
-        private Color m_color;
-        private Color m_backcolor;
-        private GraphicsPath m_gpath;
-        private List<DisplaySegment> m_listdsegment = new List<DisplaySegment>();
-
-
-        private string m_sort_type = "从大到小";
-        private float m_f_size = 0;
-        private string m_str_lj = "颗粒粒级";
-        private string m_str_klzl = "颗粒种类";
-        private string m_str_klfl = "颗粒分类";
-
- 
-
-        public int TypeId 
-        {
-            get
-            {
-               return objParticleData.TypeId;
-            }
-        }
-        //TypeName
-        public string TypeName 
-        {
-            get
-            {
-                return objParticleData.TypeName;
-            }
-        }
-        //XRayId
-        public int XRayId 
-        {
-            get
-            {
-                return objParticleData.XrayId;
-            }
-        }
-
-        public int SEMPosX 
-        {
-            get
-            {
-                return objParticleData.SEMPosX;
-            }
-        }
-        public int SEMPosY 
-        {
-            get
-            {
-                return objParticleData.SEMPosY;
-            }
-        }
-
-
-
-        public DisplayParticle()
-        {
-            m_id = System.Guid.NewGuid();
-        }
-
-        public DisplayParticle(Particle part)
-        {
-            m_id = System.Guid.NewGuid();
-            objParticleData = part;
-            this.Color = GetColorBySTDTypeIDForBSEAndSorImage(part.TypeColor, part.TypeId);
-        }
-
-        public DisplayParticle(List<DisplaySegment> in_list_segment, DisplayParticle in_particle)
-        {
-            // m_id = System.Guid.NewGuid().ToString();
-            objParticleData = in_particle.objParticleData;
-            m_id = in_particle.m_id;
-          
-            //m_zoom_displaymultiplier = in_particle.m_zoom_displaymultiplier;
-           
-            m_displayState = in_particle.m_displayState;
-            m_operator_showxray = in_particle.m_operator_showxray;
-           
-          
-
-            foreach (DisplaySegment e in in_list_segment)
-            {
-                m_listdsegment.Add(e.Clone() as DisplaySegment);
-            }
-        }
-
-        /// <summary>
-        /// [目前也不使用该方法了,因为该方法每次排序都有不同的结果]多边形排序,按传入的sort_type的排序类型行排序,但需要两个list做一致性排序
-        /// </summary>
-        /// <param name="in_ap"></param>
-        /// <returns></returns>
-        public int CompareTo(DisplayParticle in_particle)
-        {
-            int r_b = 0;//排序返回值
-            switch (m_sort_type)
-            {
-                case "从大到小":
-                    r_b = in_particle.m_f_size.CompareTo(this.m_f_size);
-                    break;
-
-                case "从小到大":
-                    //与上面的从大到小正好相反即可
-                    r_b = in_particle.m_f_size.CompareTo(this.m_f_size);
-                    if (r_b == 1)
-                        r_b = -1;
-                    else
-                        r_b = 1;
-                    break;
-                default:
-                    break;
-            }
-
-            return r_b;
-        }
-        public Color GetColorBySTDTypeIDForBSEAndSorImage(string in_partcolor, int in_stdtypeid)
-        {
-            Color ret_c = new Color();
-
-
-            if (in_stdtypeid < 1000)
-            {
-                //OTSSysSTDMgrClass osc = new OTSSysSTDMgrClass();
-                ////小于1000,使用系统默认分类
-                ret_c = GetColorByEnum(in_stdtypeid);
-            }
-            else if (in_stdtypeid >= 1000)
-            {
-                //大于等于1000,并且小于10000时,使用用户标准库来分析夹杂物名称
-                if (!in_partcolor.Contains("#"))
-                {
-                    ret_c = DrawFunction.colorHx16toRGB("#" + in_partcolor);//接收必须是#000000的格式
-                }
-                else
-                {
-                    ret_c = DrawFunction.colorHx16toRGB(in_partcolor);//接收必须是#000000的格式
-                }
-            }
-            return ret_c;
-        }
-        public Color GetColorByEnum(int STDID)
-        {
-            Color ret_c = new Color();
-            switch (STDID)
-            {
-                case -1:
-                    //INVALID = -1,
-                    //stdName = "无效颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 0:
-                    //small = 0;
-                    //stdName = "过小颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 1:
-                    //OVERSIZE = 1,
-                    //stdName = "过大颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 2:
-                    //AVE_GRAY_NOT_INRANRE = 2, 
-                    //stdName = "亮度不在分析范围内的颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 3:
-                    //SEARCH_X_RAY = 3,
-                    //stdName = "不进行搜索x-ray分析的颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 4:
-                    //LOW_COUNT = 4, 
-                    //stdName = "低x-ray计数颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 5:
-                    //NO_INTEREST_ELEMENTS = 5,
-                    //stdName = "不含分析元素的颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 6:
-                    //ALAYSIS_X_RAY = 6,
-                    //stdName = "不进行x-ray分析的颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 7:
-                    //NOT_IDENTIFIED = 7,
-                    //stdName = "未识别颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 8:
-                    //NOT_IDENTIFIED = 8,
-                    //stdName = "未识别颗粒";
-                    ret_c = Color.Black;
-                    break;
-                case 9:
-                    //NOT_IDENTIFIED = 9,
-                    //stdName = "未识别颗粒";
-                    ret_c = Color.Black;
-                    break;
-                default:
-                    ret_c = Color.Black;
-                    break;
-            }
-            return ret_c;
-        }
-
-        /// <summary>
-        /// 克隆方法
-        /// </summary>
-        /// <returns></returns>
-        public override object Clone()
-        {
-            return new DisplayParticle(this.m_listdsegment, this);
-        }
-
-        /// <summary>
-        /// ID
-        /// </summary>
-        public override Guid guid
-        {
-            get { return m_id; }
-            set { m_id = value; }
-        }
-
-        /// <summary>
-        /// 颗粒的外边框大小
-        /// </summary>
-        public override RectangleF Rect
-        {
-            get { return m_rect; }
-            set { m_rect = value; }
-        }
-
-        /// <summary>
-        /// OTSPointF
-        /// </summary>
-        public override PointF OTSPointF
-        {
-            get { return m_OTSPointF; }
-            set { m_OTSPointF = value; }
-        }
-
-        /// <summary>
-        /// 颗粒里+号位置的外边框大小
-        /// </summary>
-        public RectangleF SmallRect
-        {
-            get { return m_small_rect; }
-            set { m_small_rect = value; }
-        }
-
-        /// <summary>
-        /// 颗粒是否被选择
-        /// </summary>
-        public override bool IsSelect
-        {
-            get { return m_isSelected; }
-            set { m_isSelected = value; }
-        }
-
-        /// <summary>
-        /// 该颗粒是否被设置成,选中状态
-        /// </summary>
-        public DisplayState displayState
-        {
-            get { return m_displayState; }
-            set { m_displayState = value; }
-        }
-
-        /// <summary>
-        /// 是否对该颗粒选定显示X-Ray能谱图
-        /// </summary>
-        public ParticleOperatorShowXray Operator_ShowXRay
-        {
-            get { return m_operator_showxray; }
-            set { m_operator_showxray = value; }
-        }
-
-        /// <summary>
-        /// 鼠标是否在该矩形上
-        /// </summary>
-        //public bool IsMouseMove
-        //{
-        //    get { return m_IsMouseMove; }
-        //    set { m_IsMouseMove = value; }
-        //}
-
-        /// <summary>
-        /// 是否显示x号
-        /// </summary>
-        public bool IsShowSmallX
-        {
-            get { return m_showSmallx; }
-            set { m_showSmallx = value; }
-        }
-
-        /// <summary>
-        /// 颗粒的x-ray的点,是否被选择上了
-        /// </summary>
-        public bool IsSelectedSmallRect
-        {
-            get { return m_isSelected_smallrect; }
-            set { m_isSelected_smallrect = value; }
-        }
-
-        /// <summary>
-        /// 是否在被拖动
-        /// </summary>
-        public override bool IsDragging
-        {
-            get { return m_isdragging; }
-            set { m_isdragging = value; }
-        }
-
-        /// <summary>
-        /// 被拖动到的位置坐标
-        /// </summary>
-        public override PointF DraggingPoint
-        {
-            get { return m_dragingpoint; }
-            set { m_dragingpoint = value; }
-        }
-
-        /// <summary>
-        /// 线的颜色
-        /// </summary>
-        public override Color Color
-        {
-            get { return m_color; }
-            set { m_color = value; }
-        }
-
-        /// <summary>
-        /// 背景色
-        /// </summary>
-        public override Color BackColor
-        {
-            get { return m_backcolor; }
-            set { m_backcolor = value; }
-        }
-
-        /// <summary>
-        /// 多边形的图形路径边缘
-        /// </summary>
-        public override GraphicsPath GPath
-        {
-            get { return m_gpath; }
-            set { m_gpath = value; }
-        }
-
-        /// <summary>
-        /// 里面包含的多个线的集合
-        /// </summary>
-        public List<DisplaySegment> DSegments
-        {
-            get { return m_listdsegment; }
-            set { m_listdsegment = value; }
-        }
-
-        /// <summary>
-        /// 控制多边形在进行缩放到多少倍时进行显示
-        /// </summary>
-        public float Zoom_DisPlayThreshold
-        {
-            get { return m_zoom_displaymultiplier; }
-           
-        }
-
-        /// <summary>
-        /// 临时的变量,控制进行缩放时,是显示+号,还是显示多边形
-        /// </summary>
-        //public bool Zoom_DisPlay
-        //{
-        //    get { return m_zoom_display; }
-        //    set { m_zoom_display = value; }
-        //}
-
-        /// <summary>
-        /// 设置排序的类型
-        /// </summary>
-        public string SortType
-        {
-            get { return m_sort_type; }
-            set { m_sort_type = value; }
-        }
-
-        /// <summary>
-        /// 设置该多边形的尺寸大小
-        /// </summary>
-        public float FSize
-        {
-            get { return m_f_size; }
-            set { m_f_size = value; }
-        }
-
-        /// <summary>
-        /// 设置粒级
-        /// </summary>
-        public string ParticleLJ
-        {
-            get { return m_str_lj; }
-            set { m_str_lj = value; }
-        }
-
-        /// <summary>
-        /// 设置种类
-        /// </summary>
-        public string ParticleZL
-        {
-            get { return m_str_klzl; }
-            set { m_str_klzl = value; }
-        }
-
-        /// <summary>
-        /// 设置分类
-        /// </summary>
-        public string ParticleFL
-        {
-            get { return m_str_klfl; }
-            set { m_str_klfl = value; }
-        }
-
-        /// <summary>
-        /// 获取或设置该Particle对应底层的FieldID值
-        /// </summary>
-        public int FieldId
-        {
-            get { return objParticleData.FieldId; }
-           
-        }
-
-        /// <summary>
-        /// 获取或设置该Particle对应底层的ParticleID值
-        /// </summary>
-        public int ParticleId
-        {
-            get { return objParticleData.ParticleId; }
-           
-        }
-
-        public bool IsDeleted { get => m_isDeleted; set => m_isDeleted = value; }
-        public bool IsMouseOver { get => m_isMouseOver; set => m_isMouseOver = value; }
-
-
-        ///// <summary>
-        ///// 获取或设置STD分析物的ID
-        ///// </summary>
-        //public int STDTypeID
-        //{
-        //    get { return m_stdtypeid; }
-        //    set { m_stdtypeid = value; }
-        //}
-
-        /// <summary>
-        /// 绘制函数
-        /// </summary>
-        /// <param name="e"></param>
-        public override void OnPaint(PaintEventArgs e)
-        {
-            Graphics g = e.Graphics;
-            //绘制鼠标移动到颗粒上时的边框,需要判断当前鼠标在颗粒上,及颗粒的操作为正常显示
-            if (m_isMouseOver == true)
-            {
-                //如果有鼠标在该矩形上,那么进行描边
-                ControlPaint.DrawBorder(g,
-                                    Rectangle.Round(this.Rect),
-                                    Color.Lime,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.Lime,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.Lime,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.Lime,
-                                    1,
-                                    ButtonBorderStyle.Solid);
-            }
-            //只有正常和选择中的颗粒才进行绘制显示
-            if (m_displayState == DisplayState.NORMALDISPLAY)
-            {
-             
-                //调用绘制基本线
-                foreach (DisplaySegment item in m_listdsegment)
-                {
-                    item.OnPaint(e);
-                }
-              
-            }
-            if (m_displayState == DisplayState.CONCISEDISPLAY)
-            {
-                g.DrawString("+", new Font("黑体", 6), new SolidBrush(Color.DarkSlateBlue), new PointF(m_small_rect.X, m_small_rect.Y));
-            }
-
-            if (m_isSelected)
-            {
-                //如果説该矩形被选择上了的话,那么也显示边框
-                ControlPaint.DrawBorder(g,
-                                    Rectangle.Round(this.Rect),
-                                    Color.Blue,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.Blue,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.Blue,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.Blue,
-                                    1,
-                                    ButtonBorderStyle.Solid);
-            }
-            
-            if (ParticleOperatorShowXray.SELECTANDDISPLAYXRAY == m_operator_showxray && DisplayState.NODISPLAY != m_displayState)
-            {
-                //当鼠标在该颗粒上进行点击,则对颗粒状态更改为选定状态,用来显示X-ray能谱表
-                ControlPaint.DrawBorder(g,
-                                    Rectangle.Round(this.Rect),
-                                    Color.DeepSkyBlue,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.DeepSkyBlue,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.DeepSkyBlue,
-                                    1,
-                                    ButtonBorderStyle.Solid,
-                                    Color.DeepSkyBlue,
-                                    1,
-                                    ButtonBorderStyle.Solid);
-            }
-
-          
-        }
-
-        /// <summary>
-        /// 从Line中获取矩形的边缘闭合路径
-        /// </summary>
-        /// <returns></returns>
-        public GraphicsPath GetRegionFromDSegments()
-        {
-            GraphicsPath gpath = new GraphicsPath();
-
-            List<PointF> list_leftpointf = new List<PointF>();
-            List<PointF> list_rightpointf = new List<PointF>();
-
-            //从y循环,这里假设y轴会按lines集合来计算,然后将所有的左x,和右x取出排成两个队列
-            foreach (DisplaySegment ds in this.m_listdsegment)
-            {
-                list_leftpointf.Add(new PointF(ds.Rect.X, ds.Rect.Y));
-                list_rightpointf.Add(new PointF(ds.Rect.X + ds.Rect.Width, ds.Rect.Y));
-            }
-
-            PointF[] lsp = new PointF[list_leftpointf.Count + list_rightpointf.Count];
-
-            //再将两个x,y点依次添加到闭合路径中
-            for (int i = 0; i < list_leftpointf.Count(); i++)
-            {
-                lsp[i] = list_leftpointf[i];
-            }
-            //右节点
-            for (int i = 0; i < list_rightpointf.Count(); i++)
-            {
-                //这边倒着存入
-                lsp[list_rightpointf.Count() + i] = list_rightpointf[list_rightpointf.Count() - i - 1];
-            }
-
-
-            //防止从低层拿到无数据的外边路径,在我的程序里却需要计算,而防止程序报死,这里做一下特殊处理。
-            if (lsp.Count() >= 3)
-            {
-                gpath.AddPolygon(lsp);
-            }
-            else
-            {
-                //有时居然有颗粒,有没有segment的时候,防止报错
-                if (this.DSegments.Count == 0)
-                {
-                    lsp = new PointF[3] { new PointF(0, 0), new PointF(0, 0), new PointF(0, 0) };
-                    gpath.AddPolygon(lsp);
-                    return gpath;
-                }
-
-                //有2条数据
-                if (lsp[1].X != 0 && lsp[1].Y != 0)
-                {
-                    lsp = new PointF[3] { new PointF(lsp[0].X, lsp[0].Y), new PointF(lsp[1].X, lsp[1].Y), new PointF(lsp[1].X, lsp[1].Y) };
-                }
-                //有1条数据
-                else if (lsp[0].X != 0 && lsp[0].Y != 0)
-                {
-                    lsp = new PointF[3] { new PointF(lsp[0].X, lsp[0].Y), new PointF(lsp[0].X, lsp[0].Y), new PointF(lsp[0].X, lsp[0].Y) };
-                }
-                //剩下的情况 
-                else
-                {
-                    lsp = new PointF[3] { new PointF(0, 0), new PointF(0, 0), new PointF(0,0) };
-                }
-                gpath.AddPolygon(lsp);
-            }
-
-            return gpath;
-        }
-
-
-        /// <summary>
-        /// 从已经确定的外边框来计算出里面的+号小框位置
-        /// </summary>
-        /// <returns></returns>
-        public RectangleF GetSmallRectangleFromRect()
-        {
-            RectangleF rect = new RectangleF();
-
-            //用外边框的坐标,除2获得中心点,然后再分别+,- 4
-            float x = 0, y = 0;
-            x = m_rect.X + (m_rect.Width / 2);
-            y = m_rect.Y + (m_rect.Height / 2);
-
-            rect.X = x - 4;
-            rect.Y = y - 4;
-            rect.Width = 8;
-            rect.Height = 4;
-
-            return rect;
-        }
-
-        /// <summary>
-        /// 根据该多边形所有包含的线长度,计算出,该多边形的面积大小
-        /// </summary>
-        /// <returns></returns>
-        public float GetSizeFormSegmentsAllWidth()
-        {
-            float f_size_sum = 0;
-
-            foreach (DisplaySegment ls_ds in this.m_listdsegment)
-            {
-                f_size_sum = f_size_sum + ls_ds.Rect.Width;
-            }
-            return f_size_sum;
-        }
-
-        /// <summary>
-        /// 从基本线中获取整个矩形的Rectangle
-        /// </summary>
-        /// <returns></returns>
-        public RectangleF GetRectFromDSegment()
-        {
-            RectangleF rect = new RectangleF();
-
-            float x1 = 0, y1 = 0;
-            float i_width = 0, i_height = 0;
-
-            //先从自身中初始化x,y,和宽,高
-            if (this.m_listdsegment.Count > 0)
-            {
-                x1 = this.m_listdsegment[0].Rect.X;
-                y1 = this.m_listdsegment[0].Rect.Y;
-                i_width = x1 + this.m_listdsegment[0].Rect.Width;
-                i_height = this.m_listdsegment[0].Rect.Y;
-            }
-
-            foreach (DisplaySegment ds in this.m_listdsegment)
-            {
-                //分别取出,最小的x,y,
-                if (ds.Rect.X < x1)
-                {
-                    x1 = ds.Rect.X;
-                }
-                if (ds.Rect.Y < y1)
-                {
-                    y1 = ds.Rect.Y;
-                }
-                //最大的x,y
-                if (ds.Rect.X + ds.Rect.Width > i_width)
-                {
-                    i_width = ds.Rect.X + ds.Rect.Width;
-                }
-                if (ds.Rect.Y > i_height)
-                {
-                    i_height = ds.Rect.Y;
-                }
-            }
-
-            //对矩形Rect大小位置进行修补,因为画线是内边框,并且计算出来的位置也是向内占用一像素的,
-            //正常应该是 +2,但实际效果,+3也才勉强够用,因为放大缩小画笔宽度影响的
-            rect.X = x1 - 2;
-            rect.Y = y1 - 3;
-            rect.Width = i_width - rect.X + 2;
-            rect.Height = i_height - rect.Y + 3;
-
-            //判断如果太小,就给个最小值吧
-            if (rect.Width < 8)
-                rect.Width = 8;
-            if (rect.Height < 8)
-                rect.Height = 8;
-
-            return rect;
-        }
-    }
-
-
-
-   
-
-
-}

+ 0 - 180
OTSIncAReportApp/2-CommonFunction/DisplaySegment.cs

@@ -1,180 +0,0 @@
-using OTSIncAReportApp.DataOperation.Model;
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace OTSIncAReportGraph
-{
-    /// <summary>
-    /// 基本线类
-    /// </summary>
-    public class DisplaySegment : BaseObject, ICloneable
-    {
-        private Guid m_id;
-        private RectangleF m_region;
-        private PointF m_OTSPointF;
-        private bool m_isselect;
-        private bool m_isdragging;
-        private PointF m_dragingpoint;
-        private Color m_color;
-        private Color m_backcolor;
-        private GraphicsPath m_gpath;
-        private float m_PenWidthAndHeight = 1;
-        private SegmentShowMode show_mode = SegmentShowMode.DRAWPOINT;//绘线,绘点,默认绘点,意思为默认显示BSE原图像
-        private List<Color> m_list_colors;
-
-        /// <summary>
-        /// 克隆基本线
-        /// </summary>
-        /// <returns></returns>
-        public override object Clone()
-        {
-            return MemberwiseClone();
-        }
-
-        public DisplaySegment()
-        {
-            m_id = System.Guid.NewGuid();
-        }
-
-        /// <summary>
-        /// ID
-        /// </summary>
-        public override Guid guid
-        {
-            get { return m_id; }
-            set { m_id = value; }
-        }
-
-        /// <summary>
-        /// 画面的大小
-        /// </summary>
-        public override RectangleF Rect
-        {
-            get { return m_region; }
-            set { m_region = value; }
-        }
-        /// <summary>
-        /// OTSField
-        /// </summary>
-        public override PointF OTSPointF
-        {
-            get { return m_OTSPointF; }
-            set { m_OTSPointF = value; }
-        }
-        /// <summary>
-        /// 画布是否被选择
-        /// </summary>
-        public override bool IsSelect
-        {
-            get { return m_isselect; }
-            set { m_isselect = value; }
-        }
-
-        /// <summary>
-        /// 是否在被拖动
-        /// </summary>
-        public override bool IsDragging
-        {
-            get { return m_isdragging; }
-            set { m_isdragging = value; }
-        }
-
-        /// <summary>
-        /// 被拖动到的位置坐标
-        /// </summary>
-        public override PointF DraggingPoint
-        {
-            get { return m_dragingpoint; }
-            set { m_dragingpoint = value; }
-        }
-
-        /// <summary>
-        /// 线的颜色
-        /// </summary>
-        public override Color Color
-        {
-            get { return m_color; }
-            set { m_color = value; }
-        }
-
-        /// <summary>
-        /// 背景色
-        /// </summary>
-        public override Color BackColor
-        {
-            get { return m_backcolor; }
-            set { m_backcolor = value; }
-        }
-
-        /// <summary>
-        /// 多边形的图形路径边缘
-        /// </summary>
-        public override GraphicsPath GPath
-        {
-            get { return m_gpath; }
-            set { m_gpath = value; }
-        }
-
-        /// <summary>
-        /// 设置画笔的笔宽度
-        /// </summary>
-        public float PenWidthAndHeight
-        {
-            get { return m_PenWidthAndHeight; }
-            set { m_PenWidthAndHeight = value; }
-        }
-
-        /// <summary>
-        /// 设置显示的方式,可以用,绘线显示查看标准库颜色的,也可以用绘点,查看BSE原图颗粒图色的
-        /// </summary>
-        public SegmentShowMode ShowMode
-        {
-            get { return show_mode; }
-            set { show_mode = value; }
-        }
-
-        /// <summary>
-        /// 保存BSE标准库文件的颗粒点的颜色信息
-        /// </summary>
-        public List<Color> List_Colors
-        {
-            get { return m_list_colors; }
-            set { m_list_colors = value; }
-        }
-
-        /// <summary>
-        /// 绘制函数
-        /// </summary>
-        /// <param name="e"></param>
-        public override void OnPaint(PaintEventArgs e)
-        {
-            //两种绘制模式的选择,绘线还是缓点
-            if (show_mode == SegmentShowMode.DRAWLINE)
-            {
-                //表示显示的是带有标准库的图像
-                Pen p = new Pen(m_color, m_PenWidthAndHeight + 1f);//这里加1f的宽度后,用线组成多边形不会分散,效果正常,原因不知,但目前没有遇到问题
-                e.Graphics.DrawLine(p, Rect.X, Rect.Y, Rect.X + Rect.Width, Rect.Y);
-            }
-            else if (show_mode == SegmentShowMode.DRAWPOINT)
-            {
-                //根据color的序列,显示绘制的原像素的图像。
-                for (int i = 0; i < m_list_colors.Count(); i++)
-                {
-                    e.Graphics.FillRectangle(new SolidBrush(m_list_colors[i]),
-                                            this.Rect.X + (i * m_PenWidthAndHeight) + 1f,
-                            this.Rect.Y,
-                            m_PenWidthAndHeight,
-                            m_PenWidthAndHeight);
-                }
-            }
-        }
-    }
-
-
-}

+ 0 - 307
OTSIncAReportApp/2-CommonFunction/DragHelper.cs

@@ -1,307 +0,0 @@
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace OTSIncAReportApp
-{
-    /// <summary>
-    /// 拖拽帮助类,控件需要注册该类中的鼠标相关事件
-    /// </summary>
-    public class DragHelper
-    {
-        #region 变量定义
-        /// <summary>
-        /// 光标状态
-        /// </summary>
-        private enum EnumMousePointPosition
-        {
-            StateLess,                               //无状态
-            LeftBorderStetch,                          //左边框拉伸
-            TopLeftCornerStretch,                   //左上角拉伸
-            TopBorderStretch,                       //上边框拉伸
-            TopRightCornerStretch,                  //右上角拉伸
-            RightBorderStretch,                     //右边框拉伸
-            BottomRightCornerStretch,               //右下角拉伸
-            BottomBorderStretch,                    //下边框拉伸
-            BottomLeftCornerStretch,                //左下角拉伸
-            Drag                                    //拖曳
-        }
-
-        /// <summary>
-        /// 控件原背景色
-        /// </summary>
-        private static Color oldColor = default(Color);
-
-        /// <summary>
-        /// 控件点击时使用的背景色
-        /// </summary>
-        private static Color controlFocusedBackcolor = Color.Red;
-
-        /// <summary>
-        /// 鼠标拖拽使用的原始点
-        /// </summary>
-        private static Point mouseDragOldPoint = default(Point);
-
-        /// <summary>
-        /// 鼠标上一次改变大小后的位置点
-        /// </summary>
-        private static Point mouseSizeLastPoint = default(Point);
-
-        /// <summary>
-        /// 绘制边框的画笔
-        /// </summary>
-        private static Pen borderPen = new Pen(Color.Black);
-
-        /// <summary>
-        /// 光标变化临界的宽度
-        /// </summary>
-        private const int BAND = 3;
-
-        /// <summary>
-        /// 控件最小宽度
-        /// </summary>
-        private const int MINWIDTH = 10;
-
-        /// <summary>
-        /// 控件最小高度
-        /// </summary>
-        private const int MINHEIGHT = 10;
-
-        /// <summary>
-        /// 当前鼠标操作
-        /// </summary>
-        private static EnumMousePointPosition mousePointPosition = EnumMousePointPosition.StateLess;
-        #endregion
-
-        #region 鼠标相关方法
-        /// <summary>
-        /// 注册控件拖拽事件
-        /// </summary>
-        /// <param name="ctl">拖拽区域控件</param>
-        public static void RegisterDragEvent(Control ctl)
-        {
-            ctl.MouseDown += DragHelper.DragControl_MouseDown;
-            ctl.MouseUp += DragHelper.DragControl_MouseUp;
-            ctl.MouseMove += DragHelper.DragControl_MouseMove;
-        }
-
-        /// <summary>
-        /// 控件鼠标点击事件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private static void DragControl_MouseDown(object sender, MouseEventArgs e)
-        {
-            Control currentControl = null;
-            mouseDragOldPoint = mouseSizeLastPoint = e.Location;                        //保存控件当前位置
-
-            currentControl = sender as Control;
-            oldColor = currentControl.BackColor;        //保存背景色,鼠标弹起时恢复
-            currentControl.BackColor = controlFocusedBackcolor;    //改变背景色
-        }
-
-
-        /// <summary>
-        /// 鼠标在控件上移动事件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private static void DragControl_MouseMove(object sender, MouseEventArgs e)
-        {
-            Control currentControl = null;
-
-            currentControl = sender as Control;
-
-            if (e.Button != MouseButtons.Left)
-            {
-                mousePointPosition = GetMousePointPosition(currentControl.Size, e);
-                switch (mousePointPosition)
-                {
-                    case EnumMousePointPosition.LeftBorderStetch:
-                    case EnumMousePointPosition.RightBorderStretch:
-                        Cursor.Current = Cursors.SizeWE;
-                        break;
-                    case EnumMousePointPosition.TopBorderStretch:
-                    case EnumMousePointPosition.BottomBorderStretch:
-                        Cursor.Current = Cursors.SizeNS;
-                        break;
-                    case EnumMousePointPosition.TopLeftCornerStretch:
-                    case EnumMousePointPosition.BottomRightCornerStretch:
-                        Cursor.Current = Cursors.SizeNWSE;
-                        break;
-                    case EnumMousePointPosition.TopRightCornerStretch:
-                    case EnumMousePointPosition.BottomLeftCornerStretch:
-                        Cursor.Current = Cursors.SizeNESW;
-                        break;
-                    case EnumMousePointPosition.Drag:
-                        Cursor.Current = Cursors.SizeAll;
-                        break;
-                    default:
-                        Cursor.Current = null;
-                        break;
-                }
-                return;
-            }
-
-            switch (mousePointPosition)
-            {
-                case EnumMousePointPosition.Drag:
-                    currentControl.Left += e.X - mouseDragOldPoint.X;
-                    currentControl.Top += e.Y - mouseDragOldPoint.Y;
-                    break;
-                case EnumMousePointPosition.BottomBorderStretch:
-                    currentControl.Height += e.Y - mouseSizeLastPoint.Y;
-                    mouseSizeLastPoint = e.Location;                    //记录光标拖动的当前点
-                    break;
-                case EnumMousePointPosition.BottomRightCornerStretch:
-                    currentControl.Width += e.X - mouseSizeLastPoint.X;
-                    currentControl.Height = e.Y - mouseSizeLastPoint.Y;
-                    mouseSizeLastPoint = e.Location;                    //记录光标拖动的当前点
-                    break;
-                case EnumMousePointPosition.RightBorderStretch:
-                    currentControl.Width += e.X - mouseSizeLastPoint.X;
-                    mouseSizeLastPoint = e.Location;                    //记录光标拖动的当前点
-                    break;
-                case EnumMousePointPosition.TopBorderStretch:
-                    currentControl.Top += e.Y - mouseDragOldPoint.Y;
-                    currentControl.Height -= e.Y - mouseDragOldPoint.Y;
-                    break;
-                case EnumMousePointPosition.LeftBorderStetch:
-                    currentControl.Left += e.X - mouseDragOldPoint.X;
-                    currentControl.Width -= e.X - mouseDragOldPoint.X;
-                    break;
-                case EnumMousePointPosition.BottomLeftCornerStretch:
-                    currentControl.Left += e.X - mouseDragOldPoint.X;
-                    currentControl.Width -= e.X - mouseDragOldPoint.X;
-                    currentControl.Height += e.Y - mouseSizeLastPoint.Y;
-                    mouseSizeLastPoint = e.Location;                    //记录光标拖动的当前点
-                    break;
-                case EnumMousePointPosition.TopRightCornerStretch:
-                    currentControl.Top += e.Y - mouseDragOldPoint.Y;
-                    currentControl.Width += e.X - mouseSizeLastPoint.X;
-                    currentControl.Height -= e.Y - mouseDragOldPoint.Y;
-                    mouseSizeLastPoint = e.Location;                    //记录光标拖动的当前点
-                    break;
-                case EnumMousePointPosition.TopLeftCornerStretch:
-                    currentControl.Left += e.X - mouseDragOldPoint.X;
-                    currentControl.Top += e.Y - mouseDragOldPoint.Y;
-                    currentControl.Width -= e.X - mouseDragOldPoint.X;
-                    currentControl.Height -= e.Y - mouseDragOldPoint.Y;
-                    break;
-                default: break;
-            }
-            if (currentControl.Width < MINWIDTH)
-            {
-                currentControl.Width = MINWIDTH;
-            }
-            if (currentControl.Height < MINHEIGHT)
-            {
-                currentControl.Height = MINHEIGHT;
-            }
-        }
-
-
-        /// <summary>
-        /// 控件鼠标弹起事件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private static void DragControl_MouseUp(object sender, MouseEventArgs e)
-        {
-            Control currentControl = null;
-
-            currentControl = sender as Control;
-            Cursor.Current = null;
-            mousePointPosition = EnumMousePointPosition.StateLess;
-            currentControl.BackColor = oldColor;                     //恢复控件背景色
-        }
-        /// <summary>
-        /// 获取鼠标位置
-        /// </summary>
-        /// <param name="size">控件大小</param>
-        /// <param name="e">鼠标位置</param>
-        /// <returns>鼠标光标位置</returns>
-        private static EnumMousePointPosition GetMousePointPosition(Size size, MouseEventArgs e)
-        {
-            if ((e.X < (-1 * BAND)) || (e.X > size.Width) || (e.Y < (-1 * BAND)) || (e.Y > size.Height))//光标越界
-            {
-                return EnumMousePointPosition.StateLess;
-            }
-
-            if (e.X < BAND)
-            {
-                if (e.Y < BAND)
-                {
-                    return EnumMousePointPosition.TopLeftCornerStretch;
-                }
-                else
-                {
-                    if (e.Y > ((-1 * BAND) + size.Height))
-                    {
-                        return EnumMousePointPosition.BottomLeftCornerStretch;
-                    }
-                    else
-                    {
-                        return EnumMousePointPosition.LeftBorderStetch;
-                    }
-                }
-            }
-            else
-            {
-                if (e.X > (-1 * BAND + size.Width))
-                {
-                    if (e.Y < BAND)
-                    {
-                        return EnumMousePointPosition.TopRightCornerStretch;
-                    }
-                    else
-                    {
-                        if (e.Y > (-1 * BAND + size.Height))
-                        {
-                            return EnumMousePointPosition.BottomRightCornerStretch;
-                        }
-                        else
-                        {
-                            return EnumMousePointPosition.RightBorderStretch;
-                        }
-                    }
-                }
-                else
-                {
-                    if (e.Y < BAND)
-                    {
-                        return EnumMousePointPosition.TopBorderStretch;
-                    }
-                    else
-                    {
-                        if (e.Y > (-1 * BAND + size.Height))
-                        {
-                            return EnumMousePointPosition.BottomBorderStretch;
-                        }
-                        else
-                        {
-                            return EnumMousePointPosition.Drag;
-                        }
-                    }
-                }
-            }
-        }
-
-        #endregion
-
-        #region 绘制相关
-        /// <summary>
-        /// 绘制控件边框
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private static void DragControlParent_Paint(object sender, PaintEventArgs e)
-        {
-            Control currentControl = null;
-
-            currentControl = sender as Control;
-            return;
-        }
-        #endregion
-
-    }
-}

+ 0 - 625
OTSIncAReportApp/2-CommonFunction/DrawFunction.cs

@@ -1,625 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using OTSIncAReportGraph.Class;
-using System.Runtime.InteropServices;
-using System.IO;
-using OpenCvSharp;
-
-namespace OTSIncAReportGraph.Class
-{
-    /// <summary>
-    /// 相关图表绘制函数统一封装类
-    /// </summary>
-    static class DrawFunction
-    {
-        [DllImport("gdi32.dll")]
-        public static extern System.UInt32 GetPixel(IntPtr hdc, int xPos, int yPos);
-
-        /// <summary>    
-        /// 将一个byte的数组转换为8bit灰度位图    
-        /// </summary>    
-        /// <param name="data">数组</param>    
-        /// <param name="width">图像宽度</param>    
-        /// <param name="height">图像高度</param>    
-        /// <returns>位图</returns>    
-        public static Bitmap ToGrayBitmap(byte[] data, int width, int height)
-        {
-            //// 申请目标位图的变量,并将其内存区域锁定    
-            Bitmap bmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed);
-            //// BitmapData这部分内容  需要 using System.Drawing.Imaging;  
-            BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, width, height),
-            ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
-
-            //// 获取图像参数    
-            // 扫描线的宽度   
-            //int stride = bmpData.Stride;
-            // 显示宽度与扫描线宽度的间隙  
-            int offset = width - width;
-            // 获取bmpData的内存起始位置
-            IntPtr iptr = bmpData.Scan0;
-            // 用stride宽度,表示这是内存区域的大小
-            int scanBytes = width * height;
-
-            //// 下面把原始的显示大小字节数组转换为内存中实际存放的字节数组    
-            int posScan = 0, posReal = 0;// 分别设置两个位置指针,指向源数组和目标数组    
-            byte[] pixelValues = new byte[scanBytes];  //为目标数组分配内存    
-
-            for (int x = 0; x < height; x++)
-            {
-                //// 下面的循环节是模拟行扫描    
-                for (int y = 0; y < width; y++)
-                {
-                    pixelValues[posScan++] = data[posReal++];
-                }
-                posScan += offset;  //行扫描结束,要将目标位置指针移过那段“间隙”    
-            }
-            //// 用Marshal的Copy方法,将刚才得到的内存字节数组复制到BitmapData中    
-            System.Runtime.InteropServices.Marshal.Copy(pixelValues, 0, iptr, scanBytes);
-            bmp.UnlockBits(bmpData);  // 解锁内存区域    
-
-            //// 下面的代码是为了修改生成位图的索引表,从伪彩修改为灰度    
-            ColorPalette tempPalette;
-            using (Bitmap tempBmp = new Bitmap(1, 1, PixelFormat.Format8bppIndexed))
-            {
-                tempPalette = tempBmp.Palette;
-            }
-            for (int i = 0; i < 256; i++)
-            {
-                tempPalette.Entries[i] = Color.FromArgb(i, i, i);
-            }
-            bmp.Palette = tempPalette;
-
-            //// 算法到此结束,返回结果    
-            return bmp;
-        }
-
-        /// <summary>
-        /// *有BUG*将图片缩放到目标宽高,该方法有问题,不应该继续使用,图像申缩存在不规则问题
-        /// </summary>
-        /// <param name="sourceImage"></param>
-        /// <param name="targetWidth"></param>
-        /// <param name="targetHeight"></param>
-        /// <returns></returns>
-        public static Image pictureProcess(Image sourceImage, int targetWidth, int targetHeight)
-        {
-            int width;//图片最终的宽  
-            int height;//图片最终的高  
-            try
-            {
-                System.Drawing.Imaging.ImageFormat format = sourceImage.RawFormat;
-                Bitmap targetPicture = new Bitmap(targetWidth, targetHeight);
-                Graphics g = Graphics.FromImage(targetPicture);
-                g.Clear(Color.White);
-
-                //计算缩放图片的大小  
-                if (sourceImage.Width > targetWidth && sourceImage.Height <= targetHeight)
-                {
-                    width = targetWidth;
-                    height = (width * sourceImage.Height) / sourceImage.Width;
-                }
-                else if (sourceImage.Width <= targetWidth && sourceImage.Height > targetHeight)
-                {
-                    height = targetHeight;
-                    width = (height * sourceImage.Width) / sourceImage.Height;
-                }
-                else if (sourceImage.Width <= targetWidth && sourceImage.Height <= targetHeight)
-                {
-                    width = sourceImage.Width;
-                    height = sourceImage.Height;
-                }
-                else
-                {
-                    width = targetWidth;
-                    height = (width * sourceImage.Height) / sourceImage.Width;
-                    if (height > targetHeight)
-                    {
-                        height = targetHeight;
-                        width = (height * sourceImage.Width) / sourceImage.Height;
-                    }
-                }
-                g.DrawImage(sourceImage, (targetWidth - width) / 2, (targetHeight - height) / 2, width, height);
-                g.Dispose();
-                return targetPicture;
-            }
-            catch (Exception ex)
-            {
-                string str = ex.ToString();
-            }
-            return null;
-        }
-
-        /// <summary>
-        /// 根据传入的宽和高,取得当前对应显示的4:3的标准分辨率
-        /// </summary>
-        /// <returns></returns>
-        public static Rectangle Get43ScaleResolving(int in_width, int in_height)
-        {
-            Rectangle rect_resolving = new Rectangle();
-            int width_min = 0;
-            int height_min = 0;
-            int width_max = 0;
-            int height_max = 0;
-
-            width_min = 1600;
-            height_min = 1200;
-            width_max = 2048;
-            height_max = 1536;
-            if ((in_width >= width_min && in_width < width_max) || (in_height >= height_min && in_height < height_max))
-                rect_resolving = new Rectangle(0, 0, width_min, height_min);
-
-            width_min = 1400;
-            height_min = 1050;
-            width_max = 1600;
-            height_max = 1200;
-            if ((in_width >= width_min && in_width < width_max) || (in_height >= height_min && in_height < height_max))
-                rect_resolving = new Rectangle(0, 0, width_min, height_min);
-
-            width_min = 1280;
-            height_min = 1024;
-            width_max = 1400;
-            height_max = 1050;
-            if ((in_width >= width_min && in_width < width_max) || (in_height >= height_min && in_height < height_max))
-                rect_resolving = new Rectangle(0, 0, width_min, height_min);
-
-            width_min = 1024;
-            height_min = 768;
-            width_max = 1280;
-            height_max = 1024;
-            if ((in_width >= width_min && in_width < width_max) || (in_height >= height_min && in_height < height_max))
-                rect_resolving = new Rectangle(0, 0, width_min, height_min);
-
-            width_min = 800;
-            height_min = 600;
-            width_max = 1024;
-            height_max = 768;
-            if ((in_width >= width_min && in_width < width_max) || (in_height >= height_min && in_height < height_max))
-                rect_resolving = new Rectangle(0, 0, width_min, height_min);
-
-            width_min = 640;
-            height_min = 480;
-            width_max = 800;
-            height_max = 600;
-            if ((in_width >= width_min && in_width < width_max) || (in_height >= height_min && in_height < height_max))
-                rect_resolving = new Rectangle(0, 0, width_min, height_min);
-
-            width_min = 320;
-            height_min = 240;
-            width_max = 640;
-            height_max = 480;
-            if ((in_width >= width_min && in_width < width_max) || (in_height >= height_min && in_height < height_max))
-                rect_resolving = new Rectangle(0, 0, width_min, height_min);
-
-            width_min = 0;
-            height_min = 0;
-            width_max = 320;
-            height_max = 240;
-            if ((in_width >= width_min && in_width < width_max) || (in_height >= height_min && in_height < height_max))
-                rect_resolving = new Rectangle(0, 0, width_min, height_min);
-
-            return rect_resolving;
-        }
-
-        /// <summary>  
-        /// [该方法效果正确,但速度上慢,淘汰掉],上下翻转  
-        /// </summary>  
-        /// <param name="mybm">原始图片</param>  
-        /// <param name="width">原始图片的长度</param>  
-        /// <param name="height">原始图片的高度</param>  
-        public static Bitmap RevPicUD(Bitmap mybm, int width, int height)
-        {
-            Bitmap bm = new Bitmap(width, height);
-            int x, y, z;
-            Color pixel;
-            for (x = 0; x < width; x++)
-            {
-                for (y = height - 1, z = 0; y >= 0; y--)
-                {
-                    pixel = mybm.GetPixel(x, y);//获取当前像素的值  
-                    bm.SetPixel(x, z++, Color.FromArgb(pixel.R, pixel.G, pixel.B));//绘图  
-                }
-            }
-            return bm;
-        }
-
-
-        /// <summary>
-        /// 实现计算的方法,就是输出个数字,然后向上寻找倍数,然后返回来根
-        /// </summary>
-        /// <param name="in_number"></param>
-        /// <returns></returns>
-        public static int GetSquareRoot(int in_number)
-        {
-            int i_increase = 1;
-
-            while (true)
-            {
-                //防止死循环
-                if (i_increase > 10000)
-                    return i_increase;
-
-                int ls_i = i_increase * i_increase;
-                if (in_number > ls_i)
-                {
-                    //如果当前的数值已经大于平方数的话,那就继续下一次的平方
-                    i_increase++;
-                    continue;
-                }
-                else
-                {
-                    //如果已经小于平方数的话,那就说明已经找到了平方根,返回
-                    return i_increase;
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// 根据传入的数字返回对应的颜色,范围1-17种颜色,挑出来比较谈的颜色为对比效果好看而挑选
-        /// </summary>
-        /// <param name="number"></param>
-        /// <returns></returns>
-        public static Color GetColorByNumber(int number)
-        {
-            Color ret_color = new Color();
-            switch (number)
-            {
-                case 1:
-                    ret_color = Color.Blue;
-                    break;
-                case 2:
-                    ret_color = Color.Brown;
-                    break;
-                case 3:
-                    ret_color = Color.LimeGreen;
-                    break;
-                case 13:
-                    ret_color = Color.Cyan;
-                    break;
-                case 4:
-                    ret_color = Color.DarkBlue;
-                    break;
-                case 5:
-                    ret_color = Color.Red;
-                    break;
-                case 6:
-                    ret_color = Color.SaddleBrown;
-                    break;
-                case 7:
-                    ret_color = Color.DimGray;
-                    break;
-                case 8:
-                    ret_color = Color.Navy;
-                    break;
-                case 9:
-                    ret_color = Color.Peru;
-                    break;
-                case 10:
-                    ret_color = Color.Red;
-                    break;
-                case 11:
-                    ret_color = Color.SeaGreen;
-                    break;
-                case 12:
-                    ret_color = Color.MintCream;
-                    break;
-                case 14:
-                    ret_color = Color.PaleTurquoise;
-                    break;
-                case 15:
-                    ret_color = Color.SeaShell;
-                    break;
-                case 16:
-                    ret_color = Color.Snow;
-                    break;
-                case 17:
-                    ret_color = Color.WhiteSmoke;
-                    break;
-
-                default:
-                    ret_color = Color.White;
-                    break;
-            }
-
-            return ret_color;
-        }
-
-        /// <summary>
-        /// 获取一个自绘模仿进度条的bitemap对象,传入进度的值,0-100之间
-        /// </summary>
-        /// <param name="process_value"></param>
-        /// <returns></returns>
-        public static Bitmap GetProcessBitmap(int process_value)
-        {
-            Bitmap bmp = new Bitmap(104, 30); //这里给104是为了左边和右边空出2个像素,剩余的100就是百分比的值
-            Graphics g = Graphics.FromImage(bmp);
-            g.Clear(Color.White); //背景填白色
-                                  //g.FillRectangle(Brushes.Red, 2, 2, this.Press, 26);  //普通效果
-                                  //填充渐变效果
-            SolidBrush drawBrush = new SolidBrush(Color.Black);
-            g.FillRectangle(new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.Point(30, 2), new System.Drawing.Point(30, 30), Color.Red, Color.Gray), 2, 2, process_value, 26);
-            g.DrawString(process_value.ToString(), new Font("宋体", 9), drawBrush, 50, 8);
-            return bmp;
-        }
-
-
-
-        /// <summary>
-        /// 获取一个自绘模仿进度条的bitemap对象,传入进度的值,0-100之间[重载可以自定设置背景色]
-        /// </summary>
-        /// <param name="process_value"></param>
-        /// <param name="back_color"></param>
-        /// <returns></returns>
-        public static Bitmap GetProcessBitmap(float process_value, Color back_color)
-        {
-            if (process_value < 0)
-                process_value = 0;
-            if (process_value > 100)
-                process_value = 100;
-            Bitmap bmp = new Bitmap(104, 30); //这里给104是为了左边和右边空出2个像素,剩余的100就是百分比的值
-            Graphics g = Graphics.FromImage(bmp);
-            g.Clear(back_color); //背景填白色
-                                 //g.FillRectangle(Brushes.Red, 2, 2, this.Press, 26);  //普通效果
-                                 //填充渐变效果
-            SolidBrush drawBrush = new SolidBrush(Color.Black);
-            g.FillRectangle(new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.Point(30, 2), new System.Drawing.Point(30, 30), Color.Red, Color.Gray), 2, 2, process_value, 26);
-            g.DrawString(process_value.ToString(), new Font("宋体", 9), drawBrush, 50, 8);
-            return bmp;
-        }
-
-
-        /// <summary>
-        /// [颜色:16进制转成RGB]
-        /// </summary>
-        /// <param name="strColor">设置16进制颜色 [返回RGB]</param>
-        /// <returns></returns>
-        public static System.Drawing.Color colorHx16toRGB(string strHxColor)
-        {
-            try
-            {
-                if (strHxColor.Length == 0)
-                {//如果为空
-                    return System.Drawing.Color.FromArgb(0, 0, 0);//设为黑色
-                }
-                else
-                {//转换颜色
-                    if (strHxColor.IndexOf('#') > -1)
-                    {
-                        //如果颜色格式是 #0000FF 格式的
-                        return System.Drawing.Color.FromArgb(System.Int32.Parse(strHxColor.Substring(1, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(3, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(5, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
-                    }
-                    else
-                    {
-                        //如果颜色格式是 0000FF 格式的
-                        return System.Drawing.Color.FromArgb(System.Int32.Parse(strHxColor.Substring(0, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(2, 2), System.Globalization.NumberStyles.AllowHexSpecifier), System.Int32.Parse(strHxColor.Substring(4, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
-                    }
-                }
-            }
-            catch
-            {//设为黑色
-                return System.Drawing.Color.FromArgb(0, 0, 0);
-            }
-        }
-
-
-        /// <summary>
-        /// 通过FileStream 来打开文件,这样就可以实现不锁定Image文件,到时可以让多用户同时访问Image文件
-        /// </summary>
-        /// <param name="path"></param>
-        /// <returns></returns>
-        public static Bitmap ReadImageFile(string path)
-        {
-            if (!File.Exists(path))
-            {
-                return null;//文件不存在
-            }
-            FileStream fs = File.OpenRead(path); //OpenRead
-            int filelength = 0;
-            filelength = (int)fs.Length; //获得文件长度 
-            Byte[] image = new Byte[filelength]; //建立一个字节数组 
-            fs.Read(image, 0, filelength); //按字节流读取 
-            System.Drawing.Image result = System.Drawing.Image.FromStream(fs);
-            fs.Close();
-            Bitmap bit = new Bitmap(result);
-            return bit;
-        }
-        //图片转成二进制        
-        public static byte[] GetPictureData(string imagepath)
-        {
-            /**/
-            ////根据图片文件的路径使用文件流打开,并保存为byte[]             
-            FileStream FileStream = new FileStream(imagepath, FileMode.Open);
-            byte[] byData = new byte[FileStream.Length];
-            FileStream.Read(byData, 0, byData.Length);
-            FileStream.Close();
-            return byData;
-        }
-
-
-        /// <summary>
-        /// 将image转成bytes
-        /// </summary>
-        /// <param name="in_img"></param>
-        /// <returns></returns>
-        public static byte[] ImageConvertToBytes(System.Drawing.Image in_img)
-        {
-            MemoryStream ms = new MemoryStream();
-            in_img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
-            return ms.ToArray();
-        }
-
-
-        /// <summary> 
-        /// Resize图片
-        /// </summary>
-        /// <param name="bmp">原始Bitmap</param>
-        /// <param name="newW">新的宽度</param>
-        /// <param name="newH">新的高度</param>
-        /// <returns>处理以后的图片</returns>
-        public static Bitmap KiResizeImage(Bitmap bmp, int newW, int newH)
-        {
-            try
-            {
-                Bitmap b = new Bitmap(newW, newH);
-                Graphics g = Graphics.FromImage(b);
-
-                // 插值算法的质量
-                g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
-
-                g.DrawImage(bmp, new Rectangle(0, 0, newW, newH), new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel);
-                g.Dispose();
-
-                return b;
-            }
-            catch
-            {
-                return null;
-            }
-        }
-
-        public static Bitmap GetReZoomBitmap(Bitmap in_bp)
-        {
-            Mat src = OpenCvSharp.Extensions.BitmapConverter.ToMat(in_bp);
-            Mat dst = new Mat();
-
-            Cv2.AdaptiveThreshold(src, dst, 255, AdaptiveThresholdTypes.MeanC, ThresholdTypes.Binary, 27, 25);
-
-            //绝对缩放,
-            Mat dst2 = new Mat();
-            int col = dst.Width;//获取原图像的大小
-            int rows = dst.Height;
-            Cv2.Resize(dst, dst2, new OpenCvSharp.Size(4 * col, 4 * rows), 0, 0, InterpolationFlags.Cubic);
-
-            return OpenCvSharp.Extensions.BitmapConverter.ToBitmap(dst2);
-        }
-
-
-    }
-
-
-    /// <summary>
-    /// 获取当前桌面显示器相关信息,暂未考虑多显示器
-    /// </summary>
-    static public class MyPrimaryScreen
-    {
-
-        #region Win32 API  
-        [DllImport("user32.dll")]
-        static extern IntPtr GetDC(IntPtr ptr);
-        [DllImport("gdi32.dll")]
-        static extern int GetDeviceCaps(
-        IntPtr hdc, // handle to DC  
-                        int nIndex // index of capability  
-                        );
-        [DllImport("user32.dll", EntryPoint = "ReleaseDC")]
-        static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDc);
-        #endregion
-
-        #region DeviceCaps常量  
-        const int HORZRES = 8;
-        const int VERTRES = 10;
-        const int LOGPIXELSX = 88;
-        const int LOGPIXELSY = 90;
-        const int DESKTOPVERTRES = 117;
-        const int DESKTOPHORZRES = 118;
-        #endregion
-
-        #region 属性  
-        /// <summary>  
-        /// 获取屏幕分辨率当前物理大小  
-        /// </summary>  
-        public static System.Drawing.Size WorkingArea
-        {
-            get
-            {
-                IntPtr hdc = GetDC(IntPtr.Zero);
-                System.Drawing.Size size = new System.Drawing.Size();
-                size.Width = GetDeviceCaps(hdc, HORZRES);
-                size.Height = GetDeviceCaps(hdc, VERTRES);
-                ReleaseDC(IntPtr.Zero, hdc);
-                return size;
-            }
-        }
-
-        /// <summary>  
-        /// 当前系统DPI_X 大小 一般为96  
-        /// </summary>  
-        public static int DpiX
-        {
-            get
-            {
-                IntPtr hdc = GetDC(IntPtr.Zero);
-                int DpiX = GetDeviceCaps(hdc, LOGPIXELSX);
-                ReleaseDC(IntPtr.Zero, hdc);
-                return DpiX;
-            }
-        }
-
-        /// <summary>  
-        /// 当前系统DPI_Y 大小 一般为96  
-        /// </summary>  
-        public static int DpiY
-        {
-            get
-            {
-                IntPtr hdc = GetDC(IntPtr.Zero);
-                int DpiX = GetDeviceCaps(hdc, LOGPIXELSY);
-                ReleaseDC(IntPtr.Zero, hdc);
-                return DpiX;
-            }
-        }
-
-        /// <summary>  
-        /// 获取真实设置的桌面分辨率大小  
-        /// </summary>  
-        public static System.Drawing.Size DESKTOP
-        {
-            get
-            {
-                IntPtr hdc = GetDC(IntPtr.Zero);
-                System.Drawing.Size size = new System.Drawing.Size();
-                size.Width = GetDeviceCaps(hdc, DESKTOPHORZRES);
-                size.Height = GetDeviceCaps(hdc, DESKTOPVERTRES);
-                ReleaseDC(IntPtr.Zero, hdc);
-                return size;
-            }
-        }
-
-        /// <summary>  
-        /// 获取宽度缩放百分比  
-        /// </summary>  
-        public static float ScaleX
-        {
-            get
-            {
-                IntPtr hdc = GetDC(IntPtr.Zero);
-                int t = GetDeviceCaps(hdc, DESKTOPHORZRES);
-                int d = GetDeviceCaps(hdc, HORZRES);
-                float ScaleX = (float)GetDeviceCaps(hdc, DESKTOPHORZRES) / (float)GetDeviceCaps(hdc, HORZRES);
-                ReleaseDC(IntPtr.Zero, hdc);
-                return ScaleX;
-            }
-        }
-
-        /// <summary>  
-        /// 获取高度缩放百分比  
-        /// </summary>  
-        public static float ScaleY
-        {
-            get
-            {
-                IntPtr hdc = GetDC(IntPtr.Zero);
-                float ScaleY = (float)(float)GetDeviceCaps(hdc, DESKTOPVERTRES) / (float)GetDeviceCaps(hdc, VERTRES);
-                ReleaseDC(IntPtr.Zero, hdc);
-                return ScaleY;
-            }
-        }
-        #endregion
-
-    }
-}

+ 0 - 58
OTSIncAReportApp/2-CommonFunction/HistoryApolygon.cs

@@ -1,58 +0,0 @@
-using System;
-
-namespace OTSIncAReportGraph
-{
-    #region 历史操作记录类
-    ///历史操作记录类,记录颗粒被操作的记录
-    public class HistoryApolygon
-    {
-        //自增长,操作id,增长在程序中自己写代码控制
-        private int m_id;
-        //所操作的颗粒的id
-        private Guid m_apolygonid;
-        //操作类型
-        private DisplayState m_operator;
-        //原先的操作状态类型
-        private DisplayState m_oldoperator;
-        private bool m_isDeleted;
-
-        /// <summary>
-        /// 操作类ID
-        /// </summary>
-        public int ID
-        {
-            get { return m_id; }
-            set { m_id = value; }
-        }
-
-        /// <summary>
-        /// 颗粒类ID
-        /// </summary>
-        public Guid APolygonID
-        {
-            get { return m_apolygonid; }
-            set { m_apolygonid = value; }
-        }
-
-        /// <summary>
-        /// 操作类型
-        /// </summary>
-        public DisplayState Operator
-        {
-            get { return m_operator; }
-            set { m_operator = value; }
-        }
-
-        /// <summary>
-        /// 原先的操作类型
-        /// </summary>
-        public DisplayState OldOperator
-        {
-            get { return m_oldoperator; }
-            set { m_oldoperator = value; }
-        }
-
-        public bool IsDeleted { get => m_isDeleted; set => m_isDeleted = value; }
-    }
-    #endregion
-}

+ 0 - 496
OTSIncAReportApp/2-CommonFunction/INIHelper.cs

@@ -1,496 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace OTSIncAReportApp
-{
-    public static class INIHelper
-    {
-
-        #region 读写INI文件相关
-        [DllImport("kernel32.dll", EntryPoint = "WritePrivateProfileString", CharSet = CharSet.Ansi)]
-        private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
-
-        [DllImport("kernel32.dll", EntryPoint = "GetPrivateProfileString", CharSet = CharSet.Ansi)]
-        private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
-
-        [DllImport("kernel32")]
-        private static extern int GetPrivateProfileInt(string lpApplicationName, string lpKeyName, int nDefault, string lpFileName);
-
-
-        [DllImport("kernel32.dll", EntryPoint = "GetPrivateProfileSectionNames", CharSet = CharSet.Ansi)]
-        private static extern int GetPrivateProfileSectionNames(IntPtr lpszReturnBuffer, int nSize, string filePath);
-
-        [DllImport("KERNEL32.DLL ", EntryPoint = "GetPrivateProfileSection", CharSet = CharSet.Ansi)]
-        private static extern int GetPrivateProfileSection(string lpAppName, byte[] lpReturnedString, int nSize, string filePath);
-        #endregion
-
-        #region 读写操作(字符串)
-        /// <summary>
-        /// 向INI写入数据
-        /// </summary>
-        /// <PARAM name="Section">节点名</PARAM>
-        /// <PARAM name="Key">键名</PARAM>
-        /// <PARAM name="Value">值(字符串)</PARAM>
-        public static void Write(string Section, string Key, string Value, string path)
-        {
-            WritePrivateProfileString(Section, Key, Value, path);
-        }
-        /// <summary>
-        /// 读取INI数据
-        /// </summary>
-        /// <PARAM name="Section">节点名</PARAM>
-        /// <PARAM name="Key">键名</PARAM>
-        /// <PARAM name="Path">值名</PARAM>
-        /// <returns>值(字符串)</returns>
-        public static string Read(string Section, string Key, string path)
-        {
-            StringBuilder temp = new StringBuilder(255);
-            int i = GetPrivateProfileString(Section, Key, "", temp, 255, path);
-            return temp.ToString();
-        }
-        #endregion
-
-        #region 配置节信息
-        /// <summary>
-        /// 读取一个ini里面所有的节
-        /// </summary>
-        /// <param name="sections"></param>
-        /// <param name="path"></param>
-        /// <returns>-1:没有节信息,0:正常</returns>
-        public static int GetAllSectionNames(out string[] sections, string path)
-        {
-            int MAX_BUFFER = 32767;
-            IntPtr pReturnedString = Marshal.AllocCoTaskMem(MAX_BUFFER);
-            int bytesReturned = GetPrivateProfileSectionNames(pReturnedString, MAX_BUFFER, path);
-            if (bytesReturned == 0)
-            {
-                sections = null;
-                return -1;
-            }
-            string local = Marshal.PtrToStringAnsi(pReturnedString, (int)bytesReturned).ToString();
-            Marshal.FreeCoTaskMem(pReturnedString);
-            //use of Substring below removes terminating null for split
-            sections = local.Substring(0, local.Length - 1).Split('\0');
-            return 0;
-        }
-        /// <summary>
-        /// 返回指定配置文件下的节名称列表
-        /// </summary>
-        /// <param name="path"></param>
-        /// <returns></returns>
-        public static List<string> GetAllSectionNames(string path)
-        {
-            List<string> sectionList = new List<string>();
-            int MAX_BUFFER = 32767;
-            IntPtr pReturnedString = Marshal.AllocCoTaskMem(MAX_BUFFER);
-            int bytesReturned = GetPrivateProfileSectionNames(pReturnedString, MAX_BUFFER, path);
-            if (bytesReturned != 0)
-            {
-                string local = Marshal.PtrToStringAnsi(pReturnedString, (int)bytesReturned).ToString();
-                Marshal.FreeCoTaskMem(pReturnedString);
-                sectionList.AddRange(local.Substring(0, local.Length - 1).Split('\0'));
-            }
-            return sectionList;
-        }
-
-        /// <summary>
-        /// 得到某个节点下面所有的key和value组合
-        /// </summary>
-        /// <param name="section">指定的节名称</param>
-        /// <param name="keys">Key数组</param>
-        /// <param name="values">Value数组</param>
-        /// <param name="path">INI文件路径</param>
-        /// <returns></returns>
-        public static int GetAllKeyValues(string section, out string[] keys, out string[] values, string path)
-        {
-            byte[] b = new byte[65535];//配置节下的所有信息
-            GetPrivateProfileSection(section, b, b.Length, path);
-            string s = System.Text.Encoding.Default.GetString(b);//配置信息
-            string[] tmp = s.Split((char)0);//Key\Value信息
-            List<string> result = new List<string>();
-            foreach (string r in tmp)
-            {
-                if (r != string.Empty)
-                    result.Add(r);
-            }
-            keys = new string[result.Count];
-            values = new string[result.Count];
-            for (int i = 0; i < result.Count; i++)
-            {
-                string[] item = result[i].Split(new char[] { '=' });//Key=Value格式的配置信息
-                //Value字符串中含有=的处理,
-                //一、Value加"",先对""处理
-                //二、Key后续的都为Value
-                if (item.Length > 2)
-                {
-                    keys[i] = item[0].Trim();
-                    values[i] = result[i].Substring(keys[i].Length + 1);
-                }
-                if (item.Length == 2)//Key=Value
-                {
-                    keys[i] = item[0].Trim();
-                    values[i] = item[1].Trim();
-                }
-                else if (item.Length == 1)//Key=
-                {
-                    keys[i] = item[0].Trim();
-                    values[i] = "";
-                }
-                else if (item.Length == 0)
-                {
-                    keys[i] = "";
-                    values[i] = "";
-                }
-            }
-            return 0;
-        }
-        /// <summary>
-        /// 得到某个节点下面所有的key
-        /// </summary>
-        /// <param name="section">指定的节名称</param>
-        /// <param name="keys">Key数组</param>
-        /// <param name="path">INI文件路径</param>
-        /// <returns></returns>
-        public static int GetAllKeys(string section, out string[] keys, string path)
-        {
-            byte[] b = new byte[65535];
-
-            GetPrivateProfileSection(section, b, b.Length, path);
-            string s = System.Text.Encoding.Default.GetString(b);
-            string[] tmp = s.Split((char)0);
-            ArrayList result = new ArrayList();
-            foreach (string r in tmp)
-            {
-                if (r != string.Empty)
-                    result.Add(r);
-            }
-            keys = new string[result.Count];
-            for (int i = 0; i < result.Count; i++)
-            {
-                string[] item = result[i].ToString().Split(new char[] { '=' });
-                if (item.Length == 2)
-                {
-                    keys[i] = item[0].Trim();
-                }
-                else if (item.Length == 1)
-                {
-                    keys[i] = item[0].Trim();
-                }
-                else if (item.Length == 0)
-                {
-                    keys[i] = "";
-                }
-            }
-            return 0;
-        }
-        /// <summary>
-        /// 获取指定节下的Key列表
-        /// </summary>
-        /// <param name="section">指定的节名称</param>
-        /// <param name="path">配置文件名称</param>
-        /// <returns>Key列表</returns>
-        public static List<string> GetAllKeys(string section, string path)
-        {
-            List<string> keyList = new List<string>();
-            byte[] b = new byte[65535];
-            GetPrivateProfileSection(section, b, b.Length, path);
-            string s = System.Text.Encoding.Default.GetString(b);
-            string[] tmp = s.Split((char)0);
-            List<string> result = new List<string>();
-            foreach (string r in tmp)
-            {
-                if (r != string.Empty)
-                    result.Add(r);
-            }
-            for (int i = 0; i < result.Count; i++)
-            {
-                string[] item = result[i].Split(new char[] { '=' });
-                if (item.Length == 2 || item.Length == 1)
-                {
-                    keyList.Add(item[0].Trim());
-                }
-                else if (item.Length == 0)
-                {
-                    keyList.Add(string.Empty);
-                }
-            }
-            return keyList;
-        }
-        /// <summary>
-        /// 获取值
-        /// </summary>
-        /// <param name="section"></param>
-        /// <param name="path"></param>
-        /// <returns></returns>
-        public static List<string> GetAllValues(string section, string path)
-        {
-            List<string> keyList = new List<string>();
-            byte[] b = new byte[65535];
-            GetPrivateProfileSection(section, b, b.Length, path);
-            string s = System.Text.Encoding.Default.GetString(b);
-            string[] tmp = s.Split((char)0);
-            List<string> result = new List<string>();
-            foreach (string r in tmp)
-            {
-                if (r != string.Empty)
-                    result.Add(r);
-            }
-            for (int i = 0; i < result.Count; i++)
-            {
-                string[] item = result[i].Split(new char[] { '=' });
-                if (item.Length == 2 || item.Length == 1)
-                {
-                    keyList.Add(item[1].Trim());
-                }
-                else if (item.Length == 0)
-                {
-                    keyList.Add(string.Empty);
-                }
-            }
-            return keyList;
-        }
-
-        #endregion
-
-        #region 通过值查找键(一个节中的键唯一,可能存在多个键值相同,因此反查的结果可能为多个)
-
-        /// <summary>
-        /// 第一个键
-        /// </summary>
-        /// <param name="section"></param>
-        /// <param name="path"></param>
-        /// <param name="value"></param>
-        /// <returns></returns>
-        public static string GetFirstKeyByValue(string section, string path, string value)
-        {
-            foreach (string key in GetAllKeys(section, path))
-            {
-                if (ReadString(section, key, "", path) == value)
-                {
-                    return key;
-                }
-            }
-            return string.Empty;
-        }
-        /// <summary>
-        /// 所有键
-        /// </summary>
-        /// <param name="section"></param>
-        /// <param name="path"></param>
-        /// <param name="value"></param>
-        /// <returns></returns>
-        public static List<string> GetKeysByValue(string section, string path, string value)
-        {
-            List<string> keys = new List<string>();
-            foreach (string key in GetAllKeys(section, path))
-            {
-                if (ReadString(section, key, "", path) == value)
-                {
-                    keys.Add(key);
-                }
-            }
-            return keys;
-        }
-        #endregion
-
-        #region 具体类型的读写
-
-        #region string
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="sectionName"></param>
-        /// <param name="keyName"></param>
-        /// <param name="defaultValue" />
-        /// <param name="path"></param>
-        /// <returns></returns>
-        public static string ReadString(string sectionName, string keyName, string defaultValue, string path)
-        {
-            const int MAXSIZE = 255;
-            StringBuilder temp = new StringBuilder(MAXSIZE);
-            GetPrivateProfileString(sectionName, keyName, defaultValue, temp, 255, path);
-            return temp.ToString();
-        }
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="sectionName"></param>
-        /// <param name="keyName"></param>
-        /// <param name="value"></param>
-        /// <param name="path"></param>
-        public static void WriteString(string sectionName, string keyName, string value, string path)
-        {
-            WritePrivateProfileString(sectionName, keyName, value, path);
-        }
-        #endregion
-
-        #region Int
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="sectionName"></param>
-        /// <param name="keyName"></param>
-        /// <param name="defaultValue"></param>
-        /// <param name="path"></param>
-        /// <returns></returns>
-        public static int ReadInteger(string sectionName, string keyName, int defaultValue, string path)
-        {
-
-            return GetPrivateProfileInt(sectionName, keyName, defaultValue, path);
-
-        }
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="sectionName"></param>
-        /// <param name="keyName"></param>
-        /// <param name="value"></param>
-        /// <param name="path"></param>
-        public static void WriteInteger(string sectionName, string keyName, int value, string path)
-        {
-
-            WritePrivateProfileString(sectionName, keyName, value.ToString(), path);
-
-        }
-        #endregion
-
-        #region bool
-        /// <summary>
-        /// 读取布尔值
-        /// </summary>
-        /// <param name="sectionName"></param>
-        /// <param name="keyName"></param>
-        /// <param name="defaultValue"></param>
-        /// <param name="path"></param>
-        /// <returns></returns>
-        public static bool ReadBoolean(string sectionName, string keyName, bool defaultValue, string path)
-        {
-
-            int temp = defaultValue ? 1 : 0;
-
-            int result = GetPrivateProfileInt(sectionName, keyName, temp, path);
-
-            return (result == 0 ? false : true);
-
-        }
-        /// <summary>
-        /// 写入布尔值
-        /// </summary>
-        /// <param name="sectionName"></param>
-        /// <param name="keyName"></param>
-        /// <param name="value"></param>
-        /// <param name="path"></param>
-        public static void WriteBoolean(string sectionName, string keyName, bool value, string path)
-        {
-            string temp = value ? "1 " : "0 ";
-            WritePrivateProfileString(sectionName, keyName, temp, path);
-        }
-        #endregion
-
-        #endregion
-
-        #region 删除操作
-        /// <summary>
-        /// 删除指定项
-        /// </summary>
-        /// <param name="sectionName"></param>
-        /// <param name="keyName"></param>
-        /// <param name="path"></param>
-        public static void DeleteKey(string sectionName, string keyName, string path)
-        {
-            WritePrivateProfileString(sectionName, keyName, null, path);
-        }
-
-        /// <summary>
-        /// 删除指定节下的所有项
-        /// </summary>
-        /// <param name="sectionName"></param>
-        /// <param name="path"></param>
-        public static void EraseSection(string sectionName, string path)
-        {
-            WritePrivateProfileString(sectionName, null, null, path);
-        }
-        #endregion
-
-        #region 判断节、键是否存在
-        /// <summary>
-        /// 指定节知否存在
-        /// </summary>
-        /// <param name="section"></param>
-        /// <param name="fileName"></param>
-        /// <returns></returns>
-        public static bool ExistSection(string section, string fileName)
-        {
-            string[] sections = null;
-            GetAllSectionNames(out sections, fileName);
-            if (sections != null)
-            {
-                foreach (var s in sections)
-                {
-                    if (s == section)
-                    {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-        /// <summary>
-        /// 指定节下的键是否存在
-        /// </summary>
-        /// <param name="section"></param>
-        /// <param name="key"></param>
-        /// <param name="fileName"></param>
-        /// <returns></returns>
-        public static bool ExistKey(string section, string key, string fileName)
-        {
-            string[] keys = null;
-            GetAllKeys(section, out keys, fileName);
-            if (keys != null)
-            {
-                foreach (var s in keys)
-                {
-                    if (s == key)
-                    {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-        #endregion
-
-        #region 同一Section下添加多个Key\Value
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="section"></param>
-        /// <param name="keyList"></param>
-        /// <param name="valueList"></param>
-        /// <param name="path"></param>
-        /// <returns></returns>
-        public static bool AddSectionWithKeyValues(string section, List<string> keyList, List<string> valueList, string path)
-        {
-            bool bRst = true;
-            //判断Section是否已经存在,如果存在,返回false
-            //已经存在,则更新
-            //if (GetAllSectionNames(path).Contains(section))
-            //{
-            //    return false;
-            //}
-            //判断keyList中是否有相同的Key,如果有,返回false
-
-            //添加配置信息
-            for (int i = 0; i < keyList.Count; i++)
-            {
-                WriteString(section, keyList[i], valueList[i], path);
-            }
-            return bRst;
-        }
-        #endregion
-    }
-}

+ 0 - 344
OTSIncAReportApp/2-CommonFunction/Language.cs

@@ -1,344 +0,0 @@
-using System;
-using System.Collections;
-using System.Windows.Forms;
-using System.Xml;
-
-namespace OTSIncAReportApp.SysMgrTools
-{
-    /// <summary>
-    /// 国际化语言类型类
-    /// </summary>
-    public class Language
-    {
-
-        #region 构造函数
-        public Language(Form form)
-        {
-            //测试国际化语言版本
-            string Global = "EN";
-            Global = ReadDefaultLanguage();
-            getNames(form, Global);
-        }
-        public Language(UserControl form)
-        {
-            //测试国际化语言版本
-            string Global = "EN";
-            Global = ReadDefaultLanguage();
-            getNames(form, Global);
-        }
-        public Language()
-        {
-
-        }
-        #endregion
-
-        #region 测试国际化语言
-        public Hashtable GetNameTable(string name)
-        {
-            //测试国际化语言版本
-            string Global ;//ZH or  EN
-            Global = ReadDefaultLanguage();
-            return ReadResource(name, Global);
-        }
-        //读取默认语言 
-        public static string ReadDefaultLanguage()
-        {
-            string xmlName = System.Windows.Forms.Application.StartupPath + @"/Resources/XMLData/LanguageDefine.xml";
-            XmlReader reader = XmlReader.Create(xmlName);
-            XmlDocument doc = new XmlDocument();
-            doc.Load(reader);
-            XmlNode root = doc.DocumentElement;
-            //选取DefaultLangugae节点 
-            XmlNode node = root.SelectSingleNode("DefaultLanguage");
-
-            string result = string.Empty;
-            if (node != null)
-                //取出节点中的内容 
-                result = node.InnerText;
-
-            reader.Close();
-            return result;
-        }
-
-        // 获取控件的名称 
-        public static void getNames(Form form, string lang)
-        {
-
-            Hashtable table = ReadResource(form.Name, lang);
-            //将所有控件放入集合
-            Control.ControlCollection controlNames = form.Controls;
-
-            try
-            {
-                //反射   
-                System.Reflection.FieldInfo[] fieldInfo = form.GetType().GetFields(System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
-                for (int i = 0; i < fieldInfo.Length; i++)
-                {
-
-                    if (fieldInfo[i].FieldType.Name == "ContextMenuStrip")
-                    {
-                        ContextMenuStrip contextMenuStrip = (ContextMenuStrip)fieldInfo[i].GetValue(form);
-                        for (int j = 0; j < contextMenuStrip.Items.Count; j++)
-                        {
-                            if (table.Contains(contextMenuStrip.Items[j].Name.ToLower()))
-                                contextMenuStrip.Items[j].Text = (string)table[contextMenuStrip.Items[j].Name.ToLower()];
-                        }
-                    }
-
-                }
-
-                //遍历控件
-                foreach (Control control in controlNames)
-                {
-
-                    if (control.GetType().ToString() == "System.Windows.Forms.DataGridView")
-                    {
-                        for (int i = 0; i < ((DataGridView)control).Columns.Count; i++)
-                        {
-                            if (table.Contains(((DataGridView)control).Columns[i].Name.ToLower()))
-                                ((DataGridView)control).Columns[i].HeaderText = table[((DataGridView)control).Columns[i].Name.ToLower()].ToString();
-                        }
-                    }
-                    if (control.GetType().ToString() == "System.Windows.Forms.Ribbon")
-                    {
-                        System.Windows.Forms.Ribbon rib = (System.Windows.Forms.Ribbon)control;
-                        for (int i = 0; i < rib.Tabs.Count; i++)
-                        {
-                            for (int j = 0; j < rib.Tabs[i].Panels.Count; j++)
-                            {
-
-                                for (int k = 0; k < rib.Tabs[i].Panels[j].Items.Count; k++)
-                                {
-                                    if (rib.Tabs[i].Panels[j].Items[k].Tag != null)
-                                    {
-                                        string name = rib.Tabs[i].Panels[j].Items[k].Tag.ToString().ToLower();
-                                        if (table.Contains(name))
-                                            rib.Tabs[i].Panels[j].Items[k].Text = (string)table[name];
-                                    }
-                                }
-                                if (rib.Tabs[i].Panels[j].Tag != null)
-                                {
-                                    if (rib.Tabs[i].Panels[j].Tag != null)
-                                    {
-                                        string pan = rib.Tabs[i].Panels[j].Tag.ToString().ToLower();
-                                        if (table.Contains(pan))
-                                        { rib.Tabs[i].Panels[j].Text = (string)table[pan]; }
-                                    }
-                                }
-
-
-                            }
-                            if (rib.Tabs[i].Tag != null)
-                            {
-                                string tab = rib.Tabs[i].Tag.ToString().ToLower();
-                                if (table.Contains(tab))
-                                { rib.Tabs[i].Text = (string)table[tab]; }
-                            }
-                        }
-                        for (int i = 0; i < rib.OrbDropDown.MenuItems.Count; i++)
-                        {
-                            if (rib.OrbDropDown.MenuItems[i].Tag != null)
-                            {
-                                string item = rib.OrbDropDown.MenuItems[i].Tag.ToString().ToLower();
-                                if (table.Contains(item))
-                                { rib.OrbDropDown.MenuItems[i].Text = (string)table[item]; }
-                            }
-
-                        }
-                        for (int i = 0; i < rib.OrbDropDown.OptionItems.Count; i++)
-                        {
-                            string item = rib.OrbDropDown.OptionItems[i].Tag.ToString().ToLower();
-                            if (table.Contains(item))
-                            { rib.OrbDropDown.OptionItems[i].Text = (string)table[item]; }
-                        }
-                    }
-                    if (control.GetType().ToString() == "System.Windows.Forms.StatusStrip")
-                    {
-                        StatusStrip st = (StatusStrip)control;
-                        for (int i = 0; i < st.Items.Count; i++)
-                        {
-                            if (table.Contains(st.Items[i].Name.ToLower()))
-                                st.Items[i].Text = (string)table[st.Items[i].Name.ToLower()];
-                        }
-                    }
-
-
-                    if (control.Controls.Count > 0)
-                    {
-                        GetSubControls(control.Controls, table);
-                    }
-                    if (table.Contains(control.Name.ToLower()))
-                        control.Text = (string)table[control.Name.ToLower()];
-                }
-                if (table.Contains(form.Name.ToLower()))
-                    form.Text = (string)table[form.Name.ToLower()];
-            }
-            catch (Exception ex)
-            {
-                Console.WriteLine(ex.ToString());
-            }
-        }
-        // 获取控件的名称 
-        public static void getNames(UserControl form, string lang)
-        {
-
-            Hashtable table = ReadResource(form.Name, lang);
-            //将所有控件放入集合
-            Control.ControlCollection controlNames = form.Controls;
-
-            try
-            {
-                //反射   
-                System.Reflection.FieldInfo[] fieldInfo = form.GetType().GetFields(System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
-                for (int i = 0; i < fieldInfo.Length; i++)
-                {
-
-                    if (fieldInfo[i].FieldType.Name == "ContextMenuStrip")
-                    {
-                        ContextMenuStrip contextMenuStrip = (ContextMenuStrip)fieldInfo[i].GetValue(form);
-                        for (int j = 0; j < contextMenuStrip.Items.Count; j++)
-                        {
-                            if (table.Contains(contextMenuStrip.Items[j].Name.ToLower()))
-                                contextMenuStrip.Items[j].Text = (string)table[contextMenuStrip.Items[j].Name.ToLower()];
-                        }
-                    }
-
-                }
-                //遍历控件
-                foreach (Control control in controlNames)
-                {
-
-                    if (control.GetType().ToString() == "System.Windows.Forms.DataGridView")
-                    {
-                        for (int i = 0; i < ((DataGridView)control).Columns.Count; i++)
-                        {
-                            if (table.Contains(((DataGridView)control).Columns[i].Name.ToLower()))
-                                ((DataGridView)control).Columns[i].HeaderText = table[((DataGridView)control).Columns[i].Name.ToLower()].ToString();
-                        }
-                    }
-                    if (control.GetType().ToString() == "System.Windows.Forms.Ribbon")
-                    {
-                        System.Windows.Forms.Ribbon rib = (System.Windows.Forms.Ribbon)control;
-                        for (int i = 0; i < rib.Tabs.Count; i++)
-                        {
-                            for (int j = 0; j < rib.Tabs[i].Panels.Count; j++)
-                            {
-
-                                for (int k = 0; k < rib.Tabs[i].Panels[j].Items.Count; k++)
-                                {
-                                    string name = rib.Tabs[i].Panels[j].Items[k].Tag.ToString().ToLower();
-                                    if (table.Contains(name))
-                                        rib.Tabs[i].Panels[j].Items[k].Text = (string)table[name];
-                                }
-                                if (rib.Tabs[i].Panels[j].Tag != null)
-                                {
-                                    string pan = rib.Tabs[i].Panels[j].Tag.ToString().ToLower();
-                                    if (table.Contains(pan))
-                                    { rib.Tabs[i].Panels[j].Text = (string)table[pan]; }
-                                }
-
-
-                            }
-                            if (rib.Tabs[i].Tag != null)
-                            {
-                                string tab = rib.Tabs[i].Tag.ToString().ToLower();
-                                if (table.Contains(tab))
-                                { rib.Tabs[i].Text = (string)table[tab]; }
-                            }
-                        }
-                        for (int i = 0; i < rib.OrbDropDown.MenuItems.Count; i++)
-                        {
-                            string item = rib.OrbDropDown.MenuItems[i].Tag.ToString().ToLower();
-                            if (table.Contains(item))
-                            { rib.OrbDropDown.MenuItems[i].Text = (string)table[item]; }
-                        }
-                        for (int i = 0; i < rib.OrbDropDown.OptionItems.Count; i++)
-                        {
-                            string item = rib.OrbDropDown.OptionItems[i].Tag.ToString().ToLower();
-                            if (table.Contains(item))
-                            { rib.OrbDropDown.OptionItems[i].Text = (string)table[item]; }
-                        }
-                    }
-                    if (control.GetType().ToString() == "System.Windows.Forms.StatusStrip")
-                    {
-                        StatusStrip st = (StatusStrip)control;
-                        for (int i = 0; i < st.Items.Count; i++)
-                        {
-                            if (table.Contains(st.Items[i].Name.ToLower()))
-                                st.Items[i].Text = (string)table[st.Items[i].Name.ToLower()];
-                        }
-                    }
-                    if (control.Controls.Count > 0)
-                    {
-                        GetSubControls(control.Controls, table);
-                    }
-                    if (table.Contains(control.Name.ToLower()))
-                        control.Text = (string)table[control.Name.ToLower()];
-                }
-                if (table.Contains(form.Name.ToLower()))
-                    form.Text = (string)table[form.Name.ToLower()];
-            }
-            catch (Exception ex)
-            {
-                Console.WriteLine(ex.ToString());
-            }
-        }
-        //frmName是窗体的Name,lang是要显示的语言(如ZH或EN), Hashtable的Key值就是Name属性的值,其value值就是Text属性将要显示的值
-        public static Hashtable ReadResource(string frmName, string lang)
-        {
-            Hashtable result = new Hashtable();
-
-            XmlReader reader = null;
-
-            reader = new XmlTextReader(System.Windows.Forms.Application.StartupPath + @"/Resources/XMLData/AppResource_" + lang + ".xml");
-
-            XmlDocument doc = new XmlDocument();
-            doc.Load(reader);
-
-            XmlNode root = doc.DocumentElement;
-            XmlNodeList nodelist = root.SelectNodes("Form[Name='" + frmName + "']/Controls/Control");
-            foreach (XmlNode node in nodelist)
-            {
-                try
-                {
-                    XmlNode node1 = node.SelectSingleNode("@name");
-                    XmlNode node2 = node.SelectSingleNode("@text");
-                    if (node1 != null)
-                    {
-                        result.Add(node1.InnerText.ToLower(), node2.InnerText);
-                    }
-                }
-                catch (FormatException fe)
-                {
-                    Console.WriteLine(fe.ToString());
-                }
-            }
-            reader.Close();
-
-            return result;
-        }
-
-        // 获得子控件的显示名 ,读取控件中子控件的显示值
-        private static void GetSubControls(Control.ControlCollection controls, Hashtable table)
-        {
-            foreach (Control control in controls)
-            {
-                if (control.GetType().ToString() == "System.Windows.Forms.DataGridView")
-                {
-                    for (int i = 0; i < ((DataGridView)control).Columns.Count; i++)
-                    {
-                        if (table.Contains(((DataGridView)control).Columns[i].Name.ToLower()))
-                            ((DataGridView)control).Columns[i].HeaderText = table[((DataGridView)control).Columns[i].Name.ToLower()].ToString();
-                    }
-                }
-
-                if (control.Controls.Count > 0)
-                    GetSubControls(control.Controls, table);
-
-                if (table.Contains(control.Name.ToLower()))
-                    control.Text = (string)table[control.Name.ToLower()];
-            }
-        }
-        #endregion
-    }
-}

+ 0 - 44
OTSIncAReportApp/2-CommonFunction/MemoryManagement.cs

@@ -1,44 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace OTSIncAReportApp
-{
-    public static class MemoryManagementClass
-    {
-        /// <summary>
-        /// 回收内存
-        /// </summary>
-        public static void FlushMemory()
-        {
-            //回收内存
-            MemoryManagement mm = new MemoryManagement();
-            mm.FlushMemory();
-        }
-
-
-        [System.Runtime.InteropServices.DllImport("coredll.dll")]
-        [return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)]
-        public static extern bool DeleteObject(IntPtr hgdiobj);
-
-        public class MemoryManagement
-        {
-            [System.Runtime.InteropServices.DllImport("kernel32.dll")]
-            public static extern bool SetProcessWorkingSetSize(IntPtr proc, int min, int max);
-
-            public void FlushMemory()
-            {
-                GC.Collect();
-                GC.WaitForPendingFinalizers();
-                if (Environment.OSVersion.Platform == PlatformID.Win32NT)
-                { SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1); }
-            }
-        }
-
-
-    }
-
-
-}

+ 0 - 200
OTSIncAReportApp/2-CommonFunction/XmlConfigUtil.cs

@@ -1,200 +0,0 @@
-using System;
-using System.IO;
-using System.Linq;
-using System.Xml;
-
-namespace OTSIncAReportApp.Controls
-{
-    /// <summary>
-    /// XML操作类
-    /// </summary>
-    public class XmlConfigUtil
-    {
-        #region 全局变量
-        string _xmlPath;        //文件所在路径
-        #endregion
-
-        #region 构造函数
-        /// <summary>
-        /// 初始化一个配置
-        /// </summary>
-        /// <param name="xmlPath">配置所在路径</param>
-        public XmlConfigUtil(string xmlPath)
-        {
-            _xmlPath = Path.GetFullPath(xmlPath);
-        }
-        #endregion
-
-        #region 公有方法
-        /// <summary>
-        /// 写入配置,也可以用来修改
-        /// </summary>
-        /// <param name="value">写入的值</param>
-        /// <param name="nodes">节点</param>
-        public void Write(string value, params string[] nodes)
-        {
-            //初始化xml
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath))
-                xmlDoc.Load(_xmlPath);
-            else
-                xmlDoc.LoadXml("<XmlConfig />");
-            XmlNode xmlRoot = xmlDoc.ChildNodes[0];
-
-            //新增、编辑 节点
-            string xpath = string.Join("/", nodes);
-            XmlNode node = xmlDoc.SelectSingleNode(xpath);
-            if (node == null)    //新增节点
-            {
-                node = makeXPath(xmlDoc, xmlRoot, xpath);
-            }
-            node.InnerText = value;
-
-            //保存
-            xmlDoc.Save(_xmlPath);
-        }
-
-        /// <summary>
-        /// 设置节点上属性的值
-        /// </summary>
-        /// <param name="AttributeName">属性名</param>
-        /// <param name="AttributeValue">属性值</param>
-        /// <param name="nodes">选择节点</param>
-        public void SetAttribute(string AttributeName, string AttributeValue, params string[] nodes)
-        {
-            //初始化xml
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath))
-                xmlDoc.Load(_xmlPath);
-            else
-                xmlDoc.LoadXml("<XmlConfig />");
-            XmlNode xmlRoot = xmlDoc.ChildNodes[0];
-
-            //新增、编辑 节点
-            string xpath = string.Join("/", nodes);
-            XmlElement element = (XmlElement)xmlDoc.SelectSingleNode(xpath);
-            if (element == null)    //新增节点
-            {
-                element = (XmlElement)makeXPath(xmlDoc, xmlRoot, xpath);
-            }
-
-            //设置节点上属性的值
-            element.SetAttribute(AttributeName, AttributeValue);
-            //保存
-            xmlDoc.Save(_xmlPath);
-        }
-
-        public string GetAttribute(string AttributeName, params string[] nodes)
-        {
-            //初始化xml
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath))
-                xmlDoc.Load(_xmlPath);
-            else
-                xmlDoc.LoadXml("<XmlConfig />");
-            XmlNode xmlRoot = xmlDoc.ChildNodes[0];
-
-            //新增、编辑 节点
-            string xpath = string.Join("/", nodes);
-            XmlElement element = (XmlElement)xmlDoc.SelectSingleNode(xpath);
-            if (element == null)    //新增节点
-            {
-                element = (XmlElement)makeXPath(xmlDoc, xmlRoot, xpath);
-            }
-
-            //设置节点上属性的值
-            string retstr = element.GetAttribute(AttributeName);
-            //保存
-            xmlDoc.Save(_xmlPath);
-
-            return retstr;
-        }
-
-
-        /// <summary>
-        /// 读取配置
-        /// </summary>
-        /// <param name="nodes">节点</param>
-        /// <returns></returns>
-        public string Read(params string[] nodes)
-        {
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath) == false)
-                return null;
-            else
-                xmlDoc.Load(_xmlPath);
-
-            string xpath = string.Join("/", nodes);
-            XmlNode node = xmlDoc.SelectSingleNode("/XmlConfig/" + xpath);
-            if (node == null)
-                return null;
-
-            return node.InnerText;
-        }
-
-        /// <summary>
-        /// 删除节点
-        /// </summary>
-        /// <param name="nodes"></param>
-        public void RemoveNode(params string[] nodes)
-        {
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath) == false)
-                return;
-            else
-                xmlDoc.Load(_xmlPath);
-
-            string xpath = string.Join("/", nodes);
-            XmlNode node = xmlDoc.SelectSingleNode("/XmlConfig/" + xpath);
-
-            //取得父节点
-            string[] father_nodes = new string[nodes.Count() - 1];
-
-            //对父节点进行初始化
-            for (int i = 0; i < nodes.Count() - 1; i++)
-            {
-                father_nodes[i] = (string)nodes[i].Clone();
-            }
-
-
-            string fast_xpath = string.Join("/", father_nodes);
-            XmlNode fastnode = xmlDoc.SelectSingleNode("/XmlConfig/" + fast_xpath);
-
-            if (node == null)
-                return;
-            if (fastnode == null)
-                return;
-
-            //使用父节点删除子节点
-            fastnode.RemoveChild(node);
-
-            //保存
-            xmlDoc.Save(_xmlPath);
-        }
-
-
-        #endregion
-
-        #region 私有方法
-        //递归根据 xpath 的方式进行创建节点
-        static private XmlNode makeXPath(XmlDocument doc, XmlNode parent, string xpath)
-        {
-
-            // 在XPath抓住下一个节点的名称;父级如果是空的则返回
-            string[] partsOfXPath = xpath.Trim('/').Split('/');
-            string nextNodeInXPath = partsOfXPath.First();
-            if (string.IsNullOrEmpty(nextNodeInXPath))
-                return parent;
-
-            // 获取或从名称创建节点
-            XmlNode node = parent.SelectSingleNode(nextNodeInXPath);
-            if (node == null)
-                node = parent.AppendChild(doc.CreateElement(nextNodeInXPath));
-
-            // 加入的阵列作为一个XPath表达式和递归余数
-            string rest = String.Join("/", partsOfXPath.Skip(1).ToArray());
-            return makeXPath(doc, node, rest);
-        }
-        #endregion
-    }
-}

+ 2 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -375,6 +375,8 @@
     <Compile Include="2-CommonFunction\CommonClass\Language.cs" />
     <Compile Include="2-CommonFunction\CommonClass\MemoryManagement.cs" />
     <Compile Include="2-CommonFunction\CommonClass\XmlConfigUtil.cs" />
+    <Compile Include="2-CommonFunction\OTSDataMgrFunction\ResourceID.cs" />
+    <Compile Include="2-CommonFunction\OTSDataMgrFunction\XmlResourceData.cs" />
     <Compile Include="3-ServiceCenter\DataOperation\DataAccess\FeatureData.cs" />
     <Compile Include="3-ServiceCenter\DataOperation\DataAccess\FieldData.cs" />
     <Compile Include="3-ServiceCenter\DataOperation\DataAccess\OtherDB.cs" />

+ 0 - 165
OTSIncAReportApp/XmlResourceData.cs

@@ -1,165 +0,0 @@
-using System.Collections.Generic;
-using System.Xml;
-
-namespace OTSDataType
-{
-    public struct StringRes
-    {
-        public int key;
-        public string text;
-        public string Description;
-        public string DownList;
-
-    }
-    public class ResGroup
-    {
-        public int key;
-        public string text = "";
-        public string Description = "";
-        public string DownList = "";
-        public SortedDictionary<int, StringRes> mapRes = new SortedDictionary<int, StringRes>();
-    }
-   public  class XmlResourceData
-    {
-        static XmlResourceData instance =new XmlResourceData();
-        private SortedDictionary<int, ResGroup> resGroup = new SortedDictionary<int, ResGroup>();
-        public XmlResourceData()
-        {
-            LoadStringFromXml();
-        }
-        public void GetStringByKey(int grpKey, int itmKey, ref string text, ref string des,ref string downlist)
-        {
-            text = resGroup[grpKey].mapRes[itmKey].text;
-            des = resGroup[grpKey].mapRes[itmKey].Description;
-            downlist = resGroup[grpKey].mapRes[itmKey].DownList;
-        }
-        public string GetStringByKey(int grpKey, int itmKey)
-        {
-            return resGroup[grpKey].mapRes[itmKey].text;
-        }
-
-        public string GetStringByKey(int itmKey)
-        {
-            return resGroup[0].mapRes[itmKey].text;
-        }
-        public string GetGroupTextByKey(int grpKey)
-        {
-            return resGroup[grpKey].text;
-        }
-
-        public void GetGroupTextByKey(int grpKey, ref string text, ref string des)
-        {
-            text = resGroup[grpKey].text;
-            des = resGroup[grpKey].Description;
-        }
-
-        public void SetStringByKey(int grpkey, int itmkey, string value, string des)
-        {
-            StringRes sr = new StringRes();
-            sr.text = value;
-            sr.Description = des;
-            resGroup[grpkey].mapRes[itmkey] = sr;
-        }
-
-        public bool LoadStringFromXml()
-        {
-            XmlDocument xml = new XmlDocument();
-            xml.Load(".\\Resources\\XMLData\\LanguageDefine.xml");
-            XmlNode root = xml.SelectSingleNode("Language");
-            XmlNode root2 = root.SelectSingleNode("DefaultLanguage");
-            string ss = root2.InnerText;
-
-            XmlDocument doc1 = new XmlDocument();
-            if (ss == "EN")
-            {
-                doc1.Load(".\\Resources\\XMLData\\ResourceForCpp\\ResourceForReport-EN.xml");//载入xml文件
-            }
-            else if (ss == "ZH")
-            {
-                doc1.Load(".\\Resources\\XMLData\\ResourceForCpp\\ResourceForReport-ZH.xml");//载入xml文件
-            }
-
-            root = doc1.SelectSingleNode("XMLData");
-            root2 = root.SelectSingleNode("collection");
-
-           
-            XmlNodeList childlist = root2.ChildNodes;
-            for (int i = 0; i < childlist.Count; i++)
-            {
-                int colkey = -1;
-                if (childlist[i].Attributes["grpKey"] != null)
-                {
-
-                    colkey = int.Parse(childlist[i].Attributes["grpKey"].Value);
-                }
-                string colText = "";
-                if (childlist[i].Attributes["text"] != null)
-                {
-
-                    colText = childlist[i].Attributes["text"].Value;
-                }
-                string colDes = "";
-                if (childlist[i].Attributes["description"] != null)
-                {
-
-                    colDes = childlist[i].Attributes["description"].Value;
-                }
-                ResGroup rg = new ResGroup();
-                rg.key = colkey;
-                rg.text = colText;
-                rg.Description = colDes;
-                
-
-                XmlNodeList childlist2 = childlist[i].ChildNodes;
-                for (int j = 0; j < childlist2.Count; j++)
-                {
-                    StringRes sr = new StringRes();
-                    int key = int.Parse(childlist2[j].Attributes["itemKey"].Value);
-                    sr.key = key;
-                    sr.text = childlist2[j].Attributes["itemText"].Value;
-
-                    if (childlist2[j].Attributes["boDownList"] != null)
-                    {
-                        sr.DownList = childlist2[j].Attributes["boDownList"].Value;
-                    }
-                    else
-                    {
-                        sr.DownList = "空";
-                    }
-
-
-                    if (childlist2[j].Attributes["description"] != null)
-                    {
-                        sr.Description = childlist2[j].Attributes["description"].Value;
-                    }
-                    else
-                    {
-                        sr.Description = "空";
-                    }
-                    try
-                    {
-                        rg.mapRes[key] = sr;
-                    }
-                    catch (System.Exception ex)
-                    {
-                       // MessageBox.Show(ex.ToString());
-                    }
-                }
-                resGroup[colkey] = rg;
-            }
-            return true;
-        }
-       
-        public static XmlResourceData GetInstance()
-        {
-            //static MultiLang instance;
-            if (instance == null)
-            {
-                instance.LoadStringFromXml();
-            }
-           
-            return instance;
-        }
-
-    }
-}

+ 0 - 298
OTSIncAReportApp/sampleReportInfo.cd

@@ -1,298 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ClassDiagram MajorVersion="1" MinorVersion="1" MembersFormat="NameAndType">
-  <Comment CommentText="封装的测量结果类,内包含sourcegrid与treeview成员">
-    <Position X="1.666" Y="2.062" Height="0.678" Width="1.604" />
-  </Comment>
-  <Comment CommentText="属性Grid窗体">
-    <Position X="1.576" Y="21.988" Height="0.407" Width="1.628" />
-  </Comment>
-  <Comment CommentText="报告主窗体">
-    <Position X="6.262" Y="8.751" Height="0.367" Width="1.149" />
-  </Comment>
-  <Comment CommentText="对话框选项类">
-    <Position X="6.072" Y="0.716" Height="0.423" Width="1.468" />
-  </Comment>
-  <Comment CommentText="测量结果类,树节点">
-    <Position X="9.401" Y="3.244" Height="0.343" Width="1.428" />
-  </Comment>
-  <Comment CommentText="测量结果,树节点中包含的各内容">
-    <Position X="9.553" Y="5.009" Height="0.431" Width="1.58" />
-  </Comment>
-  <Comment CommentText="测量结果窗体类,包含所有的测量结果树节点">
-    <Position X="5.764" Y="2.48" Height="0.486" Width="1.628" />
-  </Comment>
-  <Comment CommentText="类型定义">
-    <Position X="10.62" Y="0.731" Height="0.3" Width="1.133" />
-  </Comment>
-  <Comment CommentText="主工作区的枚举">
-    <Position X="12.534" Y="0.792" Height="0.292" Width="1.7" />
-  </Comment>
-  <Comment CommentText="当前软件的类型,类别">
-    <Position X="17.678" Y="1.028" Height="0.295" Width="1.612" />
-  </Comment>
-  <Comment CommentText="与底层交互表示某个功能的枚举">
-    <Position X="15.166" Y="1.004" Height="0.439" Width="1.7" />
-  </Comment>
-  <Comment CommentText="报告分组选项">
-    <Position X="20.295" Y="1.006" Height="0.399" Width="1.764" />
-  </Comment>
-  <Comment CommentText="发送消息事件类">
-    <Position X="10.707" Y="8.444" Height="0.295" Width="1.317" />
-  </Comment>
-  <Comment CommentText="接收消息事件类">
-    <Position X="11.258" Y="10.944" Height="0.287" Width="1.341" />
-  </Comment>
-  <Comment CommentText="分析图窗体">
-    <Position X="11.551" Y="12.993" Height="0.359" Width="1.309" />
-  </Comment>
-  <Comment CommentText="表格窗体">
-    <Position X="14.418" Y="14.742" Height="0.284" Width="1.7" />
-  </Comment>
-  <Comment CommentText="图表窗体">
-    <Position X="10.963" Y="17.231" Height="0.303" Width="1.013" />
-  </Comment>
-  <Comment CommentText="报告与底层c++进行通讯操作的封装类">
-    <Position X="15.152" Y="20.024" Height="0.486" Width="1.7" />
-  </Comment>
-  <Comment CommentText="测量结果树控件窗体">
-    <Position X="11.033" Y="21.389" Height="0.391" Width="1.572" />
-  </Comment>
-  <Comment CommentText="测量结果树控件封装类">
-    <Position X="10.554" Y="33.514" Height="0.463" Width="1.46" />
-  </Comment>
-  <Comment CommentText="编辑框">
-    <Position X="2.003" Y="13.093" Height="0.303" Width="1.261" />
-  </Comment>
-  <Comment CommentText="复选框事件类">
-    <Position X="1.766" Y="14.359" Height="0.303" Width="1.468" />
-  </Comment>
-  <Comment CommentText="组合框选项对象类">
-    <Position X="1.98" Y="16.22" Height="0.284" Width="1.341" />
-  </Comment>
-  <Comment CommentText="与底层互通组合选择条件的类">
-    <Position X="1.58" Y="17.982" Height="0.423" Width="1.652" />
-  </Comment>
-  <Class Name="OTSIncAReportApp.OTSSampleReportInfo.CTreeSampleParam">
-    <Position X="5.25" Y="28.75" Width="2" />
-    <TypeIdentifier>
-      <HashCode>AAAAABAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSSampleReportInfo.SampleData">
-    <Position X="1.75" Y="30" Width="1.75" />
-    <TypeIdentifier>
-      <HashCode>AAAAAEAAAAAEAAAAAEAAAAAAAEAIAAAAAAAAAAAAASA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSSampleReportInfo.OTSSampleMeaInfo">
-    <Position X="4" Y="25.5" Width="2.25" />
-    <Compartments>
-      <Compartment Name="Nested Types" Collapsed="false" />
-    </Compartments>
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAAEAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="TSampleParam" />
-    </ShowAsAssociation>
-    <ShowAsCollectionAssociation>
-      <Field Name="SampleDataList" />
-    </ShowAsCollectionAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSDataMgrFunction.SampleGrid" HideInheritanceLine="true">
-    <Position X="0.5" Y="13.75" Width="2.75" />
-    <Compartments>
-      <Compartment Name="Nested Types" Collapsed="false" />
-    </Compartments>
-    <NestedTypes>
-      <Class Name="OTSIncAReportApp.OTSDataMgrFunction.SampleGrid.ChangeGridCellValEvent">
-        <TypeIdentifier>
-          <NewMemberFileName>OTSDisplaySGridData\SampleGrid.cs</NewMemberFileName>
-        </TypeIdentifier>
-      </Class>
-      <Class Name="OTSIncAReportApp.OTSDataMgrFunction.SampleGrid.ItemValueChange2" Collapsed="true">
-        <TypeIdentifier>
-          <NewMemberFileName>OTSDisplaySGridData\SampleGrid.cs</NewMemberFileName>
-        </TypeIdentifier>
-      </Class>
-      <Class Name="OTSIncAReportApp.OTSDataMgrFunction.SampleGrid.SelcetCheckBoxEvent" Collapsed="true">
-        <TypeIdentifier>
-          <NewMemberFileName>OTSDisplaySGridData\SampleGrid.cs</NewMemberFileName>
-        </TypeIdentifier>
-      </Class>
-      <Class Name="OTSIncAReportApp.OTSDataMgrFunction.SampleGrid.EditorFileDialog" Collapsed="true">
-        <TypeIdentifier>
-          <NewMemberFileName>OTSDisplaySGridData\SampleGrid.cs</NewMemberFileName>
-        </TypeIdentifier>
-      </Class>
-    </NestedTypes>
-    <TypeIdentifier>
-      <HashCode>AAAAMgQEAAABAARAAEQQAgCBEAAECAg0IEBEAAmgAAA=</HashCode>
-      <FileName>OTSDisplaySGridData\SampleGrid.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="m_WSampleInfo" />
-    </ShowAsAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmReportApp">
-    <Position X="7.75" Y="9.5" Width="2.75" />
-    <Compartments>
-      <Compartment Name="Properties" Collapsed="true" />
-    </Compartments>
-    <TypeIdentifier>
-      <HashCode>J0IJgk8FQiBEzIZaRUDAoi3LFmZmjOk5nBQAhA5mp5M=</HashCode>
-      <FileName>frmReportApp.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="m_RstWindow" />
-      <Field Name="m_PropWindow" />
-      <Field Name="m_SImageWindow" />
-      <Field Name="m_CChartsWindow" />
-      <Field Name="m_CTablesWindow" />
-      <Field Name="m_DataMgrFun" />
-      <Field Name="im_ChineseStandardABCDDS" />
-      <Field Name="m_sec" />
-      <Field Name="m_rec" />
-    </ShowAsAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSDataMgrFunction.DataMgrFun" HideInheritanceLine="true">
-    <Position X="11.75" Y="12.75" Width="2.5" />
-    <TypeIdentifier>
-      <HashCode>QYQgkIkDIQEUICaBUgQAByAAIAxAACAiJDChAopQAAk=</HashCode>
-      <FileName>OTSDataMgrFunction\DataMgrFun.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmCharts">
-    <Position X="12" Y="32.75" Width="3.25" />
-    <NestedTypes>
-      <Struct Name="OTSIncAReportApp.frmCharts.CustomTemplatePara" Collapsed="true">
-        <TypeIdentifier>
-          <NewMemberFileName>frmCharts.cs</NewMemberFileName>
-        </TypeIdentifier>
-      </Struct>
-    </NestedTypes>
-    <TypeIdentifier>
-      <HashCode>AAABEgAQASRAEBBCCAWCAAECAAAACCgAEAgAAAAAABg=</HashCode>
-      <FileName>frmCharts.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmTables">
-    <Position X="4" Y="34.5" Width="3.25" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAACAAAAAAAACAAAACAAAAACAAAAAAAAAABAA=</HashCode>
-      <FileName>frmTables.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.RecevieEvent">
-    <Position X="4.5" Y="19.75" Width="2.75" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAA=</HashCode>
-      <FileName>RecevieEvent.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmSampleImage">
-    <Position X="4.5" Y="21.75" Width="2.25" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAACAAAAAAAACAAAACAAAAACAAAAAAAABAAAA=</HashCode>
-      <FileName>frmSampleImage.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportMailInterface.SendEventClass">
-    <Position X="6.75" Y="6.25" Width="3.75" />
-    <TypeIdentifier>
-      <HashCode>AgAEAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAACAAA=</HashCode>
-      <FileName>Control_MailInterface\SendEventClass.cs</FileName>
-    </TypeIdentifier>
-    <Lollipop Position="0.2" />
-  </Class>
-  <Class Name="OTSIncAReportApp.frmMeasureRstProp">
-    <Position X="4.5" Y="14.5" Width="2.5" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAACAAAAAAAQCAAAACAAAQACEABAAAAAACgAA=</HashCode>
-      <FileName>frmMeasureRstProp.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="m_SampleGrid" />
-    </ShowAsAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.frmMeasureRstMgr">
-    <Position X="11.75" Y="0.5" Width="3.75" />
-    <Compartments>
-      <Compartment Name="Nested Types" Collapsed="false" />
-    </Compartments>
-    <NestedTypes>
-      <Struct Name="OTSIncAReportApp.frmMeasureRstMgr.TVITEM">
-        <TypeIdentifier>
-          <NewMemberFileName>frmMeasureRstMgr.cs</NewMemberFileName>
-        </TypeIdentifier>
-      </Struct>
-    </NestedTypes>
-    <TypeIdentifier>
-      <HashCode>ogAIQAEBACgAggVEACCBIAQOAIIIACIABkAAAAQkACA=</HashCode>
-      <FileName>frmMeasureRstMgr.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="m_TreeViewData" />
-    </ShowAsAssociation>
-  </Class>
-  <Class Name="OTSIncAReportApp.OTSDataMgrFunction.OTSTreeViewData">
-    <Position X="16.25" Y="4.25" Width="2.75" />
-    <TypeIdentifier>
-      <HashCode>gAABAAAAAAkAAAAEACAAAIAAAAABAAQEAEAAAAAAAAA=</HashCode>
-      <FileName>OTSTreeViewData\OTSTreeViewData.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportGrids.ChineseStandardABCDDS" Collapsed="true">
-    <Position X="1.25" Y="10.5" Width="3.5" />
-    <TypeIdentifier>
-      <HashCode>cA+AIH0CC7CEABDSAGjAQADKQCCAAAADAASABUQggBM=</HashCode>
-      <FileName>Control_Grids\ChineseStandardABCDDS.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Enum Name="OTSIncAReportApp.OTSSampleReportInfo.DisplayPicutureType" Collapsed="true">
-    <Position X="23.5" Y="1.25" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>QAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Enum>
-  <Enum Name="OTSIncAReportApp.OTSSampleReportInfo.OTS_SOFT_PACKAGE_ID" Collapsed="true">
-    <Position X="21.75" Y="1.25" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAIAAAAAA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Enum>
-  <Enum Name="OTSIncAReportApp.OTSSampleReportInfo.OTS_RETORT_PROP_GRID_ITEMS" Collapsed="true">
-    <Position X="20" Y="1.25" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>AIAAAJQAkAAAAACCIEAAAAQAEAAAABABKAAEAAAAABA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Enum>
-  <Enum Name="OTSIncAReportApp.OTSSampleReportInfo.COMPUTE_TABLE_TYPE" Collapsed="true">
-    <Position X="20" Y="0.5" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>IAACARABQACAAgQAABRAANASACACEBAAAAAAAAAAEBA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Enum>
-  <Enum Name="OTSIncAReportApp.OTSSampleReportInfo.OTS_ITEM_TYPES" Collapsed="true">
-    <Position X="23.5" Y="0.5" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>AAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAgAAAAIAAAAAA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Enum>
-  <Enum Name="OTSIncAReportApp.OTSSampleReportInfo.MessageBoxRev" Collapsed="true">
-    <Position X="21.75" Y="0.5" Width="1.5" />
-    <TypeIdentifier>
-      <HashCode>AAAAgAAAAAAAAAAAAAAAAAAACAAIAAAAAAAAAAAAAAA=</HashCode>
-      <FileName>OTSSampleReportInfo\OTSSampleReportInfo.cs</FileName>
-    </TypeIdentifier>
-  </Enum>
-  <Font Name="Microsoft YaHei UI" Size="9" />
-</ClassDiagram>