Procházet zdrojové kódy

增加选择颗粒,报告导出功能

zhangjiaxin před 3 roky
rodič
revize
99196d9d2b

+ 155 - 39
OTSIncAReportApp/1-UI/Control_ECharts/EChart_ParticlesComposition.cs

@@ -42,6 +42,10 @@ namespace OTSIncAReportApp.Control_ECharts
         //数据图类型:常用夹杂物分类CommonlyUsedClassify ,颗粒成分PComponent,元素成分EComponent,颗粒尺寸分布PSize
         string ComSel { get; set; }
         public bool Report { get; set; }
+        /// <summary>
+        /// 选择颗粒范围(true为全部颗粒false为选择颗粒)
+        /// </summary>
+        public bool ParticleRange { set; get; }
         frmReportApp m_ReportApp;
         List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
         List<string> NameList = new List<string>() { "过小颗粒", "过大颗粒", "亮度不在分析范围内的颗粒", "低计数率颗粒", "不含分析元素的颗粒", "非夹杂物颗粒SiC", "非夹杂物颗粒FeO", "未识别颗粒" };
@@ -64,45 +68,31 @@ namespace OTSIncAReportApp.Control_ECharts
 
             m_export_reporttemplate = new Export_ReportTemplate();
         }
-        public void EChart_ParticlesComposition_Report(string sou )
-        {
-            NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString() };
-
-            //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
-            //string sou = m_ReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString();
-            //string sou = m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
-           
-                if (!m_ReportApp.more)
-                {
-                    m_ReportApp.trans = false;
-                }
-                else
-                {
-                    m_ReportApp.trans = true;
-                }
-                m_ReportApp.more = false;
-                //获取到List,json的字符串
-                List<Chartdate> list_json_str = GetListJsonStrByChartStruct();
-                url = "Resources/HTML/charts.html";
-                m_ReportApp.data = JsonConvert.SerializeObject(list_json_str[0]);
-          
-            InitBrowser();
-        }
+        
         private void EChart_ParticlesComposition_Load(object sender, EventArgs e)
         {
 
             string sou = "";
+            int sel = 0;//选择颗粒范围(0为全部颗粒1为选择颗粒)
             NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString() };
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
             //string sou = m_ReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString();
             if (Report)
             {
                 sou = m_DataMgr.ResultFilesList[m_DataMgr.getSelectedIndex()].FileName.ToString();
-                
+                if(ParticleRange)
+                {
+                    sel = 0;
+                }else
+                {
+                    sel = 1;
+                }
             }
             else
             {
                 sou = m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+                sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+
             }
             Report = false;
 
@@ -144,7 +134,7 @@ namespace OTSIncAReportApp.Control_ECharts
                     }
                 }
                 
-                List<Chartdate> list_json_str = GetListJsonStrByChartStruct();
+                List<Chartdate> list_json_str = GetListJsonStrByChartStruct(sel);
                 url = "Resources/HTML/charts.html";
                 m_ReportApp.data = JsonConvert.SerializeObject(list_json_str[0]);
             }
@@ -294,7 +284,7 @@ namespace OTSIncAReportApp.Control_ECharts
             return chart;
         }
 
-        private Chartdate GetInclusionAreaRatioData(string path)
+        private Chartdate GetInclusionAreaRatioData(string path,int sel)
         {
             DataOperation.DataAccess.ParticleData particledata = new DataOperation.DataAccess.ParticleData(path);
             //创建新的图形数据源
@@ -302,8 +292,23 @@ namespace OTSIncAReportApp.Control_ECharts
             chart.Title = m_ReportApp.m_reportname;
             chart.YName = m_str_AxisY;
 
-            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            DataTable data = particledata.GetAreaByAllIncA("");
+            //int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+
+
+            DataTable data = new DataTable();
+            if (sel == 0)
+            {
+                data = particledata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
+            }
+            else
+            {
+                DataTable AllInca = particledata.GetAreaByAllIncA("");
+                DataTable SelectParticl = SelectParticleData();
+                data = GetParticleListForParticlSize(SelectParticl, AllInca);
+            }
+
+
+            //DataTable data = particledata.GetAreaByAllIncA("");
             DataTable dt = ConSolidateInvalid(data);
             //设置标签名称
             List<string> listName = new List<string>();
@@ -343,7 +348,7 @@ namespace OTSIncAReportApp.Control_ECharts
             return chart;
         }
 
-        private Chartdate GetInclusionAreaRatioClassData(string path)
+        private Chartdate GetInclusionAreaRatioClassData(string path,int sel)
         {
             
             //创建新的图形数据源
@@ -352,7 +357,7 @@ namespace OTSIncAReportApp.Control_ECharts
             chart.YName = m_str_AxisY;
 
             //计算分类整个表的数据
-            DataTable dt= ClassificationIntegration(path);
+            DataTable dt= ClassificationIntegration(path,sel);
             List<string> listName = new List<string>();
             //ListName
             for (int i = 0; i < dt.Rows.Count; i++)
@@ -382,7 +387,7 @@ namespace OTSIncAReportApp.Control_ECharts
             return chart;
         }
 
-        private DataTable ClassificationIntegration(string path )
+        private DataTable ClassificationIntegration(string path ,int sel)
         {
 
             //------------------加载模块,获取数据-------------------------------------------------
@@ -396,8 +401,19 @@ namespace OTSIncAReportApp.Control_ECharts
             keyValues_ResultGrid.TryGetValue(ls_resultgrid.table["col5"].ToString(), out str_SCZS);//视场总数
 
             DataOperation.DataAccess.ParticleData particledata = new DataOperation.DataAccess.ParticleData(path);
-           
-            DataTable data = particledata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
+            DataTable data = new DataTable();
+            if (sel==0)
+            {
+                data = particledata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
+            }
+            else
+            {
+                DataTable AllInca = particledata.GetAreaByAllIncA("");
+                DataTable SelectParticl = SelectParticleData();
+                data = GetParticleListForParticlSize(SelectParticl, AllInca);
+            }
+
+            
             DataTable AreaInformationOfAllElements = ConSolidateInvalid(data);
             DataTable AllAnalysisDetails = new DataTable();
             AllAnalysisDetails.Columns.Add("Name");
@@ -504,6 +520,106 @@ namespace OTSIncAReportApp.Control_ECharts
             }
             return AllAnalysisDetails1;
         }
