Forráskód Böngészése

更新优化三元图的加载速度

zhangjiaxin 2 éve
szülő
commit
175b587321

+ 4 - 1
OTSIncAReportApp/1-UI/Control_ECharts/EChart_Trianglediagram.cs

@@ -341,7 +341,10 @@ namespace OTSIncAReportApp.Control_ECharts
                     break;
             }
 
-            DataTable dtp = particledata.GetParticleHaveXray(filedAndParticl);
+            //particledata.GetParticleAllHaveXray("");
+
+            //DataTable dtp = particledata.GetParticleHaveXray(filedAndParticl);//旧
+            DataTable dtp = particledata.GetParticleAllHaveXray(filedAndParticl);//新
             //创建一个临时表
             DataTable ret_dt = new DataTable();
             //然后额外存放三列,用于存放拆分后三个顶点的值

+ 3 - 1
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -1999,7 +1999,9 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     break;
             }
 
-            DataTable dtp = particledata.GetParticleHaveXray(filedAndParticl);
+            DataTable dtp = particledata.GetParticleAllHaveXray(filedAndParticl);
+            //DataTable dtp = particledata.GetParticleHaveXray(filedAndParticl);
+
             //创建一个临时表
             DataTable ret_dt = new DataTable();
             //然后额外存放三列,用于存放拆分后三个顶点的值

+ 51 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -201,6 +201,50 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             return DT;
         }
 
+
+        /// <summary>
+        /// 获取所有Particle
+        /// </summary>
+        /// <returns></returns>
+        public DataTable GetParticleAllHaveXray(string fieldAndPartic)
+        {
+            string incaSql = @"select * from IncAData";
+          
+            if (fieldAndPartic != "")
+            {
+                incaSql = incaSql + " where '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+            }
+            DataTable incaDT = dbHelper.ExecuteDataTable(incaSql, null);
+
+            
+
+            incaDT.Columns.Add("Element");
+
+            DataTable dt_element = GetElementChemistry();
+            DataTable elementchemistry = dt_element.Clone();
+            for (int i = 0; i < dt_element.Rows.Count; i++)
+            {
+                if (dt_element.Rows[i]["Name"].ToString() != "Fe")
+                {
+                    elementchemistry.Rows.Add(dt_element.Rows[i].ItemArray);
+                }
+            }
+            for (int i = 0; i < incaDT.Rows.Count; i++)
+            {
+                string str = "XRayId = " + incaDT.Rows[i]["particleId"].ToString() + " and fieldid = " + incaDT.Rows[i]["fieldid"].ToString();
+                DataRow[] drs = elementchemistry.Select(str);
+                string ConcatenatedString = "";
+                for (int j = 0; j < drs.Length; j++)
+                {
+                    ConcatenatedString += drs[j]["name"] + "-" + ChangeDataToD(drs[j]["Percentage"].ToString()) + ';';
+                }
+                incaDT.Rows[i]["Element"] = ConcatenatedString;
+            }
+            return incaDT;
+        }
+
+
+
         /// <summary>
         /// 获取所有Particle
         /// </summary>
@@ -496,7 +540,13 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         }
         public DataTable GetInfoForPartucleDevidePage2(string condition)
         {
-            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,FieldPosX as 'SEMPosX',FieldPosY as 'SEMPosY',XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles, (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,'' as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + condition;
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,FieldPosX " +
+                "as 'SEMPosX',FieldPosY as 'SEMPosY',XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles," +
+                " (select group_concat(name || '-' || Percentage, ';') from ElementChemistry where XRayId = MergedParticleInfo.XRayId and fieldid = MergedParticleInfo.fieldid) " +
+                "as Element from MergedParticleInfo where 1=1 " + condition + " union select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId," +
+                "SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as SubParticles,'' " +
+                "as Element from INcAData where xrayid > -1 and instr(','||(select ifnull(group_concat(SubParticles, ','),'') from MergedParticleInfo)|| ',',',' || fieldid || ':' || particleid || ',')= 0 " + 
+                condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;

+ 1 - 1
OTSIncAReportApp/ReportTemplate/OTS_DEVReport.Designer.cs

@@ -383,7 +383,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             // xrTableCell6
             // 
             this.xrTableCell6.BackColor = System.Drawing.Color.DarkGray;
-            this.xrTableCell6.Borders = DevExpress.XtraPrinting.BorderSide.None;
+            this.xrTableCell6.Borders = ((DevExpress.XtraPrinting.BorderSide)((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)));
             this.xrTableCell6.BorderWidth = 1F;
             this.xrTableCell6.Font = new System.Drawing.Font("Arial", 9.75F);
             this.xrTableCell6.Multiline = true;

+ 32 - 15
OTSIncAReportApp/ReportTemplate/OTS_DEVReport.cs

@@ -711,9 +711,10 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
                                 xRTable.Rows[3].Cells[c].Text = listData[a].Rows[b]["ColVal" + (c + 1).ToString()].ToString();
                             }
 
-                            xRTable.LocationF = new PointF(0, NeueStartposition + 5);
+                            xRTable.LocationF = new PointF(0, NeueStartposition );
                             this.Detail.Controls.Add(xRTable);
-                            NeueStartposition = NeueStartposition + xRTable.SizeF.Height + 5 + 2;
+                            NeueStartposition = NeueStartposition + xRTable.SizeF.Height +1 ;
+                            //NeueStartposition = NeueStartposition + xRTable.SizeF.Height + 5 + 2;
                         }
                     }
                 }
