Explorar el Código

报告程序修改新增样品对比功能

zhangjiaxin hace 3 años
padre
commit
05cbba5611

+ 113 - 27
OTSIncAReportApp/1-UI/Control_ECharts/EChart_ParticlesComposition.cs

@@ -41,6 +41,7 @@ namespace OTSIncAReportApp.Control_ECharts
         string url = "Resources/HTML/charts.html";
         //数据图类型:常用夹杂物分类CommonlyUsedClassify ,颗粒成分PComponent,元素成分EComponent,颗粒尺寸分布PSize
         string ComSel { get; set; }
+        public bool Report { get; set; }
         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", "未识别颗粒" };
@@ -63,15 +64,48 @@ 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 = "";
             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 (Report)
+            {
+                sou = m_DataMgr.ResultFilesList[m_DataMgr.getSelectedIndex()].FileName.ToString();
+                
+            }
+            else
+            {
+                sou = m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+            }
+            Report = false;
+
             if (sou.Contains("+"))
             {
                 if (m_ReportApp.more)
@@ -272,24 +306,7 @@ namespace OTSIncAReportApp.Control_ECharts
                 }
                 listName.Add(dt.Rows[i]["TypeName"].ToString());
             }
-            //for (int i = 0; i < dt.Rows.Count; i++)
-            //{
-            //    if (Convert.ToInt32(dt.Rows[i]["TypeId"]) > 100)
-            //    {
-            //        continue;
-            //    }
-            //    int index = FLID.IndexOf(Convert.ToInt32(dt.Rows[i]["TypeId"]));
-            //    if (index == -1)
-            //    {
-            //        index = 7;
-            //    }
-            //    string name = NameList[index];
-            //    if (listName.IndexOf(name) == -1)
-            //    {
-            //        listName.Add(name);
-
-            //    }
-            //}
+            
             chart.ListName = listName;
 
             //设置数据
@@ -825,7 +842,68 @@ namespace OTSIncAReportApp.Control_ECharts
                     particledata = new DataOperation.DataAccess.ParticleData(resultFile.FilePath);
                     switch (ComSel)
                     {
+                        case "InclusionareaRatio":
+                             dt = particledata.GetAreaByAllIncA("");
+                            //设置标签名称
+                           
+                            for (int a = 0; a < dt.Rows.Count; a++)
+                            {
+                                if (Convert.ToInt32(dt.Rows[a]["TypeId"]) < 100)
+                                {
+                                    continue;
+                                }
+                                listName.Add(dt.Rows[a]["TypeName"].ToString());
+                            }
+
+                            //设置数据
+                            List<Item> listData3 = new List<Item>();
+                            for (int k = 0; k < dt.Rows.Count; k++)
+                            {
+                                string str = dt.Rows[k]["ar"].ToString();
+                                string name = dt.Rows[k]["TypeName"].ToString();
+                                if (Convert.ToInt32(dt.Rows[k]["TypeId"]) < 100)
+                                {
+                                    continue;
+                                }
+                                Item item = new Item()
+                                {
+                                    value = decimal.Round(decimal.Parse(dt.Rows[k]["ar"].ToString()), 2).ToString(),
+                                    name = name
+                                };
+                                listData3.Add(item);
+                            }
+                            listDataMore.Add(listData3);
+                            break;
                         case "CommonlyUsedClassify":
+
+                            //计算分类整个表的数据
+                            dt = ClassificationIntegration(resultFile.FilePath);
+                            ////List<string> listName = new List<string>();
+                            ////ListName
+                            for (int a = 0; a < dt.Rows.Count; a++)
+                            {
+                                listName.Add(dt.Rows[a]["e1"].ToString());
+                            }
+                            //chart.ListName = listName;
+                            ////DataTable dt 
+                            //设置数据
+                            List<Item> listData2 = new List<Item>();
+                            ////ListData
+                            for (int k = 0; k < dt.Rows.Count; k++)
+                            {
+                                string str = dt.Rows[k]["Cunt"].ToString();
+                                string name = dt.Rows[k]["e1"].ToString();
+
+
+                                Item item = new Item()
+                                {
+                                    value = decimal.Round(decimal.Parse(str), 2).ToString(),
+                                    name = name
+                                };
+                                listData2.Add(item);
+                                //listData2.Add(item);
+                            }
+                            listDataMore.Add(listData2);
                             break;
 
                         case "PComponent":
@@ -870,8 +948,16 @@ namespace OTSIncAReportApp.Control_ECharts
                                 string name = dt.Rows[k]["TypeName"].ToString();
                                 if (Convert.ToInt32(dt.Rows[k]["TypeId"]) < 100)
                                 {
-                                    int index = FLID.IndexOf(Convert.ToInt32(dt.Rows[k]["TypeId"]));
-                                    name = NameList[index];
+                                    if (Convert.ToInt32(dt.Rows[k]["TypeId"])==-1)
+                                    {
+                                        name = NameList[7];
+                                    }
+                                    else
+                                    {
+                                        int index = FLID.IndexOf(Convert.ToInt32(dt.Rows[k]["TypeId"]));
+                                        name = NameList[index];
+                                    }
+                                    
                                 }
 
                                 Item item = new Item()
@@ -963,7 +1049,7 @@ namespace OTSIncAReportApp.Control_ECharts
                                 case "DMIN":
                                     po = "DMIN";
                                     break;
-                                case "Area":
+                                case "CIRCLE":
                                     po = "Area";
                                     break;
                                 case "FERET":
@@ -973,7 +1059,7 @@ namespace OTSIncAReportApp.Control_ECharts
                             DataTable dtp = particledata.GetParticleAll(filedAndParticl);
 
                             //设置数据
-                            List<Item> listData2 = new List<Item>();
+                            List<Item> listData4 = new List<Item>();
                             //ListData
                             for (int k = 0; k < temp.Count; k++)
                             {
@@ -990,9 +1076,9 @@ namespace OTSIncAReportApp.Control_ECharts
                                     value = datas.Count().ToString(),
                                     name = str
                                 };
-                                listData2.Add(item);
+                                listData4.Add(item);
                             }
-                            listDataMore.Add(listData2);
+                            listDataMore.Add(listData4);
                             break;
                     }
                 }

+ 11 - 2
OTSIncAReportApp/1-UI/Control_ECharts/EChart_Trianglediagram.cs

@@ -36,6 +36,7 @@ namespace OTSIncAReportApp.Control_ECharts
         frmReportConditionChoose m_condition;
         ResultDataMgr m_DataMgr;
         private bool ReportExporting = false;
+        public bool Report { set; get; }
         #endregion
 
         #region 构造函数及窗体加载
@@ -107,8 +108,16 @@ namespace OTSIncAReportApp.Control_ECharts
 
             //将所有的测量结果名添加到list中
             m_list_string_samplename.Clear();