+
+        private DataTable GetParticleListForParticlSize(DataTable data, DataTable table)
+        {
+            DataTable dt_Partick = new DataTable();
+            dt_Partick.Columns.Add("TypeId");
+            dt_Partick.Columns.Add("TypeName");
+            dt_Partick.Columns.Add("TypeColor");
+            dt_Partick.Columns.Add("con");
+            dt_Partick.Columns.Add("av");
+            dt_Partick.Columns.Add("max");
+            dt_Partick.Columns.Add("ar", typeof(double));
+            dt_Partick.Columns.Add("GroupName");
+            List<string> typeName = new List<string>();
+            for (int i = 0; i < data.Rows.Count; i++)
+            {
+                typeName.Add(data.Rows[i]["TypeId"].ToString());
+            }
+            typeName = typeName.Distinct().ToList();
+
+            for (int i = 0; i < typeName.Count; i++)
+            {
+                DataTable dt = dt_Partick.Clone();
+                for (int j = 0; j < data.Rows.Count; j++)
+                {
+                    if (typeName[i].ToString() == data.Rows[j]["TypeId"].ToString())
+                    {
+                        DataRow row = dt.NewRow();
+                        row["TypeId"] = data.Rows[j]["TypeId"];
+                        row["TypeName"] = data.Rows[j]["TypeName"];
+                        row["TypeColor"] = data.Rows[j]["TypeColor"];
+                        row["ar"] = data.Rows[j]["Area"];
+                        dt.Rows.Add(row);
+                    }
+                }
+                DataRow dr = dt_Partick.NewRow();
+                dr["TypeId"] = dt.Rows[0]["TypeId"].ToString();
+                dr["TypeName"] = dt.Rows[0]["TypeName"].ToString();
+                dr["TypeColor"] = dt.Rows[0]["TypeColor"].ToString();
+                dr["con"] = dt.Rows.Count;
+                dr["av"] = dt.Compute("min(ar)", "");
+                dr["max"] = dt.Compute("Max(ar)", "");
+                dr["ar"] = dt.Compute("SUM(ar)", "");
+                dt_Partick.Rows.Add(dr);
+            }
+            for (int i = 0; i < dt_Partick.Rows.Count; i++)
+            {
+                for (int j = 0; j < table.Rows.Count; j++)
+                {
+                    if (dt_Partick.Rows[i]["TypeId"].ToString() == table.Rows[j]["TypeId"].ToString())
+                    {
+                        dt_Partick.Rows[i]["GroupName"] = table.Rows[j]["GroupName"];
+                        break;
+                    }
+                }
+            }
+            return dt_Partick;
+        }
+
+        #region 读取选择颗粒数据
+        private DataTable SelectParticleData()
+        {
+            List<Particle> selectParticles = m_ReportApp.GetSelectedParticles();
+
+            #region Datatable数据表格式
+            DataTable dtUelect = new DataTable();
+            dtUelect.Columns.Add("fieldid");
+            dtUelect.Columns.Add("particleid");
+            dtUelect.Columns.Add("AveGray");
+            dtUelect.Columns.Add("RectLeft");
+            dtUelect.Columns.Add("RectTop");
+            dtUelect.Columns.Add("RectWidth");
+            dtUelect.Columns.Add("RectHeight");
+            dtUelect.Columns.Add("Area");
+            dtUelect.Columns.Add("PosX");
+            dtUelect.Columns.Add("PosY");
+            dtUelect.Columns.Add("TypeId");
+            dtUelect.Columns.Add("SegmentNum");
+            dtUelect.Columns.Add("SEMPosX");
+            dtUelect.Columns.Add("SEMPosY");
+            dtUelect.Columns.Add("XrayId");
+            dtUelect.Columns.Add("DMAX");
+            dtUelect.Columns.Add("DMIN");
+            dtUelect.Columns.Add("DPERP");
+            dtUelect.Columns.Add("PERIMETER");
+            dtUelect.Columns.Add("ORIENTATION");
+            dtUelect.Columns.Add("DINSCR");
+            dtUelect.Columns.Add("DMEAN");
+            dtUelect.Columns.Add("DELONG");
+            dtUelect.Columns.Add("DFERET");
+            dtUelect.Columns.Add("TypeName");
+            dtUelect.Columns.Add("TypeColor");
+
+            #endregion
+            for (int i = 0; i < selectParticles.Count; i++)
+            {
+                dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, /*selectParticles[i].ElementNum,*/ selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor);
+            }
+           return  dtUelect;
+        }
+        #endregion
         private DataTable ConSolidateInvalid(DataTable dt)
         {
            
@@ -791,7 +907,7 @@ namespace OTSIncAReportApp.Control_ECharts
         /// 通过m_list_chartstruct,组合json数据格式
         /// </summary>
         /// <returns></returns>
-        private List<Chartdate> GetListJsonStrByChartStruct()
+        private List<Chartdate> GetListJsonStrByChartStruct(int sel)
         {
             List<Chartdate> list = new List<Chartdate>();
             Chartdate chartdate = new Chartdate();
@@ -799,7 +915,7 @@ namespace OTSIncAReportApp.Control_ECharts
             {
                 case "CommonlyUsedClassify":
                     //chartdate = GetCommonlyUsedClassifyData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
-                    chartdate = GetInclusionAreaRatioClassData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
+                    chartdate = GetInclusionAreaRatioClassData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath, sel);
                     break;
                 case "PComponent":
                     chartdate = GetPComponentData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
@@ -811,10 +927,10 @@ namespace OTSIncAReportApp.Control_ECharts
                     chartdate = GetPSizeData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
                     break;
                 case "InclusionareaRatio":
-                    chartdate = GetInclusionAreaRatioData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
+                    chartdate = GetInclusionAreaRatioData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath, sel);
                     break;
                 case "InclusionareaClassRatio":
-                    chartdate=GetInclusionAreaRatioClassData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath);
+                    chartdate=GetInclusionAreaRatioClassData(m_DataMgr.ResultFilesList[m_DataMgr.GetWorkingResult()].FilePath, sel);
                     break;
             }
 
@@ -906,7 +1022,7 @@ namespace OTSIncAReportApp.Control_ECharts
                         case "CommonlyUsedClassify":
 
                             //计算分类整个表的数据
-                            dt = ClassificationIntegration(resultFile.FilePath);
+                            dt = ClassificationIntegration(resultFile.FilePath,sel);
                             ////List<string> listName = new List<string>();
                             ////ListName
                             for (int a = 0; a < dt.Rows.Count; a++)

+ 22 - 6
OTSIncAReportApp/1-UI/Control_ECharts/EChart_Trianglediagram.cs

@@ -38,6 +38,10 @@ namespace OTSIncAReportApp.Control_ECharts
         ResultDataMgr m_DataMgr;
         private bool ReportExporting = false;
         public bool Report { set; get; }
+        /// <summary>
+        /// 判断颗粒范围(true全部颗粒,false选择颗粒)
+        /// </summary>
+        public bool ParticleRange { set; get; }
         #endregion
 
         #region 构造函数及窗体加载
@@ -110,15 +114,27 @@ namespace OTSIncAReportApp.Control_ECharts
             //将所有的测量结果名添加到list中
             m_list_string_samplename.Clear();
             string sou = "";
+            int sel = 0;
             if (Report)
             {
                 sou = m_DataMgr.ResultFilesList[m_DataMgr.getSelectedIndex()].FileName.ToString();
+                if(ParticleRange)
+                {
+                    sel = 0;
+                }
+                else
+                {
+                    sel = 1;
+                }
             }
             else
             {
                 sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+                //判断颗粒范围(全部颗粒或者选择颗粒)
+                sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             }
             Report = false;
+             
             if (sou.Contains("+"))
             {
                 if (m_ReportApp.more)
@@ -136,7 +152,7 @@ namespace OTSIncAReportApp.Control_ECharts
                     {
                         continue;
                     }
-                    TriangleJsonClass cl = GettriangleJsonClass(resultFile.FilePath, resultFile.FileName, nameList, TemplateName);
+                    TriangleJsonClass cl = GettriangleJsonClass(resultFile.FilePath, resultFile.FileName, nameList, TemplateName,sel);
                     m_list_trianglejsonclass.Add(cl);
                 }
             }
@@ -167,7 +183,7 @@ namespace OTSIncAReportApp.Control_ECharts
                     resultFile = m_DataMgr.ResultFilesList[index];
                 }
                 ReportExporting = false;
-                TriangleJsonClass cl = GettriangleJsonClass(resultFile.FilePath, resultFile.FileName, nameList, TemplateName);
+                TriangleJsonClass cl = GettriangleJsonClass(resultFile.FilePath, resultFile.FileName, nameList, TemplateName,sel);
                 m_list_trianglejsonclass.Add(cl);
             }
 
@@ -198,7 +214,7 @@ namespace OTSIncAReportApp.Control_ECharts
 
         }
 
-        private TriangleJsonClass GettriangleJsonClass(string path, string name, List<string> nameList, string templatename)
+        private TriangleJsonClass GettriangleJsonClass(string path, string name, List<string> nameList, string templatename,int sel)
         {
             TriangleJsonClass triangleJsonClass = new TriangleJsonClass();
 
@@ -207,7 +223,7 @@ namespace OTSIncAReportApp.Control_ECharts
             List<string> list_string_sort = new List<string>();
             List<double[]> list_point_sort = new List<double[]>();
 
-            DataTable particles = GetParticles(path, nameList);
+            DataTable particles = GetParticles(path, nameList,sel);
             foreach (DataRow item in particles.Rows)
             {
                 if (item["particleLocation"].ToString() == "0,0,0")
@@ -238,7 +254,7 @@ namespace OTSIncAReportApp.Control_ECharts
         }
 
         //获取颗粒信息
-        private DataTable GetParticles(string filepath, List<string> nameList)
+        private DataTable GetParticles(string filepath, List<string> nameList,int sel)
         {
             ParticleData particledata = new ParticleData(filepath);
             //设置标签名称
@@ -259,7 +275,7 @@ namespace OTSIncAReportApp.Control_ECharts
             }
             double d = Convert.ToDouble(sizestr.Split(',')[sizestr.Split(',').Length - 1]);
             listName.Add(d.ToString() + "~MAX");
-            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            //int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             //int sel = m_condition.SourceGridData.ConditionItemList[m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE)].comboDownList.IndexOf(m_ReportApp.SourceGridData.ConditionItemList[1].itemVal.ToString());
             //int sel = m_condition.m_SourceGridData.GetPropIndexByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             string filedAndParticl = "";

+ 2 - 2
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -56,8 +56,8 @@ namespace OTSIncAReportGraph.Controls
        CopyImage=2,
        OriginalSplicing= 3,
        DeleteParticle=4,
-       CopyDatabase=5,
-       ParticleSegmentation=6
+       //CopyDatabase=5,
+       ParticleSegmentation=5
     }
     /// <summary>
     /// 选择导出的图片是原图还是颗粒渲染后的图片

+ 21 - 28
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.cs

@@ -39,13 +39,17 @@ namespace OTSIncAReportGrids
         private ResultDataMgr m_DataMgr;
         int gridheight = 0;
         public bool Report { set; get; }
+        /// <summary>
+        /// 全部颗粒为true选择颗粒为false
+        /// </summary>
+        public bool ParticleRange { set; get; }
         #endregion
 
         #region 自定义方法
         /// <summary>
         /// 绑定datagridview数据
         /// </summary>
-        public void BindDataGridView(string path, int num, string filename)
+        public void BindDataGridView(string path, int num, string filename,int sel)
         {
             List<string> colid = new List<string>() { "rowid", "pname", "area", "con" };
             List<string> colname = new List<string>() { table["str1"].ToString(), table["str4"].ToString(), table["str3"].ToString(), table["str6"].ToString() };
@@ -68,11 +72,11 @@ namespace OTSIncAReportGrids
             List<string> NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString() };
 
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            string filedAndParticl = "";
+             string filedAndParticl = "";
             gridView.MergeColumnNames.Add(filename);
             gridView.AddSpanHeader(1, gridView.Columns.Count - 1, filename);
             DataTable dt;
