Browse Source

添加 颗粒列表点选后分布图居中显示功能

cxs 1 year ago
parent
commit
2574fdfaf9

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

@@ -2628,7 +2628,7 @@ namespace OTSIncAReportGraph.Controls
 
         public void DisplayParticleByParticlelist(List<Particle> particle)
         {
-
+            bool flag = true;
             foreach (var p in m_list_allDPart)
             {
                 var dp = p;
@@ -2638,7 +2638,24 @@ namespace OTSIncAReportGraph.Controls
                     {
                         if (dp.objParticleData.ParticleId == p2.ParticleId)
                         {
+                            if (flag)
+                            {
+                                var p1= dp.GetCenterPoint();
+                                foreach (DisplayParticle dp1 in m_list_allDPart)
+                                {
 
+                                    dp1.DraggingPoint = p1;
+                                    dp1.DraggingMove(new PointF(this.Width / 2, this.Height / 2));
+                                    dp1.DraggingPoint = Point.Empty;
+                                }
+                                m_beforedrag_pointf = p1;
+                                //同样重新计算backrectf的坐标
+                                m_backRect = new RectangleF(m_backRect.Location.X + this.Width / 2 - m_beforedrag_pointf.X,
+                                     m_backRect.Location.Y + this.Height / 2 - m_beforedrag_pointf.Y, m_backRect.Width, m_backRect.Height);
+
+                                ImageZoom(5, new PointF(dp.GetCenterPoint().X, dp.GetCenterPoint().Y));
+                                flag = false;
+                            }
                             dp.IsSelect = true;
                             break;
                         }

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

@@ -2576,10 +2576,10 @@ namespace OTSIncAReportGrids
 
                 }
             }
-            if(m_ReportApp.im_Control_DrawDistrbutionImageAndBSE!=null)
-            {
-                m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DisplayParticleByParticlelist(Particleslist_selecttodisplay);
-            }
+            //if(m_ReportApp.im_Control_DrawDistrbutionImageAndBSE!=null)
+            //{
+            //    m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DisplayParticleByParticlelist(Particleslist_selecttodisplay);
+            //}
         }
 
         public List<Particle> GetParticleslist_select()