-
-            string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+            string sou = "";
+            if (Report)
+            {
+                sou = m_DataMgr.ResultFilesList[m_DataMgr.getSelectedIndex()].FileName.ToString();
+            }
+            else
+            {
+                sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+            }
+            Report = false;
             if (sou.Contains("+"))
             {
                 if (m_ReportApp.more)

+ 57 - 31
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.cs

@@ -1,4 +1,5 @@
-using OTSIncAReportApp.DataOperation.DataAccess;
+using OTSIncAReportApp;
+using OTSIncAReportApp.DataOperation.DataAccess;
 using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
 using OTSIncAReportGraph.Class;
@@ -37,6 +38,10 @@ namespace OTSIncAReportGrids
 
         OTSIncAReportApp.OTSSampleReportInfo.ReportCondition source;
         OTSIncAReportApp.frmReportApp m_ReportApp;
+
+        frmReportConditionChoose m_condition;
+
+        int gridheight = 0;
         #endregion
 
         #region 多数据源
@@ -113,6 +118,8 @@ namespace OTSIncAReportGrids
             //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.GetPropIndexByPropItemName(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);
+            gridView.MergeColumnNames.Add(filename);
+            gridView.AddSpanHeader(1, gridView.Columns.Count - 1, filename);
             if (sel == 1)
             {
                 List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
@@ -286,11 +293,11 @@ namespace OTSIncAReportGrids
                         if (con == "CIRCLE")
                         {
                             double Area = Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name]);
-                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Math.Sqrt(Area / Math.PI) * 2,2);
+                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Math.Sqrt(Area / Math.PI) * 2, 2);
                         }
                         else
                         {
-                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name])*2, 2);
+                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name]) * 2, 2);
                         }
                         gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
                     }
@@ -306,8 +313,8 @@ namespace OTSIncAReportGrids
                             gridView.Rows[add_rowindex].Cells[k].Value = 0;
                         }
                         else
-                        { 
-                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i]["Area"]) * 100/ totalArea, 5); 
+                        {
+                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i]["Area"]) * 100 / totalArea, 5);
                         }
                         gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
 
@@ -321,6 +328,7 @@ namespace OTSIncAReportGrids
                 }
             }
 
+            gridView.Name = "gridView" + num.ToString();
             SetDataGridViewStyle(gridView);
             panel1.Controls.Add(gridView);
 
@@ -331,26 +339,6 @@ namespace OTSIncAReportGrids
         /// </summary>
         private void SetDataGridViewStyle(OTSGridView gridView)
         {
-            gridView.AllowUserToAddRows = false;
-            gridView.AllowUserToDeleteRows = false;
-            gridView.AllowUserToResizeRows = false;
-            gridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
-            gridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            gridView.ContextMenuStrip = this.contextMenuStrip1;
-            gridView.Dock = System.Windows.Forms.DockStyle.Fill;
-            gridView.Location = new System.Drawing.Point(0, 0);
-            gridView.Margin = new System.Windows.Forms.Padding(2);
-            gridView.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
-            gridView.Name = "Gview_gz";
-            gridView.ReadOnly = true;
-            gridView.RowHeadersVisible = false;
-            gridView.RowHeadersWidth = 40;
-            gridView.RowTemplate.Height = 30;
-            gridView.Size = new System.Drawing.Size(667, 520);
-            gridView.TabIndex = 0;
-            gridView.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.Gview_gz_SortCompare);
-            gridView.Sorted += new System.EventHandler(this.Gview_gz_Sorted);
-
             //用户不能调整标题的高度
             gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
 
@@ -384,6 +372,34 @@ namespace OTSIncAReportGrids
 
             //设置序号列不可以设置宽度
             gridView.Columns[0].Resizable = DataGridViewTriState.False;
+            gridView.AllowUserToAddRows = false;
+            gridView.AllowUserToDeleteRows = false;
+            gridView.AllowUserToResizeRows = false;
+            gridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
+            gridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            gridView.ContextMenuStrip = this.contextMenuStrip1;
+            gridView.BorderStyle = 0;
+
+            //gridView.Dock = System.Windows.Forms.DockStyle.Fill;
+            //gridView.Location = new System.Drawing.Point(0, 0);
+            gridView.Location = new System.Drawing.Point(0, gridheight);
+            gridView.Margin = new System.Windows.Forms.Padding(2);
+            gridView.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
+            //gridView.Name = "Gview_gz";
+            gridView.ReadOnly = true;
+            gridView.RowHeadersVisible = false;
+            gridView.RowHeadersWidth = 40;
+            gridView.RowTemplate.Height = 30;
+            //gridView.Size = new System.Drawing.Size(667, 520);
+            gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
+            gridheight = gridheight + gridView.RowCount * 30 + 80;
+            gridView.TabIndex = 0;
+            gridView.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.Gview_gz_SortCompare);
+            gridView.Sorted += new System.EventHandler(this.Gview_gz_Sorted);
+
+            //先设置一下头的高度,否则会太矮不好看
+            gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
+            gridView.ColumnHeadersHeight = 40;
 
         }
         #endregion
@@ -403,7 +419,7 @@ namespace OTSIncAReportGrids
             result = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()];
             source = m_ReportApp.m_conditionChoose.m_SourceGridData;
 
-
+            m_condition= ReportApp.m_conditionChoose;
             InitializeComponent();
             //国际化
             lan = new Language(this);
@@ -413,8 +429,10 @@ namespace OTSIncAReportGrids
         private void CompositionDistributionGrid_Load(object sender, EventArgs e)
         {
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
-           //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
-            string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+            //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+            string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+
+            //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++)
@@ -428,7 +446,15 @@ namespace OTSIncAReportGrids
             }
             else
             {
-                BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
+                for (int i=0;i< m_ReportApp.m_rstDataMgr.ResultFilesList.Count;i++)
+                {
+                    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[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
                 ////设置grid风格
                 //SetDataGridViewStyle();
             }
@@ -438,14 +464,14 @@ namespace OTSIncAReportGrids
         #region 相关事件
         private void ToolStripMenuItem1_Click(object sender, EventArgs e)
         {
-            OTSGridView otv = (OTSGridView)((ContextMenuStrip)((sender as ToolStripMenuItem).Owner)).SourceControl;
+            OTSGridView otv = (OTSGridView)((ContextMenuStrip)(sender as ToolStripMenuItem).Owner).SourceControl;
             //复制整个表
             CopyAll(otv);
         }
 
         private void ToolStripMenuItem2_Click(object sender, EventArgs e)
         {
-            OTSGridView otv = (OTSGridView)((ContextMenuStrip)((sender as ToolStripMenuItem).Owner)).SourceControl;
+            OTSGridView otv = (OTSGridView)((ContextMenuStrip)(sender as ToolStripMenuItem).Owner).SourceControl;
             CopySelected(otv);
         }
 

+ 165 - 60
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.cs

@@ -1,4 +1,6 @@
-using OTSIncAReportApp.OTSSampleReportInfo;
+using OTSIncAReportApp;
+using OTSIncAReportApp.OTSDataMgrFunction;
+using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
 using OTSIncAReportGraph.Class;
 using System;
@@ -32,20 +34,27 @@ namespace OTSIncAReportGrids
         OTSIncAReportApp.DataOperation.DataAccess.ParticleData particledata;
         OTSIncAReportApp.frmReportApp m_ReportApp;
         //internal string condition;
+        private DataGridView dgv = new DataGridView();
+        frmReportConditionChoose m_condition;
+        private ResultDataMgr m_DataMgr;
+        int gridheight = 0;
+        public bool Report { set; get; }
         #endregion
 
         #region 自定义方法
         /// <summary>
         /// 绑定datagridview数据
         /// </summary>
-        public void BindDataGridView()
+        public void BindDataGridView(string path, int num, string filename)
         {
             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() };
+            OTSIncAReportApp.DataOperation.DataAccess.ParticleData particledata = new OTSIncAReportApp.DataOperation.DataAccess.ParticleData(path);
+            OTSGridView gridView = new OTSGridView();
             //创建Grid的列
             for (int i = 0; i < colid.Count; i++)
             {
-                Gview_gz.Columns.Add(colid[i], colname[i]);
+                gridView.Columns.Add(colid[i], colname[i]);
             }
             DataTable dte = particledata.GetAllElement();
             foreach (DataRow item in dte.Rows)
@@ -53,7 +62,7 @@ namespace OTSIncAReportGrids
                 DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
                 iconColumn.Name = item["name"].ToString();
                 iconColumn.HeaderText = item["name"].ToString();
-                Gview_gz.Columns.Add(iconColumn);
+                gridView.Columns.Add(iconColumn);
             }
             List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
             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() };