+            //sel(1,为选择颗粒,0,为全部颗粒)
             if (sel == 1)
             {
                 List<Particle> selectParticles = m_ReportApp.GetSelectedParticles();
@@ -204,29 +208,6 @@ namespace OTSIncAReportGrids
         /// </summary>
         private void SetDataGridViewStyle(OTSGridView gridView)
         {
-            ////用户不能调整 行高
-            //gridView.AllowUserToResizeRows = false;
-            ////点击选择整行
-            //gridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
-            ////居中显示
-            //System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
-            //dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            //gridView.DefaultCellStyle = dataGridViewCellStyle1;
-            //gridView.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
-            ////设置grid可以复制
-            //gridView.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
-            ////设置每列的宽度
-            //gridView.Columns[0].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
-            //gridView.Columns[1].Width = 200;
-            ////设置序号列不排序
-            //gridView.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
-            ////设置序号列不可以设置宽度
-            //gridView.Columns[0].Resizable = DataGridViewTriState.False;
-            ////设置所有行的高度
-            //for (int i = 0; i < gridView.Rows.Count; i++)
-            //{
-            //    gridView.Rows[i].Height = 30;
-            //}
 
             //用户不能调整标题的高度
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
@@ -315,17 +296,29 @@ namespace OTSIncAReportGrids
         private void ElementContentGrid_Load(object sender, EventArgs e)
         {
             string sou = "";
+            int sel = 0;
             if (Report)
             {
                 sou = m_DataMgr.ResultFilesList[m_DataMgr.getSelectedIndex()].FileName.ToString();
+                if (ParticleRange)
+                {
+                    sel = 0;
+                }
+                else
+                {
+                    sel = 1;
+                }
             }
             else
             {
                 sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+                sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             }
             Report = false;
 
             //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+            
+
             if (sou.Contains("+"))
             {
                 for (int i = 0; i < sou.Split('+').Length; i++)
@@ -333,7 +326,7 @@ namespace OTSIncAReportGrids
                     ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.FileName == sou.Split('+')[i]);
                     if (resultFile != null)
                     {
-                        BindDataGridView(resultFile.FilePath, i, resultFile.FileName);
+                        BindDataGridView(resultFile.FilePath, i, resultFile.FileName, sel);
                     }
                 }
             }
@@ -343,7 +336,7 @@ namespace OTSIncAReportGrids
                 {
                     if (sou == m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName.ToString())
                     {
-                        BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName);
+                        BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName, sel);
                     }
                 }
 

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

@@ -1636,16 +1636,7 @@ namespace OTSIncAReportGrids
 
         private void cbB_PageSize_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (cbB_PageSize.SelectedItem.ToString() == "All")
-            {
-                pageSize = -1;
-            }
-            else
-            {
-                pageSize = int.Parse(cbB_PageSize.SelectedItem.ToString());
-            }
-            lnkFirst_Click(null, null);
-            SetDataGridViewStyle();
+            DisplayData();
         }
 
         /// <summary>
@@ -1997,6 +1988,16 @@ namespace OTSIncAReportGrids
                             if (ReportFun.DeleteParticlesFromLibrary(item.ParticleId, item.FieldId))
                             {
                                 MessageBox.Show("Deleted successfully");
+
+                                for (int i = 0; i < particlesAll.Rows.Count; i++)
+                                {
+                                    if (particlesAll.Rows[i]["Fieldid"].ToString() == item.FieldId.ToString() && particlesAll.Rows[i]["Particleid"].ToString() == item.ParticleId.ToString())
+                                    {
+                                        particlesAll.Rows.RemoveAt(i);
+                                    }
+                                }
+
+                                DisplayData();
                             }
                             else
                             {
@@ -2009,6 +2010,19 @@ namespace OTSIncAReportGrids
                 }
             }
         }
+        private void DisplayData()
+        {
+            if (cbB_PageSize.SelectedItem.ToString() == "All")
+            {
+                pageSize = -1;
+            }
+            else
+            {
+                pageSize = int.Parse(cbB_PageSize.SelectedItem.ToString());
+            }
+            lnkFirst_Click(null, null);
+            SetDataGridViewStyle();
+        }
 
         private void btn_ReMeasure_Click(object sender, EventArgs e)
         {

+ 248 - 466
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -23,7 +23,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         public List<DataTable> m_list_dt;                   //导出的各模块数据,合集
 
         public OTSReport_Export m_otsreport_export;
-
+        UserLibraryData userLibrary;
+        DataTable userLibraryData;
         DataTable m_bt_DBData = new DataTable();
         List<string> TemplateList;
         #endregion
@@ -114,7 +115,48 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             
         }
         #endregion
-
+        #region 读取选择颗粒数据
+        private void SelectParticleData(out DataTable dt)
+        {
+            List<Particle> selectParticles = m_otsreport_export.m_ReportApp.GetSelectedParticles();
+           
+            #region Datatable数据表格式
+            DataTable dtUelect = new DataTable();
+            dtUelect.Columns.Add("fieldid");
+            dtUelect.Columns.Add("particleid");
+            dtUelect.Columns.Add("AveGray");
+            dtUelect.Columns.Add("RectLeft");
+            dtUelect.Columns.Add("RectTop");
+            dtUelect.Columns.Add("RectWidth");
+            dtUelect.Columns.Add("RectHeight");
+            dtUelect.Columns.Add("Area");
+            dtUelect.Columns.Add("PosX");
+            dtUelect.Columns.Add("PosY");
+            dtUelect.Columns.Add("TypeId");
+            dtUelect.Columns.Add("SegmentNum");
+            dtUelect.Columns.Add("SEMPosX");
+            dtUelect.Columns.Add("SEMPosY");
+            dtUelect.Columns.Add("XrayId");
+            dtUelect.Columns.Add("DMAX");
+            dtUelect.Columns.Add("DMIN");
+            dtUelect.Columns.Add("DPERP");
+            dtUelect.Columns.Add("PERIMETER");
+            dtUelect.Columns.Add("ORIENTATION");
+            dtUelect.Columns.Add("DINSCR");
+            dtUelect.Columns.Add("DMEAN");
+            dtUelect.Columns.Add("DELONG");
+            dtUelect.Columns.Add("DFERET");
+            dtUelect.Columns.Add("TypeName");
+            dtUelect.Columns.Add("TypeColor");
+            
+            #endregion
+            for (int i = 0; i < selectParticles.Count; i++)
+            {
+                dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, /*selectParticles[i].ElementNum,*/ selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor);
+            }
+            dt = dtUelect.Copy();
+        }
+        #endregion
         #region 读取标准库所需要的数据
         private void GetSTL(string str ,out DataTable  data)
         {
@@ -151,9 +193,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             }
             data = dt;
         }
-        public bool GetDBData()
+        public bool GetDBData(MBSZClass m_mbszclass)
         {
             //GetSTL();
+            
 
             m_bt_DBData.Clear();
             m_bt_DBData.Columns.Clear();
@@ -180,12 +223,19 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 m_bt_DBData.Columns.Add(colid[i].ToString());
             }
             DataTable dt =InvalidRemoval(fielddata.GetParticleListForParticlSize("area", ""), "TypeName");
-            //DataTable dt = fielddata.GetParticleListForParticlSize("area", "");
             DataTable AreaInformationOfAllElements = InvalidRemoval(fielddata.GetAreaByAllIncA(""), "TypeName");
-            //DataTable AreaInformationOfAllElements = fielddata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
             DataTable dtp = InvalidRemoval(fielddata.GetParticleAll(""), "GroupName");
-            //DataTable dtp = fielddata.GetParticleAll("");
-            
+            //选择颗粒信息
+            DataTable data;
+            SelectParticleData(out data);
+            //选择颗粒整理成表
+            DataTable Partic_dt = new DataTable();
+            if (data.Rows.Count >0)
+            {
+                 Partic_dt = GetParticleListForParticlSize(data, dtp);
+            }
+          
+           
 
             List<string> vs = new List<string>() { "DMAX", "DMIN", "Area", "FERET" };
             string po = vs[m_otsreport_export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs];
@@ -205,37 +255,127 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     po = "DFERET";
                     break;
             }