@@ -973,13 +974,18 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             XRTableCell Template_Rows5_Cell_1 = new XRTableCell();
 
             Template.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
+            //Template_Rows1_Cell_1.WidthF = 115.67f;
+            //Template_Rows1_Cell_2.WidthF = 53f;
+            //Template_Rows1_Cell_3.WidthF = 211.79f;
+            //Template_Rows1_Cell_4.WidthF = 102.51f;
+            //Template_Rows1_Cell_5.WidthF = 102.51f;
+            //Template_Rows1_Cell_6.WidthF = 102.51f;
             Template_Rows1_Cell_1.WidthF = 115.67f;
-            Template_Rows1_Cell_2.WidthF = 53f;
-            Template_Rows1_Cell_3.WidthF = 211.79f;
-            Template_Rows1_Cell_4.WidthF = 102.51f;
-            Template_Rows1_Cell_5.WidthF = 102.51f;
-            Template_Rows1_Cell_6.WidthF = 102.51f;
-
+            Template_Rows1_Cell_2.WidthF = 57.22f;
+            Template_Rows1_Cell_3.WidthF = 256f;
+            Template_Rows1_Cell_4.WidthF = 85.85f;
+            Template_Rows1_Cell_5.WidthF = 85.85f;
+            Template_Rows1_Cell_6.WidthF = 85.85f;
 
 
             Template_Rows_1.Controls.Add(Template_Rows1_Cell_1);
@@ -989,12 +995,19 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             Template_Rows_1.Controls.Add(Template_Rows1_Cell_5);
             Template_Rows_1.Controls.Add(Template_Rows1_Cell_6);
 
+            //Template_Rows2_Cell_1.WidthF = 115.67f;
+            //Template_Rows2_Cell_2.WidthF = 53f;
+            //Template_Rows2_Cell_3.WidthF = 211.79f;
+            //Template_Rows2_Cell_4.WidthF = 102.51f;
+            //Template_Rows2_Cell_5.WidthF = 102.51f;
+            //Template_Rows2_Cell_6.WidthF = 102.51f;
+
             Template_Rows2_Cell_1.WidthF = 115.67f;
-            Template_Rows2_Cell_2.WidthF = 53f;
-            Template_Rows2_Cell_3.WidthF = 211.79f;
-            Template_Rows2_Cell_4.WidthF = 102.51f;
-            Template_Rows2_Cell_5.WidthF = 102.51f;
-            Template_Rows2_Cell_6.WidthF = 102.51f;
+            Template_Rows2_Cell_2.WidthF = 57.22f;
+            Template_Rows2_Cell_3.WidthF = 256f;
+            Template_Rows2_Cell_4.WidthF = 85.85f;
+            Template_Rows2_Cell_5.WidthF = 85.85f;
+            Template_Rows2_Cell_6.WidthF = 85.85f;
 
 
             Template_Rows_2.Controls.Add(Template_Rows2_Cell_1);
@@ -1075,7 +1088,7 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             Template.Rows[2].Cells[0].BackColor = Color.Transparent;
             Template.Rows[2].BackColor = Color.DarkGray;
 
-
+            
 
 
             Template.Borders = DevExpress.XtraPrinting.BorderSide.All;
@@ -1084,6 +1097,9 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             Template.Rows[2].Cells[0].Borders = DevExpress.XtraPrinting.BorderSide.Left;
             Template.Rows[3].Cells[0].Borders = DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Bottom;
 
+
+            //Template.Rows[0].Cells[1].Borders= DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right;
+
             return Template;
         }
         private void add_kllb(c_TemplateClass TemplateClass, DataTable dataTable, int position, XRTable xRTable)
@@ -1150,7 +1166,8 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             xRPicture_pic.BringToFront();
             this.Detail.Controls.Add(xRPicture_pic);
 
-            NeueStartposition = table.SizeF.Height + NeueStartposition+5;
+            //NeueStartposition = table.SizeF.Height + NeueStartposition+5;
+            NeueStartposition = table.SizeF.Height + NeueStartposition;
         }
         #endregion
         #region 颗粒列表帧图