@@ -61,6 +70,8 @@ namespace OTSIncAReportGrids
             //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 = "";
+            gridView.MergeColumnNames.Add(filename);
+            gridView.AddSpanHeader(1, gridView.Columns.Count - 1, filename);
             DataTable dt;
             if (sel == 1)
             {
@@ -96,39 +107,39 @@ namespace OTSIncAReportGrids
                 }
                 double total = Convert.ToDouble(dt.Rows[i]["ar"]);
                 //double small = Convert.ToDouble(dt.Rows[i]["small"]);
-                int add_rowindex = Gview_gz.Rows.Add();
-                Gview_gz.Rows[add_rowindex].Cells[0].Value = add_rowindex + 1;
-                Gview_gz.Rows[add_rowindex].Cells[1].Value = dt.Rows[i]["TypeName"];
-                Gview_gz.Rows[add_rowindex].Cells[1].Style.BackColor = Color.Azure;
-                Gview_gz.Rows[add_rowindex].Cells[2].Value = Math.Round(total, 2);
-                Gview_gz.Rows[add_rowindex].Cells[2].Style.BackColor = Color.Azure;
+                int add_rowindex = gridView.Rows.Add();
+                gridView.Rows[add_rowindex].Cells[0].Value = add_rowindex + 1;
+                gridView.Rows[add_rowindex].Cells[1].Value = dt.Rows[i]["TypeName"];
+                gridView.Rows[add_rowindex].Cells[1].Style.BackColor = Color.Azure;
+                gridView.Rows[add_rowindex].Cells[2].Value = Math.Round(total, 2);
+                gridView.Rows[add_rowindex].Cells[2].Style.BackColor = Color.Azure;
                 //Gview_gz.Rows[add_rowindex].Cells[3].Value = Math.Round(small, 2);
                 //Gview_gz.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
-                Gview_gz.Rows[add_rowindex].Cells[3].Value = dt.Rows[i]["con"];
-                Gview_gz.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
+                gridView.Rows[add_rowindex].Cells[3].Value = dt.Rows[i]["con"];
+                gridView.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
                 DataTable dtp = particledata.GetAreaByIncA(dt.Rows[i]["TypeId"].ToString(), filedAndParticl);
 
-                for (int j = 4; j < Gview_gz.Columns.Count; j++)
+                for (int j = 4; j < gridView.Columns.Count; j++)
                 {
                     int col = 0;
                     foreach (DataRow dr in dtp.Rows)
                     {
 
-                        if (Gview_gz.Columns[j].Name == dr["name"].ToString())
+                        if (gridView.Columns[j].Name == dr["name"].ToString())
                         {
 
                             double ar = Convert.ToDouble(dr["pc"]);
                             double p = Math.Round(ar / total, 2);
-                            Gview_gz.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap((float)p, Color.Azure);
-                            Gview_gz.Rows[add_rowindex].Cells[j].Tag = p;
+                            gridView.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap((float)p, Color.Azure);
+                            gridView.Rows[add_rowindex].Cells[j].Tag = p;
                             break;
                         }
                         col++;
                     }
                     if (col == dtp.Rows.Count)
                     {
-                        Gview_gz.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap(0, Color.Azure);
-                        Gview_gz.Rows[add_rowindex].Cells[j].Tag = 0;
+                        gridView.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap(0, Color.Azure);
+                        gridView.Rows[add_rowindex].Cells[j].Tag = 0;
                     }
                 }
             }
@@ -138,8 +149,8 @@ namespace OTSIncAReportGrids
                 {
                     continue;
                 }
-                int add_rowindex = Gview_gz.Rows.Add();
-                Gview_gz.Rows[add_rowindex].Cells[0].Value = add_rowindex + 1;
+                int add_rowindex = gridView.Rows.Add();
+                gridView.Rows[add_rowindex].Cells[0].Value = add_rowindex + 1;
                 int index = FLID.IndexOf(Convert.ToInt32(dt.Rows[i]["TypeId"]));
                 if (index == -1)
                 {
@@ -148,85 +159,136 @@ namespace OTSIncAReportGrids
                 string name = NameList[index];
                 double total = Convert.ToDouble(dt.Rows[i]["ar"]);
                 //double small = Convert.ToDouble(dt.Rows[i]["small"]);
-                Gview_gz.Rows[add_rowindex].Cells[1].Value = dt.Rows[i]["TypeName"];
+                gridView.Rows[add_rowindex].Cells[1].Value = dt.Rows[i]["TypeName"];
                 //Gview_gz.Rows[add_rowindex].Cells[1].Value = name;
-                Gview_gz.Rows[add_rowindex].Cells[1].Style.BackColor = Color.Azure;
-                Gview_gz.Rows[add_rowindex].Cells[2].Value = Math.Round(total, 2);
-                Gview_gz.Rows[add_rowindex].Cells[2].Style.BackColor = Color.Azure;
+                gridView.Rows[add_rowindex].Cells[1].Style.BackColor = Color.Azure;
+                gridView.Rows[add_rowindex].Cells[2].Value = Math.Round(total, 2);
+                gridView.Rows[add_rowindex].Cells[2].Style.BackColor = Color.Azure;
                 //Gview_gz.Rows[add_rowindex].Cells[3].Value = Math.Round(small, 2);
-                Gview_gz.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
-                Gview_gz.Rows[add_rowindex].Cells[3].Value = dt.Rows[i]["con"];
+                gridView.Rows[add_rowindex].Cells[3].Style.BackColor = Color.Azure;
+                gridView.Rows[add_rowindex].Cells[3].Value = dt.Rows[i]["con"];
                 //Gview_gz.Rows[add_rowindex].Cells[4].Style.BackColor = Color.Azure;
                 DataTable dtp = particledata.GetAreaByIncA(dt.Rows[i]["TypeId"].ToString(), filedAndParticl);
-                for (int j = 4; j < Gview_gz.Columns.Count; j++)
+                for (int j = 4; j < gridView.Columns.Count; j++)
                 {
                     int col = 0;
                     foreach (DataRow dr in dtp.Rows)
                     {
-                        if (Gview_gz.Columns[j].Name == dr["name"].ToString())
+                        if (gridView.Columns[j].Name == dr["name"].ToString())
                         {
 
                             double ar = Convert.ToDouble(dr["pc"]);
                             double p = Math.Round(ar / total, 2);
-                            Gview_gz.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap((float)p, Color.Azure);
-                            Gview_gz.Rows[add_rowindex].Cells[j].Tag = p;
+                            gridView.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap((float)p, Color.Azure);
+                            gridView.Rows[add_rowindex].Cells[j].Tag = p;
                             break;
                         }
                         col++;
                     }
                     if (col == dtp.Rows.Count)
                     {
-                        Gview_gz.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap(0, Color.Azure);
-                        Gview_gz.Rows[add_rowindex].Cells[j].Tag = 0;
+                        gridView.Rows[add_rowindex].Cells[j].Value = DrawFunction.GetProcessBitmap(0, Color.Azure);
+                        gridView.Rows[add_rowindex].Cells[j].Tag = 0;
                     }
                 }
             }