-            for (int i=0;i< dt.Rows.Count;i++)
+
+
+            //如果是全部颗粒(0)
+            if (m_mbszclass.M_SY.int_xzkl == 0)
             {
-                DataRow dr = m_bt_DBData.NewRow();
-                dr["TypeName"] = dt.Rows[i]["TypeName"].ToString();
-                dr["TypeId"] = dt.Rows[i]["TypeId"].ToString();
-                dr["con"]= dt.Rows[i]["con"].ToString();
-                dr["Class"] = dt.Rows[i]["GroupName"].ToString();
-                dr["Largest"] = Math.Round(Convert.ToDouble(dt.Rows[i]["max"]), 2);
-                for (int a=6;a< colid.Count;a++)
+                for (int i = 0; i < dt.Rows.Count; i++)
                 {
-                    string d1 = colid[a].Split('~')[0];
-                    string d2 = colid[a].Split('~')[1];
-                    if (d2 == "MAX")
+                    DataRow dr = m_bt_DBData.NewRow();
+                    dr["TypeName"] = dt.Rows[i]["TypeName"].ToString();
+                    dr["TypeId"] = dt.Rows[i]["TypeId"].ToString();
+                    dr["con"] = dt.Rows[i]["con"].ToString();
+                    dr["Class"] = dt.Rows[i]["GroupName"].ToString();
+                    dr["Largest"] = Math.Round(Convert.ToDouble(dt.Rows[i]["max"]), 2);
+                    for (int a = 6; a < colid.Count; a++)
                     {
-                        d2 = "999";
+                        string d1 = colid[a].Split('~')[0];
+                        string d2 = colid[a].Split('~')[1];
+                        if (d2 == "MAX")
+                        {
+                            d2 = "999";
+                        }
+                        DataRow[] datas = dtp.Select(getWhere(d2, d1, po, dt.Rows[i]["TypeId"].ToString()));
+                        dr[colid[a]] = datas.Count();
+                    }
+                    for (int a = 0; a < AreaInformationOfAllElements.Rows.Count; a++)
+                    {
+                        if (dt.Rows[i]["TypeId"].ToString() == AreaInformationOfAllElements.Rows[a]["TypeId"].ToString())
+                        {
+                            dr["ar"] = AreaInformationOfAllElements.Rows[a]["ar"];
+                        }
                     }
-                    DataRow[] datas = dtp.Select(getWhere(d2, d1, po, dt.Rows[i]["TypeId"].ToString()));
-                    dr[colid[a]] = datas.Count();
+                    m_bt_DBData.Rows.Add(dr);
                 }
-                for (int a=0;a< AreaInformationOfAllElements.Rows.Count;a++)
+            }
+            else//选择颗粒(1)
+            {
+                for (int i = 0; i < Partic_dt.Rows.Count; i++)
                 {
-                    if (dt.Rows[i]["TypeId"].ToString()== AreaInformationOfAllElements.Rows[a]["TypeId"].ToString())
+                    DataRow dr = m_bt_DBData.NewRow();
+                    dr["TypeName"] = Partic_dt.Rows[i]["TypeName"].ToString();
+                    dr["TypeId"] = Partic_dt.Rows[i]["TypeId"].ToString();
+                    dr["con"] = Partic_dt.Rows[i]["con"].ToString();
+                    dr["Class"] = Partic_dt.Rows[i]["GroupName"].ToString();
+                    dr["Largest"] = Math.Round(Convert.ToDouble(Partic_dt.Rows[i]["max"]), 2);
+                    for (int a = 6; a < colid.Count; a++)
                     {
-                        dr["ar"] = AreaInformationOfAllElements.Rows[a]["ar"];
+                        string d1 = colid[a].Split('~')[0];
+                        string d2 = colid[a].Split('~')[1];
+                        if (d2 == "MAX")
+                        {
+                            d2 = "999";
+                        }
+                        DataRow[] datas = dtp.Select(getWhere(d2, d1, po, Partic_dt.Rows[i]["TypeId"].ToString()));
+                        dr[colid[a]] = datas.Count();
                     }
+                    dr["ar"] = Partic_dt.Rows[i]["Area"];
+                    m_bt_DBData.Rows.Add(dr);
                 }
-                m_bt_DBData.Rows.Add(dr);
             }
 
+           
+
             return true;
         }
