Browse Source

添加排列图全图匹配

cxs 1 month ago
parent
commit
b2781d69fe

+ 67 - 4
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -659,7 +659,7 @@ namespace OTSIncAReportGraph.Controls
                                 item.DraggingMove(e.Location);
                                 item.IsSelect = false;
                                 item.IsDragging = false;
-                                item.DraggingPoint = Point.Empty;
+                                //item.DraggingPoint = Point.Empty;
                                 PointF ct = item.GetCenterPoint();
                                 if (ct.X < -100 || ct.X > this.Width + 100 || ct.Y < -100 || ct.Y > this.Height + 100)
                                 {
@@ -1290,9 +1290,10 @@ namespace OTSIncAReportGraph.Controls
             {
                 ls_spd.SortDParticle();
             }
-
-           
-
+            if(m_list_sortparticledistribution.Count>0)
+            {
+             m_beforedrag_pointf = m_list_sortparticledistribution[0].RectF.Location;
+            }
         }
        
 
@@ -1614,5 +1615,67 @@ namespace OTSIncAReportGraph.Controls
                 p.WaitForExit();
             }
         }
+
+
+        /// <summary>
+        /// 对分布图进行全图匹配操作
+        /// </summary>
+        public void FullGraphMatch()
+        {
+            //全图匹配,首先要判断出来是按宽度来计算缩放,还是按高度来计算缩放
+            double thiswidth = this.Width;
+            double thisheight = this.Height;
+            if(m_list_sortparticledistribution.Count==0)
+            {
+                return;
+            }
+            RectangleF rectangle = m_list_sortparticledistribution[0].RectF;
+            double imagewidth = rectangle.Width;
+            double zoom_FullGraph = 0;
+            if (thiswidth == imagewidth)
+            {
+                return;
+            }
+
+            zoom_FullGraph = Math.Abs(thiswidth / imagewidth);
+            ImageZoom((float)1, new PointF(0, 0));
+            PointF point11 = new PointF(ClientRectangle.X + ClientRectangle.Width * 1f / 50, ClientRectangle.Y);
+            MoveImageToPoint(point11);
+            m_f_zoom_mix = m_zoom_record;
+        }
+
+
+
+
+
+
+
+
+
+
+        private void MoveImageToPoint(PointF in_pointf)
+        {
+            if (m_list_sortparticledistribution.Count == 0)
+            {
+                return;
+            }
+            RectangleF rectangle = m_list_sortparticledistribution[0].RectF;
+            float Py = rectangle.Location.Y;
+            foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
+            {
+                ls_sortparticledistribution.RectF = new RectangleF(in_pointf.X,
+                         ls_sortparticledistribution.RectF.Location.Y + in_pointf.Y- Py, ls_sortparticledistribution.RectF.Width, ls_sortparticledistribution.RectF.Height);
+            }
+            m_beforedrag_pointf = in_pointf;
+            foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
+            {
+                foreach (DisplayParticle item in ls_sortparticledistribution.List_DParticle)
+                {
+                    item.DraggingPoint= rectangle.Location;
+                    item.DraggingMove(in_pointf);
+                }
+            }
+            Invalidate();
+        }
     }
 }

+ 2 - 0
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -503,6 +503,8 @@ namespace OTSIncAReportApp
                         if (im_Control_DrawDistrbutionSortImage != null)
                         {
                             //排列图
+                            im_Control_DrawDistrbutionSortImage.FullGraphMatch();
+                            im_Control_DrawDistrbutionSortImage.Invalidate();
                         }
                     }
                     break;