+            gridView.Name = "gridView" + num.ToString();
+            dgv = gridView;
+            //设置grid风格
+            SetDataGridViewStyle(gridView);
+            panel1.Controls.Add(gridView);
         }
 
         /// <summary>
         /// 设置DataGridView样式
         /// </summary>
-        private void SetDataGridViewStyle()
+        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;
+            //}
+
             //用户不能调整标题的高度
-            //Gview_gz.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+            gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
 
             //用户不能调整 行高
-            Gview_gz.AllowUserToResizeRows = false;
+            gridView.AllowUserToResizeRows = false;
 
             //改变行的高度;
-            //Gview_gz.RowTemplate.Height = 20;
+            //gridView.RowTemplate.Height = 20;
 
             //点击选择整行
-            Gview_gz.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+            gridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
 
             //居中显示
             System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            Gview_gz.DefaultCellStyle = dataGridViewCellStyle1;
-            Gview_gz.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
+            gridView.DefaultCellStyle = dataGridViewCellStyle1;
+            gridView.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
 
             //再次重覆禁用拖动表头高度,居然有效果了
-            //Gview_gz.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+            gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
 
             //设置grid可以复制
-            Gview_gz.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
+            gridView.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
 
             //设置每列的宽度
-            Gview_gz.Columns[0].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
-            Gview_gz.Columns[1].Width = 200;
+            gridView.Columns[0].Width = 40;//第一列序号的宽度设置一下吧,要不太丑
+            gridView.Columns[1].Width = 200;
 
             //设置序号列不排序
-            Gview_gz.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
+            gridView.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
 
             //设置序号列不可以设置宽度
-            Gview_gz.Columns[0].Resizable = DataGridViewTriState.False;
-
-            //设置所有行的高度
-            for (int i = 0; i < Gview_gz.Rows.Count; i++)
-            {
-                Gview_gz.Rows[i].Height = 30;
-            }
+            gridView.Columns[0].Resizable = DataGridViewTriState.False;
+            gridView.AllowUserToAddRows = false;
+            gridView.AllowUserToDeleteRows = false;
+            gridView.AllowUserToResizeRows = false;
+            gridView.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
+            gridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            gridView.ContextMenuStrip = this.contextMenuStrip1;
+            gridView.BorderStyle = 0;
+
+            //gridView.Dock = System.Windows.Forms.DockStyle.Fill;
+            //gridView.Location = new System.Drawing.Point(0, 0);
+            gridView.Location = new System.Drawing.Point(0, gridheight);
+            gridView.Margin = new System.Windows.Forms.Padding(2);
+            gridView.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
+            //gridView.Name = "Gview_gz";
+            gridView.ReadOnly = true;
+            gridView.RowHeadersVisible = false;
+            gridView.RowHeadersWidth = 40;
+            gridView.RowTemplate.Height = 30;
+            //gridView.Size = new System.Drawing.Size(667, 520);
+            gridView.Size = new System.Drawing.Size(gridView.ColumnCount * 100 + 60, gridView.RowCount * 30 + 30);
+            gridheight = gridheight + gridView.RowCount * 30 + 80;
+            gridView.TabIndex = 0;
+            gridView.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.Gview_gz_SortCompare);
+            gridView.Sorted += new System.EventHandler(this.Gview_gz_Sorted);
+
+            //先设置一下头的高度,否则会太矮不好看
+            gridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
+            gridView.ColumnHeadersHeight = 40;
 
         }
         #endregion
@@ -243,20 +305,62 @@ namespace OTSIncAReportGrids
         {
             m_ReportApp = ReportApp;
             result = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()];
-
+            m_condition = ReportApp.m_conditionChoose;
             InitializeComponent();
             lan = new Language(this);
             table = lan.GetNameTable(this.Name);
+            m_DataMgr = ReportApp.m_rstDataMgr;
         }
 
         private void ElementContentGrid_Load(object sender, EventArgs e)
         {
-            particledata = new OTSIncAReportApp.DataOperation.DataAccess.ParticleData(result.FilePath);
-            //创建datatable的列数据,及分栏,及相关行数据
-            BindDataGridView();
+            string sou = "";
+            if (Report)
+            {
+                sou = m_DataMgr.ResultFilesList[m_DataMgr.getSelectedIndex()].FileName.ToString();
+            }
+            else
+            {
+                sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+            }
+            Report = false;
 
-            //设置grid风格
-            SetDataGridViewStyle();
+            //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++)
+                {
+                    OTSIncAReportApp.DataOperation.Model.ResultFile resultFile = m_ReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.FileName == sou.Split('+')[i]);
+                    if (resultFile != null)
+                    {
+                        BindDataGridView(resultFile.FilePath, i, resultFile.FileName);
+                    }
+                }
+            }
+            else
+            {
+                for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
+                {
+                    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[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
+                ////设置grid风格
+                //SetDataGridViewStyle();
+            }
+
+
+
+
+            //particledata = new OTSIncAReportApp.DataOperation.DataAccess.ParticleData(result.FilePath);
+            ////创建datatable的列数据,及分栏,及相关行数据
+            //BindDataGridView();
+
+            ////设置grid风格
+            //SetDataGridViewStyle();
         }
         #endregion
 
@@ -298,9 +402,9 @@ namespace OTSIncAReportGrids
             Gview_gz.Rows.Clear();
             Gview_gz.Columns.Clear();
 
-            BindDataGridView();
+            //BindDataGridView();
 
-            SetDataGridViewStyle();
+            //SetDataGridViewStyle();
         }
 
         private void Gview_gz_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
@@ -353,7 +457,8 @@ namespace OTSIncAReportGrids
         {
             out_dt = m_dt;
             //out_dt = (this.Gview_gz.DataSource as DataTable);
-            out_dg = this.Gview_gz;
+            //out_dg = this.Gview_gz;
+            out_dg = dgv;
         }
         #endregion
 

+ 29 - 36
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.designer.cs

@@ -32,58 +32,39 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ElementCompositionAvgGrid));
             this.panel1 = new System.Windows.Forms.Panel();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
-            this.Gview_gz = new OTSGridView();
             this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
+            this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.Gview_gz)).BeginInit();
             this.contextMenuStrip1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
             this.SuspendLayout();
             // 
             // panel1
             // 
+            this.panel1.AutoScroll = true;
+            this.panel1.Controls.Add(this.pictureBox2);
             this.panel1.Controls.Add(this.pictureBox1);