+
+        private DataTable GetParticleListForParticlSize(DataTable data,DataTable table)
+        {
+            DataTable dt_Partick = new DataTable();
+            dt_Partick.Columns.Add("TypeId");
+            dt_Partick.Columns.Add("TypeName");
+            dt_Partick.Columns.Add("TypeColor");
+            dt_Partick.Columns.Add("con");
+            dt_Partick.Columns.Add("av");
+            dt_Partick.Columns.Add("max");
+            dt_Partick.Columns.Add("Area",typeof(double));
+            dt_Partick.Columns.Add("GroupName");
+            List<string> typeName = new List<string>();
+            for (int i=0;i<data.Rows.Count;i++)
+            {
+                typeName.Add(data.Rows[i]["TypeId"].ToString());
+            }
+            typeName = typeName.Distinct().ToList();
+
+            for (int i = 0; i < typeName.Count; i++)
+            {
+                DataTable dt = dt_Partick.Clone();
+                for (int j = 0; j < data.Rows.Count; j++)
+                {
+                    if (typeName[i].ToString() == data.Rows[j]["TypeId"].ToString())
+                    {
+                        DataRow row = dt.NewRow();
+                        row["TypeId"] = data.Rows[j]["TypeId"];
+                        row["TypeName"] = data.Rows[j]["TypeName"];
+                        row["TypeColor"] = data.Rows[j]["TypeColor"];
+                        row["Area"] = data.Rows[j]["Area"];
+                        dt.Rows.Add(row);
+                    }
+                }
+                DataRow dr = dt_Partick.NewRow();
+                dr["TypeId"] = dt.Rows[0]["TypeId"].ToString();
+                dr["TypeName"] = dt.Rows[0]["TypeName"].ToString();
+                dr["TypeColor"] = dt.Rows[0]["TypeColor"].ToString();
+                dr["con"] = dt.Rows.Count;
+                dr["av"] = dt.Compute("min(Area)", "");
+                dr["max"] = dt.Compute("Max(Area)", "");
+                dr["Area"] = dt.Compute("SUM(Area)", "");
+                dt_Partick.Rows.Add(dr);
+            }
+            for (int i=0;i< dt_Partick.Rows.Count;i++)
+            {
+                for (int j=0;j< table.Rows.Count;j++)
+                {
+                    if (dt_Partick.Rows[i]["TypeId"].ToString()== table.Rows[j]["TypeId"].ToString())
+                    {
+                        dt_Partick.Rows[i]["GroupName"] = table.Rows[j]["GroupName"];
+                        break;
+                    }
+                }
+            }
+            return dt_Partick;
+        }
         private DataTable InvalidRemoval(DataTable dt ,string str)
         {
             DataTable dataTable = dt.Copy();
@@ -263,387 +403,27 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// 颗粒列表中插入帧图,并带上颗粒分组信息
         /// </summary>
         /// <returns></returns>
-        public bool InsertReportTemplateTable_ParticlesGridDevidePage()
+
+        public bool InsertReportTemplateTable_ParticlesGridDevidePage_CleanlinessA(MBSZClass m_mbszclass)
         {
-            
+
             int serialNumber = 1;
             //------------------加载模块,获取数据-------------------------------------------------
             m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
-
-            //根据sql条件,查询获取颗粒信息数据
-            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
-            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(),"TypeName") ;
-            //将颗粒大小排序(从大到小)
-            DataView dv = dt.DefaultView;
-            dv.Sort = "DMAX DESC";
-            DataTable dt_ParticlesGridDevidePage = dv.ToTable();
-
-            string str_resultPath = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath;
-            //------------------加载模块,获取数据结束----------------------------------------------
-            #region 创建要插入数据库表结构
-            //插入模板需父子表,结构
-            //表名field_dt表:(父表)           帧图表
-            DataTable DT_field_dt = new DataTable();
-            DT_field_dt.TableName = "field_dt";
-            DataColumn colpictid2 = new DataColumn("FieldId");
-            colpictid2.DataType = typeof(int);
-            DT_field_dt.Columns.Add(colpictid2);
-            //图像列
-            DataColumn colpict2 = new DataColumn("FieldImg");
-            colpict2.DataType = System.Type.GetType("System.Byte[]");
-            DT_field_dt.Columns.Add(colpict2);
-
-            //表名Largest_frame表:(子表)       显示20条颗粒除外的部份颗粒信息
-            DataTable DT_field_dt_copy = new DataTable();
-            DataTable DT_Largest_frame = new DataTable();
-            DT_Largest_frame.TableName = "Largest_frame";
-            DT_Largest_frame.Columns.Add("pid");
-            DT_Largest_frame.Columns.Add("Size");
-            DT_Largest_frame.Columns.Add("Width");
-            DT_Largest_frame.Columns.Add("DMAX");
-            DT_Largest_frame.Columns.Add("DMIN");
-            DT_Largest_frame.Columns.Add("Class");
-            DT_Largest_frame.Columns.Add("ColName1");
-            DT_Largest_frame.Columns.Add("ColName2");
-            DT_Largest_frame.Columns.Add("ColName3");
-            DT_Largest_frame.Columns.Add("ColName4");
-            DT_Largest_frame.Columns.Add("ColName5");
-            DT_Largest_frame.Columns.Add("ColName6");
-            DT_Largest_frame.Columns.Add("ColVal1");
-            DT_Largest_frame.Columns.Add("ColVal2");
-            DT_Largest_frame.Columns.Add("ColVal3");
-            DT_Largest_frame.Columns.Add("ColVal4");
-            DT_Largest_frame.Columns.Add("ColVal5");
-            DT_Largest_frame.Columns.Add("ColVal6");
-            DataColumn colpictid = new DataColumn("FieldId");
-            colpictid.DataType = typeof(int);
-            DT_Largest_frame.Columns.Add(colpictid);
-            //图像列
-            DataColumn colpict = new DataColumn("p1");
-            colpict.DataType = System.Type.GetType("System.Byte[]");
-            DT_Largest_frame.Columns.Add(colpict);
-
-            //largest20表:(无关系表)       需要显示前20条带有显示能谱图像的颗粒表
-            DataTable DT_Largest20 = new DataTable();
-            DT_Largest20.TableName = "Largest20";
-            DT_Largest20.Columns.Add("pid");
-            DT_Largest20.Columns.Add("Size");
-            DT_Largest20.Columns.Add("Width");
-            DT_Largest20.Columns.Add("DMAX");
-            DT_Largest20.Columns.Add("DMIN");
-            DT_Largest20.Columns.Add("Class");
-            DT_Largest20.Columns.Add("ColName1");
-            DT_Largest20.Columns.Add("ColName2");
-            DT_Largest20.Columns.Add("ColName3");
-            DT_Largest20.Columns.Add("ColName4");
-            DT_Largest20.Columns.Add("ColName5");
-            DT_Largest20.Columns.Add("ColName6");
-            DT_Largest20.Columns.Add("ColVal1");
-            DT_Largest20.Columns.Add("ColVal2");
-            DT_Largest20.Columns.Add("ColVal3");
-            DT_Largest20.Columns.Add("ColVal4");
-            DT_Largest20.Columns.Add("ColVal5");
-            DT_Largest20.Columns.Add("ColVal6");
-            // 图像列
-            DataColumn colpict_20ago = new DataColumn("p1");
-            colpict_20ago.DataType = System.Type.GetType("System.Byte[]");
-            DT_Largest20.Columns.Add(colpict_20ago);
-            DataColumn colpict2_20ago = new DataColumn("p2");
-            colpict2_20ago.DataType = System.Type.GetType("System.Byte[]");
-            DT_Largest20.Columns.Add(colpict2_20ago);
-            DataColumn colpict3_20ago = new DataColumn("p3");
-            colpict3_20ago.DataType = System.Type.GetType("System.Byte[]");
-            DT_Largest20.Columns.Add(colpict3_20ago);
-
-            #endregion
-
-            #region 插入20颗粒部份
-           
-            for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
+            DataTable SelectParticleTable = new DataTable();
+            SelectParticleData(out SelectParticleTable);
+            int sel = 0;
+            if (m_mbszclass.M_SY.int_xzkl == 0)
             {
-                if (dt_ParticlesGridDevidePage.Rows[i_row].ItemArray[24].ToString()!= "Not Identified")
-                {
-                    //获取颗粒的fieldid,和particleid
-                    string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
-                    string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
-                    string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
-                    string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
-                    string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
-                    string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["Element"].ToString();
-
-                    //获取原始颗粒图像
-                    Bitmap bp_particle = new Bitmap(1, 1);
-                    string str_path = str_resultPath + "\\FIELD_FILES\\";
-                    string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
-
-                    if (str_fieldid == "-1")
-                        continue;
-
-                    if (serialNumber > 20)
-                        continue;
-
-                    if (str_subparticles != null && str_subparticles != "")
-                    {
-                        //合并大颗粒
-                        double ScanFieldSize = 1142;
-                        Bitmap tempbit = fielddata.ReadImageFile(str_imagePath);
-                        int pixw = tempbit.Width;
-                        double xs = pixw / ScanFieldSize;
-                        bp_particle = fielddata.GetBitmapForBig(str_subparticles, xs, str_resultPath, tempbit.Height, tempbit.Width);
-                    }
-                    else
-                    {
-                        //正常颗粒
-                        Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
-                        Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
-                        bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
-                        bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
-                    }
-                //获取该颗粒的xray能谱图像
-                System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
-                        str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
-                    Bitmap ls_xraybpnew = new Bitmap(1, 1);
-                    ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
-
-                    //获取该颗粒的二次放大处理图像
-                    Bitmap ls_processbitmap = new Bitmap(1, 1);
-                    ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
-
-                    //再将图像转成二进制流-------------------------------------------------------------------
-                    //原图
-                    MemoryStream newms_p1 = new MemoryStream();
-                    bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
-                    newms_p1.Seek(0, SeekOrigin.Begin);
-                    byte[] newarr_p1 = new byte[newms_p1.Length];
-                    newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
-
-                    //二次放大图
-                    MemoryStream newms_p2 = new MemoryStream();
-                    ls_processbitmap.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
-                    newms_p2.Seek(0, SeekOrigin.Begin);
-                    byte[] newarr_p2 = new byte[newms_p2.Length];
-                    newms_p2.Read(newarr_p2, 0, newarr_p2.Length);
-
-                    //能谱图
-                    MemoryStream newms_p3 = new MemoryStream();
-                    ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
-                    newms_p3.Seek(0, SeekOrigin.Begin);
-                    byte[] newarr_p3 = new byte[newms_p3.Length];
-                    newms_p3.Read(newarr_p3, 0, newarr_p3.Length);
-                    //---------------------------------------------------------------------------------------                  
-                    DataRow dr = DT_Largest20.NewRow();
-
-                    dr["p1"] = newarr_p1;
-                    dr["p2"] = newarr_p2;
-                    dr["p3"] = newarr_p3;
-                    newms_p1.Dispose();
-                    newms_p2.Dispose();
-                    newms_p3.Dispose();
-
-                    dr["pid"] = serialNumber++.ToString();
-                    //dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
-                    dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00"); //可以需要选择切换,计算方式
-                    dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
-                    dr["DMAX"] = Math.Round(Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["dmax"]), 2).ToString();
-                    dr["DMIN"] = Math.Round(Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["dmin"]), 2).ToString();
-                    dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
-
-                    List<string> list_max_elementname = new List<string>();
-                    List<double> list_max_elementvale = new List<double>();
-                    GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i_row, out list_max_elementname, out list_max_elementvale);
-                    //元素1
-                    dr["ColName1"] = list_max_elementname[0];
-                    dr["ColVal1"] = list_max_elementvale[0].ToString();
-                    //元素2
-                    dr["ColName2"] = list_max_elementname[1];
-                    dr["ColVal2"] = list_max_elementvale[1].ToString();
-                    //元素3
-                    dr["ColName3"] = list_max_elementname[2];
-                    dr["ColVal3"] = list_max_elementvale[2].ToString();
-                    //元素4
-                    dr["ColName4"] = list_max_elementname[3];
-                    dr["ColVal4"] = list_max_elementvale[3].ToString();
-                    //元素5
-                    dr["ColName5"] = list_max_elementname[4];
-                    dr["ColVal5"] = list_max_elementvale[4].ToString();
-                    //元素6
-                    dr["ColName6"] = list_max_elementname[5];
-                    dr["ColVal6"] = list_max_elementvale[5].ToString();
-
-                    DT_Largest20.Rows.Add(dr);
-                }
+                sel = 0;
             }
-            #endregion
-
-            #region 插入-帧图图像部份
-            List<string> vs = new List<string>();
-            DataTable data = new DataTable();
-            //首先生成标记颗粒的帧图图像文件
-            DataTable dt_GridDevidePage = new DataTable();
-            dt_GridDevidePage = dt_ParticlesGridDevidePage.Copy();
-            dt_GridDevidePage.Clear();
-            for (int i=0;i< dt_ParticlesGridDevidePage.Rows.Count;i++)
-            {
-                if (dt_ParticlesGridDevidePage.Rows[i]["TypeName"].ToString() != "Not Identified")
-                {
-                    dt_GridDevidePage.Rows.Add(dt_ParticlesGridDevidePage.Rows[i].ItemArray);
-                }
-            }
-            m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage.SaveMarkParticleRectangleOnFieldFile(str_resultPath,dt_GridDevidePage, out vs ,out data);
-            string str_path_FIELD_FILES_MARK = str_resultPath + "\\FIELD_FILES_MARK\\";
-            DirectoryInfo theFolder = new DirectoryInfo(str_path_FIELD_FILES_MARK);
-            if (theFolder.Exists)
+            else
             {
-               for (int i=0;i<vs.Count;i++)
-               {
-                    foreach (FileInfo nextifile in theFolder.GetFiles())
-                    {
-                        if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
-                        {
-                            //确认对应的帧图名
-                            string str_fieldid = Path.GetFileNameWithoutExtension(nextifile.Name);
-                            if (str_fieldid==vs[i].ToString())
-                            {
-                                //在数据表中有颗粒在该帧图中的话,则对该帧图标记图像进行读取存入数据库
-                                DataRow[] datarowlist = dt_GridDevidePage.Select(" fieldid = " + str_fieldid);
-                                if (datarowlist.Count() > 0)
-                                {
-                                    Bitmap ls_bp_fieldmark = new Bitmap(nextifile.FullName);
-                                    DataRow dr = DT_field_dt.NewRow();
-                                    MemoryStream newms_bp_fieldmark = new MemoryStream();
-                                    ls_bp_fieldmark.Save(newms_bp_fieldmark, System.Drawing.Imaging.ImageFormat.Bmp);
-                                    newms_bp_fieldmark.Seek(0, SeekOrigin.Begin);
-                                    byte[] newarr_fieldmark = new byte[newms_bp_fieldmark.Length];
-                                    newms_bp_fieldmark.Read(newarr_fieldmark, 0, newarr_fieldmark.Length);
-                                    dr["FieldImg"] = newarr_fieldmark;
-                                    dr["FieldId"] = str_fieldid;
-                                    ls_bp_fieldmark.Dispose();
-                                    DT_field_dt.Rows.Add(dr);
-
-                                }
-                            }
-                        }
-                    }
-                }
-                DT_field_dt_copy = DT_field_dt.Copy();
+                sel = 1;
             }
