Browse Source

修改报告元素为空卡顿的bug

cxs 1 year ago
parent
commit
737f98f312

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

@@ -734,6 +734,11 @@ namespace OTSIncAReportGrids
             List<string> ElementTypeSort = new List<string>(str_ElementsColName.Split(',').ToList());//去重
             for (int i = 0; i < ElementTypeSort.Count; i++)
             {
+                if(ElementTypeSort[0]=="")
+                {
+                    ElementTypeSort.RemoveAt(0);
+                    break;
+                }
                 dgV_ParticlesDevidePage.Columns.Add(ElementTypeSort[i], ElementTypeSort[i]);
                 int id = dgV_ParticlesDevidePage.Columns.Count;
                 dgV_ParticlesDevidePage.Columns[id - 1].Tag = "NumericType";
@@ -834,6 +839,10 @@ namespace OTSIncAReportGrids
                                 string[] strcbo = particles.Rows[i][enl.Current.Key].ToString().Split(';');
                                 for (int j = 0; j < strcbo.Length; j++)
                                 {
+                                    if(ElementTypeSort.Count==0)
+                                    {
+                                        break;
+                                    }
                                     string[] str = strcbo[j].Split('-');
                                     if (ElementTypeSort.Contains(str[0]))
                                     { dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[str[0].ToString()].Value = Math.Round(double.Parse(str[1]), 2).ToString(); }

+ 2 - 1
OTSIncAReportApp/2-CommonFunction/CommonClass/DisplayRectangle.cs

@@ -65,7 +65,7 @@ namespace OTSIncAReportGraph
             double left = OTSCoordinatePos.X - fldwidth * pixelSize / 2;
             double right = OTSCoordinatePos.X + fldwidth * pixelSize / 2;
             double top = OTSCoordinatePos.Y + fldheight * pixelSize / 2;
-            double bottom = OTSCoordinatePos.Y + fldheight * pixelSize / 2;
+            double bottom = OTSCoordinatePos.Y - fldheight * pixelSize / 2;
             myOTSRect.SetRectData( (float)left,(float)top,(float)right,(float)bottom);
 
             //先获取该Field中的所有Particle
@@ -84,6 +84,7 @@ namespace OTSIncAReportGraph
                 {
                     continue;
                 }
+
                 //创建DParticle颗粒
                 DisplayParticle dp = new DisplayParticle(particle, ltPoint, m_originalImage,dpImage);
                 double partLeft=dp.objParticleData.RectLeft*pixelSize+myOTSRect.GetTopLeft().X;