-            this.panel1.Controls.Add(this.Gview_gz);
             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(1000, 780);
-            this.panel1.TabIndex = 4;
+            this.panel1.Size = new System.Drawing.Size(667, 520);
+            this.panel1.TabIndex = 5;
             // 
             // pictureBox1
             // 
             this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
-            this.pictureBox1.Location = new System.Drawing.Point(1803, 1186);
-            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pictureBox1.Location = new System.Drawing.Point(1202, 791);
             this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(254, 48);
+            this.pictureBox1.Size = new System.Drawing.Size(169, 32);
             this.pictureBox1.TabIndex = 1;
             this.pictureBox1.TabStop = false;
             // 
-            // Gview_gz
-            // 
-            this.Gview_gz.AllowUserToAddRows = false;
-            this.Gview_gz.AllowUserToDeleteRows = false;
-            this.Gview_gz.AllowUserToResizeRows = false;
-            this.Gview_gz.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
-            this.Gview_gz.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
-            this.Gview_gz.ContextMenuStrip = this.contextMenuStrip1;
-            this.Gview_gz.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.Gview_gz.Location = new System.Drawing.Point(0, 0);
-            this.Gview_gz.MergeColumnHeaderBackColor = System.Drawing.SystemColors.ButtonHighlight;
-            this.Gview_gz.MergeColumnNames = ((System.Collections.Generic.List<string>)(resources.GetObject("Gview_gz.MergeColumnNames")));
-            this.Gview_gz.Name = "Gview_gz";
-            this.Gview_gz.ReadOnly = true;
-            this.Gview_gz.RowHeadersVisible = false;
-            this.Gview_gz.RowHeadersWidth = 40;
-            this.Gview_gz.RowTemplate.Height = 23;
-            this.Gview_gz.Size = new System.Drawing.Size(1000, 780);
-            this.Gview_gz.TabIndex = 0;
-            // 
             // contextMenuStrip1
             // 
             this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
@@ -93,13 +74,13 @@
             this.toolStripSeparator1,
             this.ToolStripMenuItem3});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(215, 106);
+            this.contextMenuStrip1.Size = new System.Drawing.Size(169, 100);
             // 
             // ToolStripMenuItem1
             // 
             this.ToolStripMenuItem1.Image = global::OTSIncAReportApp.Properties.Resources.复制;
             this.ToolStripMenuItem1.Name = "ToolStripMenuItem1";
-            this.ToolStripMenuItem1.Size = new System.Drawing.Size(214, 32);
+            this.ToolStripMenuItem1.Size = new System.Drawing.Size(168, 30);
             this.ToolStripMenuItem1.Text = "复制整个表";
             this.ToolStripMenuItem1.Click += new System.EventHandler(this.ToolStripMenuItem1_Click);
             // 
@@ -107,35 +88,46 @@
             // 
             this.ToolStripMenuItem2.Image = global::OTSIncAReportApp.Properties.Resources.复制全部;
             this.ToolStripMenuItem2.Name = "ToolStripMenuItem2";
-            this.ToolStripMenuItem2.Size = new System.Drawing.Size(214, 32);
+            this.ToolStripMenuItem2.Size = new System.Drawing.Size(168, 30);
             this.ToolStripMenuItem2.Text = "复制选择区域";
             this.ToolStripMenuItem2.Click += new System.EventHandler(this.ToolStripMenuItem2_Click);
             // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(211, 6);
+            this.toolStripSeparator1.Size = new System.Drawing.Size(165, 6);
             // 
             // ToolStripMenuItem3
             // 
             this.ToolStripMenuItem3.Image = global::OTSIncAReportApp.Properties.Resources.恢复;
             this.ToolStripMenuItem3.Name = "ToolStripMenuItem3";
-            this.ToolStripMenuItem3.Size = new System.Drawing.Size(214, 32);
+            this.ToolStripMenuItem3.Size = new System.Drawing.Size(168, 30);
             this.ToolStripMenuItem3.Text = "恢复至初始状态";
             this.ToolStripMenuItem3.Click += new System.EventHandler(this.ToolStripMenuItem3_Click);
             // 
+            // pictureBox2
+            // 
+            this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.pictureBox2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox2.BackgroundImage")));
+            this.pictureBox2.Location = new System.Drawing.Point(1198, 790);
+            this.pictureBox2.Name = "pictureBox2";
+            this.pictureBox2.Size = new System.Drawing.Size(170, 30);
+            this.pictureBox2.TabIndex = 2;
+            this.pictureBox2.TabStop = false;
+            // 
             // ElementCompositionAvgGrid
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.panel1);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Name = "ElementCompositionAvgGrid";
-            this.Size = new System.Drawing.Size(1000, 780);
+            this.Size = new System.Drawing.Size(667, 520);
             this.Load += new System.EventHandler(this.ElementContentGrid_Load);
             this.panel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.Gview_gz)).EndInit();
             this.contextMenuStrip1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -150,5 +142,6 @@
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem3;
         public OTSGridView Gview_gz;
         private System.Windows.Forms.PictureBox pictureBox1;
+        private System.Windows.Forms.PictureBox pictureBox2;
     }
 }

+ 32 - 9
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.resx

