Browse Source

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

gsp 1 year ago
parent
commit
fd4c2890ac

+ 65 - 54
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -114,7 +114,6 @@ namespace OTSIncAReportGraph.Controls
         //国际化存储信息
         //国际化存储信息
         Hashtable resourceTable;
         Hashtable resourceTable;
         ResultFile resultFile = null;
         ResultFile resultFile = null;
-
         #region 缩放
         #region 缩放
         //缩放的增大缩小的增量
         //缩放的增大缩小的增量
         private const float const_zoom_increment = 0.1f;
         private const float const_zoom_increment = 0.1f;
@@ -205,10 +204,6 @@ namespace OTSIncAReportGraph.Controls
             //向父窗体注册键盘按键事件
             //向父窗体注册键盘按键事件
             this.Parent.KeyDown += new KeyEventHandler(Control_DrawDistrbutionSortImage_KeyDown);
             this.Parent.KeyDown += new KeyEventHandler(Control_DrawDistrbutionSortImage_KeyDown);
             this.Parent.KeyUp += new KeyEventHandler(Control_DrawDistrbutionSortImage_KeyUp);
             this.Parent.KeyUp += new KeyEventHandler(Control_DrawDistrbutionSortImage_KeyUp);
-     
-      
-
-
 
 
             //设置双缓冲
             //设置双缓冲
             SetDoubleBufferByIsDraw();
             SetDoubleBufferByIsDraw();