-
-            #endregion
-
-            #region 插入-帧图副表部分
-            for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
-            {
-                if (dt_ParticlesGridDevidePage.Rows[i_row]["element"].ToString() == "")
-                    continue;
-                //获取颗粒的fieldid,和particleid
-                string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
-                if (Convert.ToInt32(str_fieldid) < 20)
-                {
-                    
-                    string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
-                    string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
-                    string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
-                    string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
-                    string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["Element"].ToString();
-
-                    //获取原始颗粒图像
-                    Bitmap bp_particle = new Bitmap(1, 1);
-                    string str_path = str_resultPath + "\\FIELD_FILES\\";
-                    string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
-                    if (str_subparticles != null && str_subparticles != "")
-                    {
-                        //合并大颗粒
-                        //double ScanFieldSize = 1142;
-                        //Bitmap tempbit = fielddata.ReadImageFile(str_imagePath);
-                        //int pixw = tempbit.Width;
-                        //double xs = pixw / ScanFieldSize;
-                        //bp_particle = fielddata.GetBitmapForBig(str_subparticles, xs, str_resultPath);
-                        continue;
-                    }
-                    else
-                    {
-                        //正常颗粒
-                        Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
-                        Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
-                        bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
-                        bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
-                    }
-
-                    //获取该颗粒的xray能谱图像
-                    System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
-                        str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
-
-                    //获取该颗粒的二次放大处理图像
-                    Bitmap ls_processbitmap = new Bitmap(1, 1);
-                    ls_processbitmap = (Bitmap)bp_particle.Clone();//待完善
-
-                    //再将图像转成二进制流-------------------------------------------------------------------
-                    //原图
-                    MemoryStream newms_p1 = new MemoryStream();
-                    bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
-                    newms_p1.Seek(0, SeekOrigin.Begin);
-                    byte[] newarr_p1 = new byte[newms_p1.Length];
-                    newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
-                    //---------------------------------------------------------------------------------------                  
-                    DataRow dr = DT_Largest_frame.NewRow();
-                    dr["p1"] = newarr_p1;
-                    newms_p1.Dispose();
-
-                    dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
-                    dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00");  //可以需要选择切换,计算方式
-                    dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
-                    dr["DMAX"] = Math.Round(Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["dmax"]),2).ToString();
-                    dr["DMIN"] = Math.Round(Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["dmin"]),2).ToString();
-                    dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
-
-                    dr["fieldid"] = str_fieldid;
-
-                    List<string> list_max_elementname = new List<string>();
-                    List<double> list_max_elementvale = new List<double>();
-                    GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i_row, out list_max_elementname, out list_max_elementvale);
-                    //元素1
-                    dr["ColName1"] = list_max_elementname[0];
-                    dr["ColVal1"] = list_max_elementvale[0].ToString();
-                    //元素2
-                    dr["ColName2"] = list_max_elementname[1];
-                    dr["ColVal2"] = list_max_elementvale[1].ToString();
-                    //元素3
-                    dr["ColName3"] = list_max_elementname[2];
-                    dr["ColVal3"] = list_max_elementvale[2].ToString();
-                    //元素4
-                    dr["ColName4"] = list_max_elementname[3];
-                    dr["ColVal4"] = list_max_elementvale[3].ToString();
-                    //元素5
-                    dr["ColName5"] = list_max_elementname[4];
-                    dr["ColVal5"] = list_max_elementvale[4].ToString();
-                    //元素6
-                    dr["ColName6"] = list_max_elementname[5];
-                    dr["ColVal6"] = list_max_elementvale[5].ToString();
-
-
-                    DT_Largest_frame.Rows.Add(dr);
-                }
-                
-            }
-            #endregion
-            //FrameGraphParticleTable(dt_ParticlesGridDevidePage, str_resultPath, fielddata, DT_field_dt);
-            m_list_dt.Add(DT_field_dt_copy);
-            m_list_dt.Add(DT_Largest_frame);
-            m_list_dt.Add(DT_Largest20);
-
-            return true;
-        }
-
-        public bool InsertReportTemplateTable_ParticlesGridDevidePage_CleanlinessA(MBSZClass m_mbszclass)
-        {
-
-            int serialNumber = 1;
-            //------------------加载模块,获取数据-------------------------------------------------
-            m_otsreport_export.m_ReportApp.im_ParticlesGridDevidePage = new ParticlesGridDevidePage(m_otsreport_export.m_ReportApp);
-
-            //根据sql条件,查询获取颗粒信息数据
-            ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
-            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(), "TypeName");
+                //根据sql条件,查询获取颗粒信息数据
+                ParticleData fielddata = new ParticleData(m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FilePath);
+            DataTable dt = InvalidRemoval(fielddata.GetIncaSurfaceData(SelectParticleTable, sel), "TypeName");
             ResultFile resfile = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()];
             string str_libraryName = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["STDName"].ToString();
             if (m_mbszclass.M_KLLBXX.str_cb_kllb_sort_p1.ToString()== "Hardness")
@@ -736,7 +516,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     //获取颗粒的fieldid,和particleid
                     string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
                     string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
-                    string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
+                    //string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
                     string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
                     string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
                     string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["Element"].ToString();
@@ -752,23 +532,23 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     if (serialNumber > 20)
                         continue;
 
-                    if (str_subparticles != null && str_subparticles != "")
-                    {
-                        //合并大颗粒
-                        double ScanFieldSize = 1142;
-                        Bitmap tempbit = fielddata.ReadImageFile(str_imagePath);
-                        int pixw = tempbit.Width;
-                        double xs = pixw / ScanFieldSize;
-                        bp_particle = fielddata.GetBitmapForBig(str_subparticles, xs, str_resultPath, tempbit.Height, tempbit.Width);
-                    }
-                    else
-                    {
+                    //if (str_subparticles != null && str_subparticles != "")
+                    //{
+                    //    //合并大颗粒
+                    //    double ScanFieldSize = 1142;
+                    //    Bitmap tempbit = fielddata.ReadImageFile(str_imagePath);
+                    //    int pixw = tempbit.Width;
+                    //    double xs = pixw / ScanFieldSize;
+                    //    bp_particle = fielddata.GetBitmapForBig(str_subparticles, xs, str_resultPath, tempbit.Height, tempbit.Width);
+                    //}
+                    //else
+                    //{
                         //正常颗粒
                         Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
                         Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
                         bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
                         bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
-                    }
+                    //}
                     //获取该颗粒的xray能谱图像
                     System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
                             str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
@@ -1022,7 +802,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 {
 
                     string str_particleid = dt.Rows[i_row]["particleid"].ToString();
-                    string str_subparticles = dt.Rows[i_row]["SubParticles"].ToString();
+                    //string str_subparticles = dt.Rows[i_row]["SubParticles"].ToString();
                     string str_typeid = dt.Rows[i_row]["TypeId"].ToString();
                     string str_typename = dt.Rows[i_row]["TypeName"].ToString();
                     string str_element = dt.Rows[i_row]["Element"].ToString();
@@ -1031,19 +811,19 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     Bitmap bp_particle = new Bitmap(1, 1);
                     string str_path = str_resultPath + "\\FIELD_FILES\\";
                     string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
-                    if (str_subparticles != null && str_subparticles != "")
-                    {
+                    //if (str_subparticles != null && str_subparticles != "")
+                    //{
                         
-                        continue;
-                    }
-                    else
-                    {
+                    //    continue;
+                    //}
+                    //else
+                    //{
                         //正常颗粒
                         Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt.Rows[i_row]["RectHeight"]) };
                         Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
                         bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
                         bp_particle.Tag = new List<string>() { dt.Rows[i_row]["FieldId"].ToString(), dt.Rows[i_row]["ParticleId"].ToString(), dt.Rows[i_row]["TypeId"].ToString() };
-                    }
+                    //}
 
                     //获取该颗粒的xray能谱图像
                     System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
@@ -1118,13 +898,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// 向 模板设计器 中插入 颗粒尺寸表
         /// </summary>
         /// <returns></returns>