@@ -118,6 +118,38 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="pictureBox2.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAKoAAAAfCAYAAAB3cVZEAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+        wwAADsMBx2+oZAAABhBJREFUeF7tmI1NZDEMhGmBGmiBHiiBGmiBDuiADqiACmiABuiAHvb0oTU3O2s7
+        eYvQ3ZMykgW8OI5/xk7urg4LCzvAIurCr+Lt7e3w+Ph4uLu7O1xdXZ3I7e3t4eHh4UtnhEXUhV8B5Lu5
+        uTkjZyUQ+f39/bj7HEOifnx8pB1xfX399e35+fnw+fl51D4Ha53DdBX2OUeB05n+SJ6eno4W/gIf8BN/
+        8Vv1+Zad77i/vz/ZxySoQJFCj/MuBXY4hxzp2eQTf15eXo6ap/AYZ4Q8KDRnrkeOu5qTT90zK/hd1aEk
+        Ko7MHsgBVTcQbLbHBRuaeJKR6Y2E8xT8PVu4qvBV07y+vh41TqG+Q6qtoFhOkEogsZJGm2SLQPwAcY1y
+        5sQO0FiqR/zUwPlBjJzj+pXdlKgE7l08kqob3JFOsBFJv4So7sOWs0My8kHgTBf7GZRklU4FCjrbWCHU
+        KnApUSPu2ZssIxQ2VMeHRgWPOePRGVEzktIVFCtIxE/+9oRmRVFbmlCQdW5GlIASgH0dnKToQ35NAmdl
+        sTqqm6XyQXVmiwUykhKz5gT/syaubgPg+j7dFJpjhDxG3TmbeIIPCnTUd12neZjYus7f6of6mOXsjKhe
+        FAoZjjq8g7LC6XpGZD8PhyuoXtbRgcyvqjjEprqI62rxnNjeWOzVdYo0C7fdTWPPm17dDidfBc+FD5YO
+        EDP2aQ275yN1icGhN0HGgROv2eSGKpIGVB9R+DWUdYp3ezUZnAAdoel41R2RxQvp+rqmBUGcTL4+C9/X
+        NSLw3Hb6Osk6Pbe5hajRZMoZ6q32MgldPXtIVL8uK9IoVB9RuKMZYXyKVJPPC+mTLDAiUoaOqN4gJFZ9
+        pjAKnSBbCu3NpU+UDLNE9eGDfxV8oiIz+dN9oc83b5CIiZ/8rbY3EVUNI8H2DqqPKJz4Dk929j4MuK2q
+        kFyBqlcRWtERVYkfpOxuAbU1U2TgzTBD8FmieuOqrxk8Fwh16fKoT62w73kbcUnjad+oHnj35lHoHiea
+        Th5NPk5TbG+MLhndFFOovU5P4cXRJtAGCTL4lNJc6fcs4Rmc+DP7vF5VU/gbsbqxAsTm0z2E+DPCqf/R
+        5HpuN8UDevuGDcU3Uf2azsavoyM3AenaSEbTR3Wr6eGTqdJz6B4ntzaI5kS/I8Tr52cJz+C3wMy+WXJ7
+        E86AWPwGCyFuJ6v6EtBz2RPNz170nbyagwzfXz3w0RUBvFt1j5O4EyVABrdV6bvezNWr11a2R9d04ntj
+        E7vbmoWTqXrWKLxRqj2qM9u4ARrPfUO8KTKiOjdctIY61KqbvCTqqKsx7le3dprbcyEBBDxTFCdF9USY
+        JbTCC6G23Z76yu+6RoI1Zog0C/dhBPerOssn/MwVnMGnqxNe446nBT+dHypKdiV1NSAvnqjeMT6J/Dr7
+        CTxRFbm3TlSfgP7G1gbJ3rs61VjXmLeQwok6al6fplWt+D6jN4LntSOqDgfISk6UsOxVkqqP3T+mS6K6
+        MwpPAI74u0Uf5FumSwYnRAVPaOZXIOt49iu0QbJ8+KRX2UIKJ6oW2zGabgofJjHttsLj9CbEbqyR09lz
+        3K7nX/FNVD0shG7QQ/ndJyXiV7G+OZDRZBtBbXWFAU4+SK7+Ma28KZFsAmqDZOTx619ltlggIzzn6WQl
+        Bp+kxNpNX2+ACjQVg4UcqN+RK89pdqafRc3x2XWxT7z+PwujG+jE+4yEI8kmh082HLsUbqubNiAr+kiq
+        RlIdb8ZAlbMtoLG9cCOZmVyq3zX4lrpX+ccXJ/SsjGoKTjJKwrwzKqG7q0RxsOp2I30EJ15FGIVfeZWQ
+        2MqeN0g1ufwZhIymfgZyOUtWiFU9aQLY0z3dxPLnRCbkajRwONOnfifEO8uNtPUpHsnwxOFEjPQOShRs
+        /ARKVGx1V52CpOGrJw4bxAbBumLrudiogA09oyP/CNjCL4ju04lvfjV3UKLO+MS55MtrzrnkYtQYCs7K
+        ch/2iGPr8Np2Ry0s/CMsoi7sAouoC7vAF1H9HbFkyX8ni6hLdiEQdWHhf8ci6sIusIi6sAssoi7sAouo
+        CzvA4fAHgW7crI7nKn8AAAAASUVORK5CYII=
+</value>
+  </data>
   <data name="pictureBox1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAKoAAAAfCAYAAAB3cVZEAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -153,13 +185,4 @@
   <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
-  <data name="Gview_gz.MergeColumnNames" mimetype="application/x-microsoft.net.object.binary.base64">
-    <value>
-        AAEAAAD/////AQAAAAAAAAAMAgAAAJoBbXNjb3JsaWIsIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1u
-        ZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5XV0sIG1zY29ybGliLCBWZXJzaW9u
-        PTQuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OQUB
-        AAAAMFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljLkxpc3RgMVtbU3lzdGVtLlN0cmluZwMAAAAGX2l0
-        ZW1zBV9zaXplCF92ZXJzaW9uBgAACAgCAAAACQMAAAAAAAAAAAAAABEDAAAAAAAAAAs=
-</value>
-  </data>
 </root>

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

@@ -76,7 +76,7 @@ namespace OTSIncAReportGrids
         //测量结果
         ResultFile result = null;
 
-
+        frmReportConditionChoose m_condition;
         FieldData fieldData;
 		DataTable particlesAll;
         ParticleData Particledata;