@@ -558,13 +553,15 @@ namespace OTSIncAReportGraph.Controls
                 else 
                 else 
                 {
                 {
                     this.Cursor = Cursors.Hand;
                     this.Cursor = Cursors.Hand;
-
                     foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                     foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                     {
                     {
                         foreach (DisplayParticle ls_dp in ls_sortparticledistribution.List_DParticle)
                         foreach (DisplayParticle ls_dp in ls_sortparticledistribution.List_DParticle)
                         {
                         {
-
-                            ls_dp.IsDragging = true;
+                            PointF ct = ls_dp.GetCenterPoint();
+                            if (ct.X > -100 && ct.X < this.Width + 100 && ct.Y > -100 && ct.Y < this.Height + 100)
+                            {
+                                ls_dp.IsDragging = true;
+                            }
                             ls_dp.DraggingPoint = e.Location;
                             ls_dp.DraggingPoint = e.Location;
                         }
                         }
                     }
                     }
@@ -637,17 +634,34 @@ namespace OTSIncAReportGraph.Controls
                 }
                 }
                 else //is draging
                 else //is draging
                 {
                 {
-                    foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
+                    if (m_isDrag)
                     {
                     {
-                        foreach (DisplayParticle item in ls_sortparticledistribution.List_DParticle)
+                        foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                         {
                         {
-                            if (true == item.IsDragging)
+                            foreach (DisplayParticle item in ls_sortparticledistribution.List_DParticle)
                             {
                             {
+                                item.DraggingMove(e.Location);
                                 item.IsSelect = false;
                                 item.IsSelect = false;
                                 item.IsDragging = 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)
+                                {
+                                    item.SetPaintState(PaintState.NOPAINT);//the particles which are out of screen don't display.to speed up the display efficient.
+
+                                }
+                                else
+                                {
+                                    item.SetPaintState(PaintState.PAINT);
+                                }
                             }
                             }
                         }
                         }
+                        foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
+                        {
+                            ls_sortparticledistribution.RectF = new RectangleF(ls_sortparticledistribution.RectF.Location.X + e.X - m_beforedrag_pointf.X,
+                                     ls_sortparticledistribution.RectF.Location.Y + e.Y - m_beforedrag_pointf.Y, ls_sortparticledistribution.RectF.Width, ls_sortparticledistribution.RectF.Height);
+                        }
+                        m_beforedrag_pointf = e.Location;
                     }
                     }
                     m_isDrag = false;
                     m_isDrag = false;
                     //在颗粒上点击,则对该颗粒附加显示x-ray的状态,同时将其它颗粒上显示x-ray的状态全部去掉。
                     //在颗粒上点击,则对该颗粒附加显示x-ray的状态,同时将其它颗粒上显示x-ray的状态全部去掉。
@@ -769,41 +783,41 @@ namespace OTSIncAReportGraph.Controls
 
 
         protected override void OnMouseMove(MouseEventArgs e)
         protected override void OnMouseMove(MouseEventArgs e)
         {
         {
-         
-                if (true == m_SelectTool.IsSelecting)
+
+            if (true == m_SelectTool.IsSelecting)
+            {
+                if (e.Button == MouseButtons.Left)
                 {
                 {
-                    if (e.Button == MouseButtons.Left)
+                    if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)
                     {
                     {
-                        if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)
-                        {
-                            //右下拖动
-                            m_SelectTool.Rect = new RectangleF(m_SelectTool.StartPoint, new SizeF(e.Location.X - m_SelectTool.StartPoint.X, e.Location.Y - m_SelectTool.StartPoint.Y));
-                        }
-                        if (e.Location.X < m_SelectTool.StartPoint.X && e.Location.Y < m_SelectTool.StartPoint.Y)
-                        {
-                            //左上拖动
-                            PointF lspointf = new PointF(e.Location.X, e.Location.Y);
-                            m_SelectTool.Rect = new RectangleF(lspointf, new SizeF(m_SelectTool.StartPoint.X - e.Location.X, m_SelectTool.StartPoint.Y - e.Location.Y));
-                        }
-                        if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y < m_SelectTool.StartPoint.Y)
-                        {
-                            //右上,这种画法,需要将左下,右上两点转换成左上,右下
-                            PointF left_pointf = new PointF(m_SelectTool.StartPoint.X, e.Location.Y);
-                            PointF right_pointf = new PointF(e.Location.X, m_SelectTool.StartPoint.Y);
-                            m_SelectTool.Rect = new RectangleF(left_pointf, new SizeF(right_pointf.X - left_pointf.X, right_pointf.Y - left_pointf.Y));
+                        //右下拖动
+                        m_SelectTool.Rect = new RectangleF(m_SelectTool.StartPoint, new SizeF(e.Location.X - m_SelectTool.StartPoint.X, e.Location.Y - m_SelectTool.StartPoint.Y));
+                    }
+                    if (e.Location.X < m_SelectTool.StartPoint.X && e.Location.Y < m_SelectTool.StartPoint.Y)
+                    {
+                        //左上拖动
+                        PointF lspointf = new PointF(e.Location.X, e.Location.Y);
+                        m_SelectTool.Rect = new RectangleF(lspointf, new SizeF(m_SelectTool.StartPoint.X - e.Location.X, m_SelectTool.StartPoint.Y - e.Location.Y));
+                    }
+                    if (e.Location.X > m_SelectTool.StartPoint.X && e.Location.Y < m_SelectTool.StartPoint.Y)
+                    {
+                        //右上,这种画法,需要将左下,右上两点转换成左上,右下
+                        PointF left_pointf = new PointF(m_SelectTool.StartPoint.X, e.Location.Y);
+                        PointF right_pointf = new PointF(e.Location.X, m_SelectTool.StartPoint.Y);
+                        m_SelectTool.Rect = new RectangleF(left_pointf, new SizeF(right_pointf.X - left_pointf.X, right_pointf.Y - left_pointf.Y));
 
 
-                        }
-                        if (e.Location.X < m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)
-                        {
-                            //左下,这种画法,需要将左下,右上两点转换成左上,右下
-                            PointF left_pointf = new PointF(e.Location.X, m_SelectTool.StartPoint.Y);
-                            PointF right_pointf = new PointF(m_SelectTool.StartPoint.X, e.Location.Y);
-                            m_SelectTool.Rect = new RectangleF(left_pointf, new SizeF(right_pointf.X - left_pointf.X, right_pointf.Y - left_pointf.Y));
-                        }
+                    }
+                    if (e.Location.X < m_SelectTool.StartPoint.X && e.Location.Y > m_SelectTool.StartPoint.Y)
+                    {
+                        //左下,这种画法,需要将左下,右上两点转换成左上,右下
+                        PointF left_pointf = new PointF(e.Location.X, m_SelectTool.StartPoint.Y);
+                        PointF right_pointf = new PointF(m_SelectTool.StartPoint.X, e.Location.Y);
+                        m_SelectTool.Rect = new RectangleF(left_pointf, new SizeF(right_pointf.X - left_pointf.X, right_pointf.Y - left_pointf.Y));
                     }
                     }
                 }
                 }
-                else
-                {
+            }
+            else
+            {
                 foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                 foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                 {
                 {
                     foreach (DisplayParticle dp in ls_sortparticledistribution.List_DParticle)
                     foreach (DisplayParticle dp in ls_sortparticledistribution.List_DParticle)
@@ -836,7 +850,7 @@ namespace OTSIncAReportGraph.Controls
 
 
                         if (true == dp.IsDragging)
                         if (true == dp.IsDragging)
                         {
                         {
-                            dp.DraggingMove(e.Location);
+                            //dp.DraggingMove(e.Location);
 
 
                             if (dp.GetShowRect().Left < ClientRectangle.Width * 1f / 50 || dp.GetShowRect().Right > ClientRectangle.Width * 48f / 50f || dp.GetShowRect().Top < 0 || dp.GetShowRect().Bottom > this.Height)
                             if (dp.GetShowRect().Left < ClientRectangle.Width * 1f / 50 || dp.GetShowRect().Right > ClientRectangle.Width * 48f / 50f || dp.GetShowRect().Top < 0 || dp.GetShowRect().Bottom > this.Height)
                             {
                             {
@@ -852,18 +866,16 @@ namespace OTSIncAReportGraph.Controls
 
 
                 //如果在拖动中
                 //如果在拖动中
                 if (true == m_isDrag)
                 if (true == m_isDrag)
+                {
+                    //同样重新计算backrectf的坐标
+                    foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
                     {
                     {
-                        //同样重新计算backrectf的坐标
-                        foreach (SortParticleDistribution ls_sortparticledistribution in m_list_sortparticledistribution)
-                        {
-                            ls_sortparticledistribution.RectF = new RectangleF(ls_sortparticledistribution.RectF.Location.X + e.X - m_beforedrag_pointf.X,
-                                     ls_sortparticledistribution.RectF.Location.Y + e.Y - m_beforedrag_pointf.Y, ls_sortparticledistribution.RectF.Width, ls_sortparticledistribution.RectF.Height);
-                        }
-                        m_beforedrag_pointf = e.Location;
+                        ls_sortparticledistribution.RectF = new RectangleF(ls_sortparticledistribution.RectF.Location.X + e.X - m_beforedrag_pointf.X,
+                                 ls_sortparticledistribution.RectF.Location.Y + e.Y - m_beforedrag_pointf.Y, ls_sortparticledistribution.RectF.Width, ls_sortparticledistribution.RectF.Height);
                     }
                     }
+                    m_beforedrag_pointf = e.Location;
                 }
                 }
-            
-
+            }
 
 
             #region 向报告程序右下角,传送鼠标颗粒等相关信息
             #region 向报告程序右下角,传送鼠标颗粒等相关信息
             //然后这里还要将鼠标移动经过的过程,传输给reportapp中,为了能让reportapp能显示出来
             //然后这里还要将鼠标移动经过的过程,传输给reportapp中,为了能让reportapp能显示出来
@@ -946,8 +958,6 @@ namespace OTSIncAReportGraph.Controls
                 Point sem_point = (Point)in_obj;
                 Point sem_point = (Point)in_obj;
 
 
                 //第一步,连接电镜
                 //第一步,连接电镜
-                
-
 
 
                 //第二步,移动到指定位置,先读取再设置
                 //第二步,移动到指定位置,先读取再设置
                 if (m_imgDisHelper.ConnectToIpcSvr())
                 if (m_imgDisHelper.ConnectToIpcSvr())
@@ -1105,7 +1115,8 @@ namespace OTSIncAReportGraph.Controls
         /// </summary>
         /// </summary>
         public void GetDistrbutionSortimage_ByQuery(Dictionary<OTS_REPORT_PROP_GRID_ITEMS,ConditionItem> currentConditionValue)
         public void GetDistrbutionSortimage_ByQuery(Dictionary<OTS_REPORT_PROP_GRID_ITEMS,ConditionItem> currentConditionValue)
         {
         {
-           
+            PointF pointF = new PointF(0, 0);
+            ImageZoom(1, pointF);
             Dictionary<string, List<DisplayParticle>> FLNameList = new System.Collections.Generic.Dictionary<string, List<DisplayParticle>>();
             Dictionary<string, List<DisplayParticle>> FLNameList = new System.Collections.Generic.Dictionary<string, List<DisplayParticle>>();
 
 
             m_list_sortparticledistribution.Clear();
             m_list_sortparticledistribution.Clear();