-        public bool InsertReportTemplateTable_ParticleSizeGrid()
+        public bool InsertReportTemplateTable_ParticleSizeGrid(MBSZClass m_mbszclass)
         {
             try
             {
                 if (m_bt_DBData.Columns.Count==0)
                 {
-                    GetDBData();
+                    GetDBData(m_mbszclass);
                 }
 
                 List<string> colid = new List<string>();
@@ -1365,13 +1145,22 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// 向 模板设计器 中插入 平均元素含量表
         /// </summary>
         /// <returns></returns>
-        public bool InsertReportTemplateTable_ElementCompositionAvgGrid()
+        public bool InsertReportTemplateTable_ElementCompositionAvgGrid(MBSZClass m_mbszclass)
         {
             try
             {
                 //加载模块
                 ElementCompositionAvgGrid ls_elementcompositionavggrid = new ElementCompositionAvgGrid(m_otsreport_export.m_ReportApp);
                 ls_elementcompositionavggrid.Report = true;
+                if (m_mbszclass.M_SY.int_xzkl == 0)
+                {
+                    ls_elementcompositionavggrid.ParticleRange = true;
+                }
+                else
+                {
+                    ls_elementcompositionavggrid.ParticleRange = false;
+                }
+                
                 m_otsreport_export.panel_container.Controls.Clear();
                 m_otsreport_export.panel_container.Controls.Add(ls_elementcompositionavggrid);
 
@@ -1502,11 +1291,11 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             }
         }
 
-        public bool InsertReportTemplateTable_ElementAvgGrid()
+        public bool InsertReportTemplateTable_ElementAvgGrid(MBSZClass m_mbszclass)
         {
             if (m_bt_DBData.Columns.Count == 0)
             {
-                GetDBData();
+                GetDBData(m_mbszclass);
             }
 
             //根据sql条件,查询获取颗粒信息数据
@@ -1536,11 +1325,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 if (getClass_dt.Rows[i]["GroupName"].ToString() != "NOT_INCLUTION" && getClass_dt.Rows[i]["GroupName"].ToString()!= "Invalid")
                     ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
             }
-            //for (int i = 0; i < getClass_dt.Rows.Count; i++)
-            //{
-            //    if (getClass_dt.Rows[i]["GroupName"].ToString() == "NOT_INCLUTION")
-            //        ClassName.Add(getClass_dt.Rows[i]["GroupName"].ToString());
-            //}
+
             //统计元素物质大类的元素信息和面积占比
             DataTable dt_ElementalSubstance=  ElementalSubstance(AllAnalysisDetails, ClassName, fielddata);
             //统计元素并按照Class Name自定义列表进行排序,大类中的小类元素信息按照面积从大到小排序
@@ -2065,7 +1850,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         #endregion
 
         #region 插入大分类夹杂物面积比图
-        public bool InsertReportTemplateChart_InclusionAreaClassRatio(string a_GraphicStyle)
+        public bool InsertReportTemplateChart_InclusionAreaClassRatio(string a_GraphicStyle, MBSZClass m_mbszclass)
         {
             //加载模块
             m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition = new EChart_ParticlesComposition(m_otsreport_export.m_ReportApp, "InclusionareaClassRatio");
@@ -2074,6 +1859,15 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_otsreport_export.m_ReportApp.timerKG = true;
             //string str = m_otsreport_export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_otsreport_export.m_ReportApp.m_rstDataMgr.getSelectedIndex()].FileName;
             m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.Report = true;
+            if (m_mbszclass.M_SY.int_xzkl==0)
+            {
+                m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.ParticleRange = true;
+            }
+            else
+            {
+                m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.ParticleRange = false; ;
+            }
+            
             m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition);
 
             //弹出加载图片窗体
@@ -2108,7 +1902,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         }
         #endregion
         #region 插入夹杂物面积比图
-        public bool InsertReportTemplateChart_InclusionAreaRatio(string a_GraphicStyle)
+        public bool InsertReportTemplateChart_InclusionAreaRatio(string a_GraphicStyle, MBSZClass m_mbszclass)
         {
             //加载模块
             m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition = new EChart_ParticlesComposition(m_otsreport_export.m_ReportApp, "InclusionareaRatio");
@@ -2116,6 +1910,14 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_otsreport_export.m_ReportApp.type = a_GraphicStyle;
             m_otsreport_export.m_ReportApp.timerKG = true;
             m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.Report = true;
+            if (m_mbszclass.M_SY.int_xzkl == 0)
+            {
+                m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.ParticleRange = true;
+            }
+            else
+            {
+                m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition.ParticleRange = false; ;
+            }
             m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition);
 
             //弹出加载图片窗体
@@ -2335,23 +2137,24 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// </summary>
         /// <param name="selectindex"></param>
         /// <returns></returns>
-        private byte[] GetByte_InsertReportTemplateChart_Trianglediagram(int selectindex)
+        private byte[] GetByte_InsertReportTemplateChart_Trianglediagram(int selectindex, MBSZClass m_mbszclass)
         {
             byte[] newarr = new byte[0];
 
 
             //加载模块
-            //m_otsreport_export.m_ReportApp.im_EChart_Trianglediagram = new EChart_Trianglediagram(m_otsreport_export.m_ReportApp, TemplateList[selectindex]);
-            //m_otsreport_export.m_ReportApp.timerKG = true;
-            //m_otsreport_export.m_ReportApp.im_EChart_Trianglediagram.condition = m_otsreport_export.m_mbszclass.M_SYXT.index_cb_syxt_jsfs;
-            //m_otsreport_export.m_ReportApp.im_EChart_Trianglediagram.Report = true;
-            //m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(m_otsreport_export.m_ReportApp.im_EChart_Trianglediagram);
-
-
 
             EChart_Trianglediagram eChart_Trianglediagram= new EChart_Trianglediagram(m_otsreport_export.m_ReportApp, TemplateList[selectindex]);
             m_otsreport_export.m_ReportApp.timerKG = true;
             eChart_Trianglediagram.condition = m_otsreport_export.m_mbszclass.M_SYXT.index_cb_syxt_jsfs;
+            if(m_mbszclass.M_SY.int_xzkl==0)
+            {
+                eChart_Trianglediagram.ParticleRange = true;
+            }
+            else
+            {
+                eChart_Trianglediagram.ParticleRange = false;
+            }
             eChart_Trianglediagram.Report = true;
             m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(eChart_Trianglediagram);
 
@@ -2395,31 +2198,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// 向 模板设计器 中插入 三元相图
         /// </summary>
         /// <returns></returns>
-        public bool InsertReportTemplateChart_Trianglediagram()
+        public bool InsertReportTemplateChart_Trianglediagram(MBSZClass m_mbszclass)
         {
             try
             {
-                ////创建二进制列的数据表,循环插入三元选择的模板
-                //DataTable dt_pic = GetPicDataTable_PicSYXT2T();
-                //List<byte[]> lt_by = new List<byte[]>();
-                //for (int i = 0; i < m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index.Count; i ++)
-                //{
-                //    byte[] newarr, newarr2;
-                //    newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i]);
-                //    lt_by.Add(newarr);
-                    
-                //    newarr2 = null;
-                //    DataRow dr = dt_pic.NewRow();
-                //    dr["pict"] = newarr;//图像二进制
-                //    dr["pict2"] = newarr2;//图像二进制
-                //    dt_pic.Rows.Add(dr);
-                //}
-                //if (lt_by.GroupBy(i => i).Where(g => g.Count() > 1).Count() >= 1)
-                //{
-                //    MessageBox.Show("图片重复");
-                //}
-
-
                 //创建二进制列的数据表,循环插入三元选择的模板
                 DataTable ls_dt = GetPicDataTable_PicSYXT2T();
                 DataTable ls_dt3t = GetPicDataTable_PicSYXT3T();
@@ -2430,8 +2212,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     for (int i = 0; i < m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index.Count; i = i + 2)
                     {
                         byte[] newarr, newarr2;
-                        newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i]);
-                        newarr2 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 1]);
+                        newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i], m_mbszclass);
+                        newarr2 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 1], m_mbszclass);
 
                         DataRow dr = ls_dt.NewRow();
                         dr["pict"] = newarr;//图像二进制
@@ -2452,9 +2234,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     for (int i = 0; i < m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index.Count; i = i + 3)
                     {
                         byte[] newarr, newarr2, newarr3;
-                        newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i]);
-                        newarr2 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 1]);
-                        newarr3 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 2]);
+                        newarr = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i], m_mbszclass);
+                        newarr2 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 1], m_mbszclass);
+                        newarr3 = GetByte_InsertReportTemplateChart_Trianglediagram(m_otsreport_export.m_mbszclass.M_SYXT.list_lbv_syxt_mblb_index[i + 2], m_mbszclass);
 
                         DataRow dr = ls_dt3t.NewRow();
                         dr["pict"] = newarr;//图像二进制

+ 19 - 7
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.cs

@@ -168,6 +168,14 @@ namespace OTSIncAReportApp
                 /// 报告备注
                 /// </summary>
                 public string str_bz { get; set; }
+                /// <summary>
+                /// 选择颗粒导出范围_内容
+                /// </summary>
+                public string str_xzkl { get; set; }
+                /// <summary>
+                /// 选择颗粒导出范围,索引
+                /// </summary>
+                public int int_xzkl { get; set; }
             }
             #endregion
 
@@ -594,7 +602,8 @@ namespace OTSIncAReportApp
             m_mbszclass.M_SY.str_bz = xmlutil2.Read("M_SY", "str_bz");
             m_mbszclass.M_SY.b_ck_ypsm = Convert.ToBoolean(xmlutil2.Read("M_SY", "b_ck_ypsm"));
             m_mbszclass.M_SY.b_ck_jggk = Convert.ToBoolean(xmlutil2.Read("M_SY", "b_ck_jggk"));