@@ -161,7 +161,26 @@ namespace OTSIncAReportGrids
         public ParticlesGridDevidePage(frmReportApp ReportApp)
         {
             m_ReportApp = ReportApp;
-            result = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()];
+            m_condition = ReportApp.m_conditionChoose;
+            
+            string sou=m_condition.m_CurrentConditions[OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+            if (sou.Contains("+"))
+            {
+                result=m_ReportApp.m_rstDataMgr.ResultFilesList[0];
+            }else
+            {
+                for(int i=0;i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count;i++)
+                {
+                    if (sou== m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName.ToString())
+                    {
+                        result = m_ReportApp.m_rstDataMgr.ResultFilesList[i];
+                    }
+
+                }
+            }
+            //result = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()];
+
+
             //设置窗体的双缓冲,以保证大数据时拖动不卡
             this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
             this.UpdateStyles();
@@ -175,7 +194,7 @@ namespace OTSIncAReportGrids
 
             lan = new Language(this);
             table = lan.GetNameTable(this.Name);
-
+            
             m_mythread_state = false;
             m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
             //m_frm_userprogress = new Frm_UserProgress();

+ 10 - 3
OTSIncAReportApp/1-UI/Control_Grids/ParticlesSizeGrid.cs

@@ -75,9 +75,11 @@ namespace OTSIncAReportGrids
             for (int i = 0; i < colid.Count; i++)
             {
                 gridView.Columns.Add(colid[i], colname[i]);
-                m_dt.Columns.Add(colid[i]);
+                if (!m_dt.Columns.Contains(colid[i]))
+                    m_dt.Columns.Add(colid[i]);
             }
-            m_dt.Columns.Add("Class");
+            if (!m_dt.Columns.Contains("Class"))
+                m_dt.Columns.Add("Class");
             //设置grid默认值的样式,防止图像为空时有红x
             for (int i = 0; i < gridView.Columns.Count; i++)
             {
@@ -353,7 +355,12 @@ namespace OTSIncAReportGrids
             }
             else
             {
-                BindDataGridView(m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
+                for (int i=0;i< m_ReportApp.m_rstDataMgr.ResultFilesList.Count;i++)
+                {
+                    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[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath, 0, m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FileName);
             }
         }
         #endregion

+ 13 - 6
OTSIncAReportApp/1-UI/Control_Grids/ResultGrid.cs

@@ -19,6 +19,7 @@ namespace OTSIncAReportGrids
         //国际化
         Language lan;
         public Hashtable table;
+        frmReportConditionChoose m_condition;
         #endregion
 
         #region 窗体加载及构造函数
@@ -26,7 +27,7 @@ namespace OTSIncAReportGrids
         public ResultGrid(frmReportApp frmReportApp)
         {
             m_frmReportApp = frmReportApp;
-
+            m_condition = frmReportApp.m_conditionChoose;
             InitializeComponent();
             //国际化
             lan = new Language(this);
@@ -69,7 +70,8 @@ namespace OTSIncAReportGrids
 
             //int idx = m_frmReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_frmReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
             //string sou = m_frmReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString();
-          string sou=  m_frmReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
+            string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+            //string sou=  m_frmReportApp.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++)
@@ -83,9 +85,14 @@ namespace OTSIncAReportGrids
             }
             else
             {
+                for (int i=0;i< m_frmReportApp.m_rstDataMgr.ResultFilesList.Count;i++)
+                {
+                    if(sou== m_frmReportApp.m_rstDataMgr.ResultFilesList[i].FileName.ToString())
+                        addGrid(m_frmReportApp.m_rstDataMgr.ResultFilesList[i]);
+                }
                 //int item= (int)m_frmReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItem(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
                 //m_frmReportApp.m_rstDataMgr.SetWorkingResult(item);
-                addGrid(m_frmReportApp.m_rstDataMgr.ResultFilesList[m_frmReportApp.m_rstDataMgr.GetWorkingResult()]);
+                //addGrid(m_frmReportApp.m_rstDataMgr.ResultFilesList[m_frmReportApp.m_rstDataMgr.GetWorkingResult()]);
             }
         }
 
@@ -93,9 +100,9 @@ namespace OTSIncAReportGrids
         /// 获取测量结果概况信息数据
         /// </summary>
         /// <returns></returns>
-        public Dictionary<string, string> GetData_ResultGrid()
+        public Dictionary<string, string> GetData_ResultGrid(ResultFile resultFile)
         {
-            ResultFile resfile = m_frmReportApp.m_rstDataMgr.ResultFilesList[m_frmReportApp.m_rstDataMgr.GetWorkingResult()];
+            ResultFile resfile = resultFile;
            
             Dictionary<string, string> keyValues = new Dictionary<string, string>() { };
             keyValues.Add(table["col1"].ToString(), resfile.FileName);
@@ -253,7 +260,7 @@ namespace OTSIncAReportGrids
         /// <param name="resultFile"></param>
         private void addGrid(OTSIncAReportApp.DataOperation.Model.ResultFile resultFile)
         {
-            Dictionary<string, string> keyValues = GetData_ResultGrid();
+            Dictionary<string, string> keyValues = GetData_ResultGrid(resultFile);
             Dictionary<string, string>.Enumerator en = keyValues.GetEnumerator();
 
             for (int irow = 0; irow < keyValues.Count; irow++)

+ 35 - 9
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -21,6 +21,7 @@ namespace OTSIncAReportApp
     
         public frmReportApp m_ReportApp = null;
         public ResultDataMgr m_rstDataMgr;
+      
         /// <summary>
         /// 属性Grid对象,全局变量
         /// </summary>
@@ -52,7 +53,7 @@ namespace OTSIncAReportApp
             m_ReportApp = ReportApp;
 
             m_ConditionGrid = new OTSSourceGrid(this);
-
+            
             m_rstDataMgr = ReportApp.m_rstDataMgr;
             #region 国际化语言
             Language lan = new Language(this);
@@ -244,8 +245,28 @@ namespace OTSIncAReportApp
                 case DisplayPicutureType.AnalyzeImg:
                     
                     data.TabIndex = DisplayPicutureType.AnalyzeImg;
-
+                    m_rstDataMgr.ResultFilesList.Count();
+                    
                     data.ConditionItemList = GetSourceGridData(DisplayPicutureType.AnalyzeImg);
+
+                    for (int i = 0; i < data.ConditionItemList.Count; i++)
+                    {
+                        if (data.ConditionItemList[i].iItemId == OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE)
+                        {
+                            if (data.ConditionItemList[i].itemDisplayVal.ToString().Contains("+"))
+                            {
+                                data.ConditionItemList[i].itemDisplayVal = data.ConditionItemList[i].comboDownList[0].ToString();
+                                data.ConditionItemList[i].itemVal = 0;
+                                m_rstDataMgr.SetWorkingResult((int)data.ConditionItemList[i].itemVal);
+                            }
+                            else
+                            {
+                                m_rstDataMgr.SetWorkingResult((int)data.ConditionItemList[i].itemVal);
+                            }
+                            
+                        }
+                    }
+
                     break;
                 case DisplayPicutureType.AnalyzeDataTable:
                    
@@ -291,7 +312,8 @@ namespace OTSIncAReportApp
       
                 sampleData = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE];
                 list.Add(sampleData);
-                m_ReportApp.m_rstDataMgr.SetWorkingResult((int)sampleData.itemVal);
+
+                //m_ReportApp.m_rstDataMgr.SetWorkingResult((int)sampleData.itemVal);
                 //测量图类别 分布图 or 排列图
 
                 sampleData = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.IMAGE_DISPLAY_TYPE];
@@ -387,7 +409,7 @@ namespace OTSIncAReportApp
 
                 sampleData = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE];
                 list.Add(sampleData);
-                m_ReportApp.m_rstDataMgr.SetWorkingResult((int)sampleData.itemVal);
+                //m_ReportApp.m_rstDataMgr.SetWorkingResult((int)sampleData.itemVal);
 
                 //数据表类型
                 var sampleData3 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE];
@@ -441,7 +463,7 @@ namespace OTSIncAReportApp
 
                 sampleData = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE];
                 list.Add(sampleData);
-                m_ReportApp.m_rstDataMgr.SetWorkingResult((int)sampleData.itemVal);
+                //m_ReportApp.m_rstDataMgr.SetWorkingResult((int)sampleData.itemVal);
                 var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
                 list.Add(sampleData1);
 
@@ -500,15 +522,19 @@ namespace OTSIncAReportApp
         /// <param name="strTableTypeName">属性中选择的图表名称</param>
         public void ShowDataDiagram(DisplayPicutureType tabindex)
         {
+            int sourceid = 0;
+            sourceid =(int) m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemVal;
+            //sourceid = m_rstDataMgr.GetWorkingResult();
 
-            int sourceid = m_rstDataMgr.GetWorkingResult();
 
-            var resultFile = m_rstDataMgr.ResultFilesList[sourceid];
 
-            var prop = m_SourceGridData;
 
-            String m_fileName = resultFile.FileName;
+            //var resultFile = m_rstDataMgr.ResultFilesList[sourceid];
+
+            var prop = m_SourceGridData;
 
+            //String m_fileName = resultFile.FileName;
+            String m_fileName=m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
 
 
             #region 对各窗体模块进行实际加载的代码

+ 5 - 0
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -1422,6 +1422,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 //加载模块
                 ElementCompositionAvgGrid ls_elementcompositionavggrid = new ElementCompositionAvgGrid(m_otsreport_export.m_ReportApp);
+                ls_elementcompositionavggrid.Report = true;
                 m_otsreport_export.panel_container.Controls.Clear();
                 m_otsreport_export.panel_container.Controls.Add(ls_elementcompositionavggrid);
 
@@ -2118,6 +2119,8 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_otsreport_export.m_ReportApp.m_reportname = "";
             m_otsreport_export.m_ReportApp.type = a_GraphicStyle;
             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;
             m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition);
 
             //弹出加载图片窗体