-
+            m_mbszclass.M_SY.str_xzkl= xmlutil2.Read("M_SY", "str_xzkl");
+            m_mbszclass.M_SY.int_xzkl = Convert.ToInt32(xmlutil2.Read("M_SY", "int_xzkl"));
             //页眉页脚
             m_mbszclass.M_YMYJ.str_tb_ymwb = xmlutil2.Read("M_YMYJ", "str_tb_ymwb");
             m_mbszclass.M_YMYJ.str_tb_KHH = xmlutil2.Read("M_YMYJ", "str_tb_KHH");
@@ -2021,19 +2030,19 @@ namespace OTSIncAReportApp
 
                     if (ls_str.IndexOf(table["rictbox18"].ToString()) > -1)
                     {
-                        m_export_reporttemplate.InsertReportTemplateTable_ElementAvgGrid();
-                        m_export_reporttemplate.InsertReportTemplateChart_InclusionAreaClassRatio("pie");
+                        m_export_reporttemplate.InsertReportTemplateTable_ElementAvgGrid(m_mbszclass);
+                        m_export_reporttemplate.InsertReportTemplateChart_InclusionAreaClassRatio("pie", m_mbszclass);
 
 
-                        m_export_reporttemplate.InsertReportTemplateTable_ElementCompositionAvgGrid();
-                        m_export_reporttemplate.InsertReportTemplateChart_InclusionAreaRatio("pie");
+                        m_export_reporttemplate.InsertReportTemplateTable_ElementCompositionAvgGrid(m_mbszclass);
+                        m_export_reporttemplate.InsertReportTemplateChart_InclusionAreaRatio("pie", m_mbszclass);
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
 
                     if (ls_str.IndexOf(table["rictbox22"].ToString()) > -1)
                     {
-                        m_export_reporttemplate.InsertReportTemplateTable_ParticleSizeGrid();
+                        m_export_reporttemplate.InsertReportTemplateTable_ParticleSizeGrid(m_mbszclass);
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
@@ -2055,7 +2064,7 @@ namespace OTSIncAReportApp
                     {
                         //三元图部分
                         if (m_mbszclass.M_SYXT.b_ck_syxt_xsmk)
-                            m_export_reporttemplate.InsertReportTemplateChart_Trianglediagram();
+                            m_export_reporttemplate.InsertReportTemplateChart_Trianglediagram(m_mbszclass);
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
@@ -2119,6 +2128,9 @@ namespace OTSIncAReportApp
                 m_mbszclass.M_SY.str_bz = xmlutil.Read("M_SY", "str_bz");
                 m_mbszclass.M_SY.b_ck_ypsm = Convert.ToBoolean(xmlutil.Read("M_SY", "b_ck_ypsm"));
                 m_mbszclass.M_SY.b_ck_jggk = Convert.ToBoolean(xmlutil.Read("M_SY", "b_ck_jggk"));
+
+                m_mbszclass.M_SY.str_xzkl = xmlutil.Read("M_SY", "str_xzkl");
+                m_mbszclass.M_SY.int_xzkl = Convert.ToInt32(xmlutil.Read("M_SY", "int_xzkl"));
                 //页眉页脚
                 m_mbszclass.M_YMYJ.str_tb_ymwb = xmlutil.Read("M_YMYJ", "str_tb_ymwb");
                 m_mbszclass.M_YMYJ.str_tb_KHH = xmlutil.Read("M_YMYJ", "str_tb_KHH");

+ 11 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.Designer.cs

@@ -115,6 +115,7 @@
             this.textBox_strBZ = new System.Windows.Forms.TextBox();
             this.groupBox9 = new System.Windows.Forms.GroupBox();
             this.label39 = new System.Windows.Forms.Label();
+            this.cb_ParticleRange = new System.Windows.Forms.ComboBox();
             this.groupBox1.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox6.SuspendLayout();
@@ -1075,11 +1076,20 @@
             this.label39.TabIndex = 75;
             this.label39.Text = "模板设置";
             // 
+            // cb_ParticleRange
+            // 
+            this.cb_ParticleRange.FormattingEnabled = true;
+            this.cb_ParticleRange.Location = new System.Drawing.Point(722, 47);
+            this.cb_ParticleRange.Name = "cb_ParticleRange";
+            this.cb_ParticleRange.Size = new System.Drawing.Size(121, 20);
+            this.cb_ParticleRange.TabIndex = 76;
+            // 
             // OTSReport_TemplateDesignerRM
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1014, 751);
+            this.Controls.Add(this.cb_ParticleRange);
             this.Controls.Add(this.button6);
             this.Controls.Add(this.button1);
             this.Controls.Add(this.label39);
@@ -1216,5 +1226,6 @@
         private System.Windows.Forms.Label ParticleList_2;
         private System.Windows.Forms.Label ParticleList_1;
         private System.Windows.Forms.ComboBox comboBox_p1;
+        private System.Windows.Forms.ComboBox cb_ParticleRange;
     }
 }

+ 17 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -46,6 +46,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         /// </summary>
         private void BindControl()
         {
+            //选择颗粒范围
+            cb_ParticleRange.Items.Add("全部颗粒");
+            cb_ParticleRange.Items.Add("选择颗粒");
+
             #region 元素选择
             string[] PeriodicTable = { "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hq", "TI", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Mc", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", "Ds", "Rg", "Unb" };
             comboBox_PeriodicTable.Items.AddRange(PeriodicTable);
@@ -235,6 +239,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.b_ck_ypsm.ToString(), "M_SY", "b_ck_ypsm");
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.b_ck_jggk.ToString(), "M_SY", "b_ck_jggk");
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.str_bz.ToString(), "M_SY", "str_bz");
+                //选择颗粒范围(全部颗粒,选择颗粒)
+                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.str_xzkl.ToString(), "M_SY", "str_xzkl");
+                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.int_xzkl.ToString(), "M_SY", "int_xzkl");
+
                 //页眉页脚
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_YMYJ.str_tb_ymwb.ToString(), "M_YMYJ", "str_tb_ymwb");
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_YMYJ.str_tb_KHH.ToString(), "M_YMYJ", "str_tb_KHH");
@@ -416,6 +424,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.b_ck_ypsm.ToString(), "M_SY", "b_ck_ypsm");
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.b_ck_jggk.ToString(), "M_SY", "b_ck_jggk");
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.str_bz.ToString(), "M_SY", "str_bz");
+                //选择颗粒范围(全部颗粒,选择颗粒)
+                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.str_xzkl.ToString(), "M_SY", "str_xzkl");
+                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.int_xzkl.ToString(), "M_SY", "int_xzkl");
                 //页眉页脚
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_YMYJ.str_tb_ymwb.ToString(), "M_YMYJ", "str_tb_ymwb");
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_YMYJ.str_tb_KHH.ToString(), "M_YMYJ", "str_tb_KHH");
@@ -657,12 +668,18 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //备注
             m_OTSReport_Export.m_mbszclass.M_SY.str_bz = textBox_strBZ.Text;
 
+            //选择颗粒导出范围
+            m_OTSReport_Export.m_mbszclass.M_SY.str_xzkl = cb_ParticleRange.Text;//颗粒范围内容
+            m_OTSReport_Export.m_mbszclass.M_SY.int_xzkl = cb_ParticleRange.SelectedIndex;//颗粒范围索引
+
         }
 
         private void LoadControls()
         {
             //备注
             textBox_strBZ.Text = m_OTSReport_Export.m_mbszclass.M_SY.str_bz;
+
+            cb_ParticleRange.Text = m_OTSReport_Export.m_mbszclass.M_SY.str_xzkl;
             //首页
             tb_ZBT.Text = m_OTSReport_Export.m_mbszclass.M_SY.str_tb_ZBT;
             tb_FBT.Text = m_OTSReport_Export.m_mbszclass.M_SY.str_tb_FBT;

+ 11 - 2
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -432,10 +432,19 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
-        public DataTable GetIncaSurfaceData()
+        public DataTable GetIncaSurfaceData(DataTable dt,int sel)
         {
             DataTable particlesAll = new DataTable();
-            particlesAll = GetInfoForPartucleDevidePage2("");
+            if (sel==0)
+            {
+                particlesAll = GetInfoForPartucleDevidePage2("");
+            }
+            else
+            {
+                particlesAll = dt.Copy();
+                particlesAll.Columns.Add("Element");
+            }
+            //particlesAll = GetInfoForPartucleDevidePage2("");
 
             DataTable elementchemistry = GetElementChemistry();
             for (int i = 0; i < particlesAll.Rows.Count; i++)

+ 8 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -147,6 +147,12 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\Bin\x64\Debug\CefSharp.WinForms.dll</HintPath>
     </Reference>
+    <Reference Include="DevExpress.Data.Desktop.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.Data.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.Printing.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.Sparkline.v20.1.Core, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.Utils.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
     <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
     </Reference>
@@ -237,6 +243,7 @@
     </Reference>
     <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
     <Reference Include="System.Data.SQLite, Version=1.0.115.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=AMD64">
       <HintPath>..\packages\System.Data.SQLite.x64.1.0.115.0\lib\net46\System.Data.SQLite.dll</HintPath>
     </Reference>
@@ -1235,6 +1242,7 @@
     <EmbeddedResource Include="Help.resx">
       <DependentUpon>Help.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>PublicResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>