@@ -2159,6 +2162,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_otsreport_export.m_ReportApp.m_reportname = "";
             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;
             m_otsreport_export.m_ReportApp.m_ChartsWindow.Controls.Add(m_otsreport_export.m_ReportApp.im_EChart_ParticlesComposition);
 
             //弹出加载图片窗体
@@ -2387,6 +2391,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             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);
 
             //ls_echart_trianglediagram.

+ 11 - 10
OTSIncAReportApp/1-UI/frmMeasureRstMgr.Designer.cs

@@ -50,13 +50,13 @@
             this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.AddSample});
             this.contextMenuStrip2.Name = "contextMenuStrip2";
-            this.contextMenuStrip2.Size = new System.Drawing.Size(233, 36);
+            this.contextMenuStrip2.Size = new System.Drawing.Size(181, 34);
             // 
             // AddSample
             // 
             this.AddSample.Image = global::OTSIncAReportApp.Properties.Resources.open32;
             this.AddSample.Name = "AddSample";
-            this.AddSample.Size = new System.Drawing.Size(232, 32);
+            this.AddSample.Size = new System.Drawing.Size(180, 30);
             this.AddSample.Text = "增加样品测量结果";
             // 
             // treeView1
@@ -68,12 +68,11 @@
             this.treeView1.CheckBoxes = true;
             this.treeView1.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawAll;
             this.treeView1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.treeView1.Location = new System.Drawing.Point(0, 38);
-            this.treeView1.Margin = new System.Windows.Forms.Padding(4);
+            this.treeView1.Location = new System.Drawing.Point(0, 25);
             this.treeView1.Name = "treeView1";
             this.treeView1.ShowLines = false;
             this.treeView1.ShowPlusMinus = false;
-            this.treeView1.Size = new System.Drawing.Size(608, 1014);
+            this.treeView1.Size = new System.Drawing.Size(407, 677);
             this.treeView1.TabIndex = 6;
             this.treeView1.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterCheck);
             this.treeView1.DrawNode += new System.Windows.Forms.DrawTreeNodeEventHandler(this.treeView1_DrawNode);
@@ -82,19 +81,21 @@
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(2, 2);
+            this.button1.Location = new System.Drawing.Point(1, 1);
+            this.button1.Margin = new System.Windows.Forms.Padding(2);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(132, 38);
+            this.button1.Size = new System.Drawing.Size(88, 25);
             this.button1.TabIndex = 7;
             this.button1.Text = "多选数据源+";
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Visible = false;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
             // 
             // frmMeasureRstMgr
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(608, 1050);
+            this.ClientSize = new System.Drawing.Size(405, 700);
             this.CloseButton = false;
             this.CloseButtonVisible = false;
             this.Controls.Add(this.button1);
@@ -104,7 +105,7 @@
             | OTS.WinFormsUI.Docking.DockAreas.DockBottom)));
             this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(6);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "frmMeasureRstMgr";
             this.RightToLeftLayout = true;
             this.Text = "测量结果窗口";

+ 67 - 2
OTSIncAReportApp/1-UI/frmMeasureRstMgr.cs

@@ -256,7 +256,7 @@ namespace OTSIncAReportApp
 
             //插入多数据源选项
             m_ReportApp.MoreSource = checkednode;
-  
+            m_ConditionChoose.SetDefaultConditionValue();
             m_ConditionChoose.DisCurrentPicProperty();//刷新
 
 
@@ -479,7 +479,70 @@ namespace OTSIncAReportApp
         #region 多数据源操作部份相关
         private void button1_Click(object sender, EventArgs e)
         {
+            frmMultiSourceSelect frm_Mss = new frmMultiSourceSelect(this.treeView1);
+            if (frm_Mss.ShowDialog() == DialogResult.OK)
+            {
+                //判断是否选择了两个以上的选项,
+                int iselectcount = 0;
+
+                //第一次更新各选项值
+                for (int i = 0; i < frm_Mss.treeView1.Nodes.Count; i++)
+                {
+                    this.treeView1.Nodes[i].Checked = frm_Mss.treeView1.Nodes[i].Checked;
+                    if (frm_Mss.treeView1.Nodes[i].Checked == true)
+                    {
+                        iselectcount++;
+                    }
+
+                    //更新底层及属性窗口
+                    //m_ReportApp.m_DataMgrFun.m_ReportProjFileMgr.SetSwitchForSmlResultFile(i, frm_Mss.treeView1.Nodes[i].Checked);
+
+                    //获取属性窗口底层值
+                    //m_ReportApp.m_DataMgrFun.GetPropertyData();
+                    //OTSSampleMeaInfo SMInfo = m_ReportApp.m_DataMgrFun.AddNewMeaResult(i);
+
+                    //将treeview的选择值,传送给属性grid上。
+                    //m_ReportApp.m_PropWindow.DisProperyWindow(SMInfo);
+
+                }
+
+                //主动去更新让其选择上多数据源或非多数据源
+                if (iselectcount >= 2)
+                {
+                    //获取
+                    //OTSSampleMeaInfo SMInfo = new OTSSampleMeaInfo();
+                    //DataMgrFun dataMgr = m_ReportApp.m_DataMgrFun;
+                    //dataMgr.SetSampleParamVal(OTS_RETORT_PROP_GRID_ITEMS.DATA_SOURCE, OTS_ITEM_TYPES.COMBO, 0);
+
+                    //获取属性窗口更新显示
+                    //dataMgr.GetWorkSamplePropertyVal(ref SMInfo);
+                    //m_ReportApp.m_PropWindow.DisProperyWindow(SMInfo);
 
+                    //显示默认的图表
+                    //m_ReportApp.m_PropWindow.m_SampleGrid.ShowDataDiagram();
+                }
+                else
+                {
+                    //单一选项时,也要对该属性窗口进行切换
+                    for (int i = 0; i < frm_Mss.treeView1.Nodes.Count; i++)
+                    {
+                        if (frm_Mss.treeView1.Nodes[i].Checked == true)
+                        {
+                            //OTSSampleMeaInfo SMInfo = new OTSSampleMeaInfo();
+                            //DataMgrFun dataMgr = m_ReportApp.m_DataMgrFun;
+                            //dataMgr.SetSampleParamVal(OTS_RETORT_PROP_GRID_ITEMS.DATA_SOURCE, OTS_ITEM_TYPES.COMBO, i);
+
+                            ////获取属性窗口更新显示
+                            //dataMgr.GetWorkSamplePropertyVal(ref SMInfo);
+                            //m_ReportApp.m_PropWindow.DisProperyWindow(SMInfo);
+
+                            ////显示默认的图表
+                            //m_ReportApp.m_PropWindow.m_SampleGrid.ShowDataDiagram();
+                        }
+                    }
+                }
+
+            }
         }
 
         /// <summary>
@@ -524,6 +587,8 @@ namespace OTSIncAReportApp
             //}
         }
 
+      
+
         #endregion
 
         //读取rst文件中的帧图位置信息
@@ -558,7 +623,7 @@ namespace OTSIncAReportApp
         //                        dr["FieldY"] = xml.ChildNodes[i].Attributes.GetNamedItem("FieldY").Value;
         //                        dr["ID"] = xml.ChildNodes[i].Attributes.GetNamedItem("ID").Value;
         //                        dt.Rows.Add(dr);
-                            
+
         //                }
         //            }
         //        }