|  | @@ -18,7 +18,19 @@ using OTSMeasureApp._4_OTSSamplespaceGraphicsPanel;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  namespace OTSMeasureApp
 | 
	
		
			
				|  |  |  {
 | 
	
		
			
				|  |  | -    
 | 
	
		
			
				|  |  | +    public enum EnumMousePointPosition
 | 
	
		
			
				|  |  | +    {
 | 
	
		
			
				|  |  | +        MouseSizeNone = 0, //'无  
 | 
	
		
			
				|  |  | +        MouseSizeRight = 1, //'拉伸右边框  
 | 
	
		
			
				|  |  | +        MouseSizeLeft = 2, //'拉伸左边框  
 | 
	
		
			
				|  |  | +        MouseSizeBottom = 3, //'拉伸下边框  
 | 
	
		
			
				|  |  | +        MouseSizeTop = 4, //'拉伸上边框  
 | 
	
		
			
				|  |  | +        MouseSizeTopLeft = 5, //'拉伸左上角  
 | 
	
		
			
				|  |  | +        MouseSizeTopRight = 6, //'拉伸右上角  
 | 
	
		
			
				|  |  | +        MouseSizeBottomLeft = 7, //'拉伸左下角  
 | 
	
		
			
				|  |  | +        MouseSizeBottomRight = 8, //'拉伸右下角  
 | 
	
		
			
				|  |  | +        MouseDrag = 9   // '鼠标拖动  
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |      public partial class OTSSamplespaceWindow : DockContent
 | 
	
		
			
				|  |  |      {
 | 
	
		
			
				|  |  |          #region 全局变量定义
 | 
	
	
		
			
				|  | @@ -799,13 +811,50 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              //修改测量区域集合 索引     (添加样品或者切换样品时,将当前工作样品显示在样品孔的最上)
 | 
	
		
			
				|  |  | -            m_MeasureGDIObjects = OTSSamplespaceGraphicsPanelFun.SelectMeasureIndexIsTop(m_MeasureGDIObjects, sampleName);
 | 
	
		
			
				|  |  | +            m_MeasureGDIObjects = SelectMeasureIndexIsTop(m_MeasureGDIObjects, sampleName);
 | 
	
		
			
				|  |  |              //修改样品集合 索引
 | 
	
		
			
				|  |  | -            m_SampleGDIObjects = OTSSamplespaceGraphicsPanelFun.SelectSampleIndexIsTop(m_SampleGDIObjects, sampleName);
 | 
	
		
			
				|  |  | +            m_SampleGDIObjects = SelectSampleIndexIsTop(m_SampleGDIObjects, sampleName);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          #endregion
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +        private  List<CRectangleGDIObject> SelectMeasureIndexIsTop(List<CRectangleGDIObject> objList, string SampleName)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            List<CRectangleGDIObject> objListTemp = objList;
 | 
	
		
			
				|  |  | +            CRectangleGDIObject itemTemp = null;
 | 
	
		
			
				|  |  | +            foreach (CRectangleGDIObject item in objList)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                if (item.SampleName == SampleName)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    //临时记录所选测量区域
 | 
	
		
			
				|  |  | +                    itemTemp = item;
 | 
	
		
			
				|  |  | +                    //删除原信息
 | 
	
		
			
				|  |  | +                    objListTemp.Remove(item);
 | 
	
		
			
				|  |  | +                    //添加新信息
 | 
	
		
			
				|  |  | +                    objListTemp.Insert(objListTemp.Count, itemTemp);
 | 
	
		
			
				|  |  | +                    break;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            return objListTemp;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        private  List<CRectangleGDIObject> SelectSampleIndexIsTop(List<CRectangleGDIObject> objList, string SampleName)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            List<CRectangleGDIObject> objListTemp = objList;
 | 
	
		
			
				|  |  | +            CRectangleGDIObject itemTemp = null;
 | 
	
		
			
				|  |  | +            foreach (CRectangleGDIObject item in objList)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                if (item.SampleName == SampleName)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    //临时记录所选样品
 | 
	
		
			
				|  |  | +                    itemTemp = item;
 | 
	
		
			
				|  |  | +                    //删除原信息
 | 
	
		
			
				|  |  | +                    objListTemp.Remove(item);
 | 
	
		
			
				|  |  | +                    //添加新信息
 | 
	
		
			
				|  |  | +                    objListTemp.Insert(objListTemp.Count, itemTemp);
 | 
	
		
			
				|  |  | +                    break;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            return objListTemp;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          //响应委托事件的样品台数据
 | 
	
		
			
				|  |  |          public void InitStageDisplay(CStage SStage, CSEMStageData SEMStageData)
 | 
	
	
		
			
				|  | @@ -1767,12 +1816,12 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                          //移动鼠标绘制测量区域
 | 
	
		
			
				|  |  |                          //以中心绘制测量区域方法
 | 
	
		
			
				|  |  |                       
 | 
	
		
			
				|  |  | -                        OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition enumMouse = OTSSamplespaceGraphicsPanelFun.MousePointPosition(m_MouseDownPoint, m_MouseMovePoint);
 | 
	
		
			
				|  |  | +                        EnumMousePointPosition enumMouse = MousePointPosition(m_MouseDownPoint, m_MouseMovePoint);
 | 
	
		
			
				|  |  |                          Point LTPoint = new Point();
 | 
	
		
			
				|  |  |                          Size RBSize = new Size();
 | 
	
		
			
				|  |  |                          switch (enumMouse)
 | 
	
		
			
				|  |  |                          {
 | 
	
		
			
				|  |  | -                            case OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition.MouseSizeTopLeft:
 | 
	
		
			
				|  |  | +                            case EnumMousePointPosition.MouseSizeTopLeft:
 | 
	
		
			
				|  |  |                                  if (m_DrawMeasureType == (int)CreateRectangleType.Circle)
 | 
	
		
			
				|  |  |                                  {
 | 
	
		
			
				|  |  |                                      LTPoint.X = m_MouseDownPoint.X - tmp;
 | 
	
	
		
			
				|  | @@ -1790,7 +1839,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                                      rectangle = new Rectangle(LTPoint, RBSize);
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  |                                  break;
 | 
	
		
			
				|  |  | -                            case OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition.MouseSizeTopRight:
 | 
	
		
			
				|  |  | +                            case EnumMousePointPosition.MouseSizeTopRight:
 | 
	
		
			
				|  |  |                                  if (m_DrawMeasureType == (int)CreateRectangleType.Circle)
 | 
	
		
			
				|  |  |                                  {
 | 
	
		
			
				|  |  |                                      LTPoint.X = m_MouseDownPoint.X;
 | 
	
	
		
			
				|  | @@ -1808,7 +1857,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                                      rectangle = new Rectangle(LTPoint, RBSize);
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  |                                  break;
 | 
	
		
			
				|  |  | -                            case OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition.MouseSizeBottomLeft:
 | 
	
		
			
				|  |  | +                            case EnumMousePointPosition.MouseSizeBottomLeft:
 | 
	
		
			
				|  |  |                                  if (m_DrawMeasureType == (int)CreateRectangleType.Circle)
 | 
	
		
			
				|  |  |                                  {
 | 
	
		
			
				|  |  |                                      LTPoint.X = m_MouseDownPoint.X - tmp;
 | 
	
	
		
			
				|  | @@ -1826,7 +1875,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                                      rectangle = new Rectangle(LTPoint, RBSize);
 | 
	
		
			
				|  |  |                                  }
 | 
	
		
			
				|  |  |                                  break;
 | 
	
		
			
				|  |  | -                            case OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition.MouseSizeBottomRight:
 | 
	
		
			
				|  |  | +                            case EnumMousePointPosition.MouseSizeBottomRight:
 | 
	
		
			
				|  |  |                                  if (m_DrawMeasureType == (int)CreateRectangleType.Circle)
 | 
	
		
			
				|  |  |                                  {
 | 
	
		
			
				|  |  |                                      LTPoint.X = m_MouseDownPoint.X;
 | 
	
	
		
			
				|  | @@ -2170,7 +2219,55 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |              Invalidate();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -      
 | 
	
		
			
				|  |  | +        private  EnumMousePointPosition MousePointPosition(Point point, Point e)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            //MouseDrag 中心
 | 
	
		
			
				|  |  | +            if ((e.X == point.X) && (e.Y == point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseDrag;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //MouseSizeTopLeft 上左
 | 
	
		
			
				|  |  | +            if ((e.X < point.X) && (e.Y < point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseSizeTopLeft;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //MouseSizeTopRight 下右
 | 
	
		
			
				|  |  | +            if ((e.X > point.X) && (e.Y < point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseSizeTopRight;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //MouseSizeLeft 左侧
 | 
	
		
			
				|  |  | +            if ((e.X < point.X) && (e.Y == point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseSizeLeft;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //MouseSizeRight 右侧
 | 
	
		
			
				|  |  | +            if ((e.X > point.X) && (e.Y == point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseSizeRight;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //MouseSizeTop 上侧
 | 
	
		
			
				|  |  | +            if ((e.X == point.X) && (e.Y < point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseSizeTop;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //MouseSizeBottom 下侧
 | 
	
		
			
				|  |  | +            if ((e.X == point.X) && (e.Y > point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseSizeBottom;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //MouseSizeBottomRight 下左
 | 
	
		
			
				|  |  | +            if ((e.X < point.X) && (e.Y > point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseSizeBottomLeft;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //MouseSizeBottomRight 下右
 | 
	
		
			
				|  |  | +            if ((e.X > point.X) && (e.Y > point.Y))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return EnumMousePointPosition.MouseSizeBottomRight;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            return EnumMousePointPosition.MouseSizeNone;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          protected override void OnMouseUp(MouseEventArgs e)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              //判断当前是否手绘
 | 
	
	
		
			
				|  | @@ -2267,7 +2364,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                              //设置图形位置与大小
 | 
	
		
			
				|  |  |                              measureItem.Region = rectPara;
 | 
	
		
			
				|  |  |                              //重新绘制测量区域路径
 | 
	
		
			
				|  |  | -                            OTSSamplespaceGraphicsPanelFun.UpdateMeasureGraphicsPath(measureItem, rectPara);
 | 
	
		
			
				|  |  | +                            UpdateMeasureGraphicsPath(measureItem, rectPara);
 | 
	
		
			
				|  |  |                              //恢复光标
 | 
	
		
			
				|  |  |                              this.Cursor = System.Windows.Forms.Cursors.Default;
 | 
	
		
			
				|  |  |                                
 | 
	
	
		
			
				|  | @@ -2706,16 +2803,16 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  
 | 
	
		
			
				|  |  |                      //恢复图像初始位置
 | 
	
		
			
				|  |  | -                    OTSSamplespaceGraphicsPanelFun.RestoreInitialPosition(m_MeasureFieldGDIObjects, m_GlobalZoomNum);
 | 
	
		
			
				|  |  | +                    RestoreInitialPosition(m_MeasureFieldGDIObjects, m_GlobalZoomNum);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    OTSSamplespaceGraphicsPanelFun.RestoreInitialPosition(m_ImageGDIObjects, m_GlobalZoomNum);
 | 
	
		
			
				|  |  | +                   RestoreInitialPosition(m_ImageGDIObjects, m_GlobalZoomNum);
 | 
	
		
			
				|  |  |                      //样品
 | 
	
		
			
				|  |  | -                    OTSSamplespaceGraphicsPanelFun.MouseWheelFunction(m_SampleGDIObjects,m_visualStage.GetEdgeGDIObj(), m_GlobalZoomNum);
 | 
	
		
			
				|  |  | +                    MouseWheelFunction(m_SampleGDIObjects,m_visualStage.GetEdgeGDIObj(), m_GlobalZoomNum);
 | 
	
		
			
				|  |  |                  //样品孔
 | 
	
		
			
				|  |  | -                OTSSamplespaceGraphicsPanelFun.MouseWheelFunction(m_visualStage.GetAllGDIObject(), m_visualStage.GetEdgeGDIObj(), m_GlobalZoomNum);
 | 
	
		
			
				|  |  | +                MouseWheelFunction(m_visualStage.GetAllGDIObject(), m_visualStage.GetEdgeGDIObj(), m_GlobalZoomNum);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                  //测量区域
 | 
	
		
			
				|  |  | -                OTSSamplespaceGraphicsPanelFun.MouseWheelFunction(m_MeasureGDIObjects,m_visualStage.GetEdgeGDIObj(), m_GlobalZoomNum);
 | 
	
		
			
				|  |  | +               MouseWheelFunction(m_MeasureGDIObjects,m_visualStage.GetEdgeGDIObj(), m_GlobalZoomNum);
 | 
	
		
			
				|  |  |                   
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      if (m_GlobalZoomNum == 1)
 | 
	
	
		
			
				|  | @@ -2746,7 +2843,59 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        private  void RestoreInitialPosition(List<CRectangleGDIObject> l_GDIObjects, float m_GlobalZoomNum)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            for (int i = 0; i < l_GDIObjects.Count; i++)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                RectangleF rectF = new RectangleF();
 | 
	
		
			
				|  |  | +                rectF = l_GDIObjects[i].DrawRegionF;
 | 
	
		
			
				|  |  | +                //根据样品孔中心点与样品台中心点的方向 设置宽度与高度\
 | 
	
		
			
				|  |  | +                l_GDIObjects[i].Region = new Rectangle((int)(rectF.X * m_GlobalZoomNum), (int)(rectF.Y * m_GlobalZoomNum), (int)(rectF.Width * m_GlobalZoomNum), (int)(rectF.Height * m_GlobalZoomNum));
 | 
	
		
			
				|  |  | +                PointF pointF = new PointF(rectF.X * m_GlobalZoomNum, rectF.Y * m_GlobalZoomNum);
 | 
	
		
			
				|  |  | +                SizeF sizeF = new SizeF((rectF.Width * m_GlobalZoomNum), (rectF.Height * m_GlobalZoomNum));
 | 
	
		
			
				|  |  | +                l_GDIObjects[i].RegionF = new RectangleF(pointF, sizeF);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        private  void MouseWheelFunction(List<CRectangleGDIObject> objList, CRectangleGDIObject m_RectangleGDIObjects, float globalZoomNum)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            for (int i = 0; i < objList.Count; i++)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                //多边形测量区域鼠标缩放
 | 
	
		
			
				|  |  | +                if (objList[i].CreateType == CreateRectangleType.Polygon)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    if (objList[i].DrawPolygonPointRegionF != null)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        int polygonPointCount = objList[i].DrawPolygonPointRegionF.Count;
 | 
	
		
			
				|  |  | +                        if (polygonPointCount > 0)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            for (int pointIndex = 0; pointIndex < polygonPointCount; pointIndex++)
 | 
	
		
			
				|  |  | +                            {
 | 
	
		
			
				|  |  | +                                PointF wheelPoint = new PointF();
 | 
	
		
			
				|  |  | +                                wheelPoint = objList[i].DrawPolygonPointRegionF[pointIndex];
 | 
	
		
			
				|  |  | +                                float X = wheelPoint.X * globalZoomNum;
 | 
	
		
			
				|  |  | +                                float Y = wheelPoint.Y * globalZoomNum;
 | 
	
		
			
				|  |  | +                                objList[i].PolygonPointRegionF[pointIndex] = new PointF(wheelPoint.X * globalZoomNum, wheelPoint.Y * globalZoomNum);
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                else
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    RectangleF rectF = new RectangleF();
 | 
	
		
			
				|  |  | +                    rectF = objList[i].RegionF;
 | 
	
		
			
				|  |  | +                    //根据样品孔中心点与样品台中心点的方向 设置宽度与高度\
 | 
	
		
			
				|  |  | +                    RectangleF returnRectF = OTSSamplespaceGraphicsPanelFun.MouseWheelFunctionF(m_RectangleGDIObjects, rectF, globalZoomNum);
 | 
	
		
			
				|  |  | +                    objList[i].Region = new Rectangle((int)returnRectF.X, (int)returnRectF.Y, (int)returnRectF.Width, (int)returnRectF.Height);
 | 
	
		
			
				|  |  | +                    objList[i].BSEImageWitdh = returnRectF.Width;
 | 
	
		
			
				|  |  | +                    objList[i].BSEImageHeight = returnRectF.Height;
 | 
	
		
			
				|  |  | +                    objList[i].BSEImageLocation = new PointF(returnRectF.X, returnRectF.Y);
 | 
	
		
			
				|  |  | +                    objList[i].SEMCenterPoint = returnRectF.Location;
 | 
	
		
			
				|  |  | +                    //重新绘制测量区域路径
 | 
	
		
			
				|  |  | +                    UpdateMeasureGraphicsPath(objList[i], objList[i].Region);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          #endregion
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          #region 鼠标方法操作
 | 
	
	
		
			
				|  | @@ -2825,10 +2974,37 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                      item.DraggingPoint = e.Location;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      //重新绘制测量区域路径
 | 
	
		
			
				|  |  | -                    OTSSamplespaceGraphicsPanelFun.UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  | +                   UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        private  void UpdateMeasureGraphicsPath(CRectangleGDIObject measureItem, Rectangle rectPara)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            //重新绘制测量区域路径
 | 
	
		
			
				|  |  | +            GraphicsPath GPath = new GraphicsPath();
 | 
	
		
			
				|  |  | +            if (measureItem.CreateType == CreateRectangleType.Polygon)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                GraphicsPath PolygonMeasurePath = new GraphicsPath();
 | 
	
		
			
				|  |  | +                PolygonMeasurePath.AddPolygon(measureItem.PolygonPointRegionF.ToArray());
 | 
	
		
			
				|  |  | +                GPath = PolygonMeasurePath;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else if (measureItem.CreateType == CreateRectangleType.CircleByThreePoints)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                GPath.AddEllipse(rectPara);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                if (measureItem.Shape == (int)CreateRectangleType.Circle)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    GPath.AddEllipse(rectPara);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                else
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    GPath.AddRectangle(rectPara);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            measureItem.GPath = GPath;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          public void MouseMoveMeasureFucntion(CRectangleGDIObject item, MouseEventArgs e)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              //判断移动的样品 是否在样品台尺寸范围内
 | 
	
	
		
			
				|  | @@ -2855,7 +3031,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                  item.DraggingPoint = e.Location;
 | 
	
		
			
				|  |  |                  #endregion
 | 
	
		
			
				|  |  |                  //重新绘制测量区域路径
 | 
	
		
			
				|  |  | -                OTSSamplespaceGraphicsPanelFun.UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  | +                UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  |                  //帧图
 | 
	
		
			
				|  |  |                  MouseMoveSingleFucntion(m_MeasureFieldGDIObjects, e);
 | 
	
		
			
				|  |  |                  Invalidate();
 | 
	
	
		
			
				|  | @@ -2919,7 +3095,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      item.DraggingPoint = e.Location;
 | 
	
		
			
				|  |  |                      //重新绘制测量区域路径
 | 
	
		
			
				|  |  | -                    OTSSamplespaceGraphicsPanelFun.UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  | +                 UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  |                      //帧图
 | 
	
		
			
				|  |  |                      MouseMoveSingleFucntion(m_MeasureFieldGDIObjects, e);
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -2975,7 +3151,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                      item.DraggingPoint = e.Location;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      //重新绘制测量区域路径
 | 
	
		
			
				|  |  | -                    OTSSamplespaceGraphicsPanelFun.UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  | +                   UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -3061,7 +3237,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                  item.BSEImageHeight = item.Region.Height;
 | 
	
		
			
				|  |  |                  item.BSEImageLocation = item.Region.Location;
 | 
	
		
			
				|  |  |                  //重新绘制测量区域路径
 | 
	
		
			
				|  |  | -                OTSSamplespaceGraphicsPanelFun.UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  | +                UpdateMeasureGraphicsPath(item, item.Region);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          #endregion
 | 
	
	
		
			
				|  | @@ -3084,7 +3260,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                      break;
 | 
	
		
			
				|  |  |                  case "DeleteStage":
 | 
	
		
			
				|  |  |                      //删除样品
 | 
	
		
			
				|  |  | -                    OTSSamplespaceGraphicsPanelFun.DeleteSampleInfo(m_MeasureAppForm, m_SampleSelectName);
 | 
	
		
			
				|  |  | +                   DeleteSampleInfo(m_SampleSelectName);
 | 
	
		
			
				|  |  |                      break;
 | 
	
		
			
				|  |  |                  case "DriveSEMToCenterLocation":
 | 
	
		
			
				|  |  |                      //驱动SEM到中心位置
 | 
	
	
		
			
				|  | @@ -3142,7 +3318,55 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |                      break;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | +        private  bool DeleteSampleInfo( string sampleSelectName)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            try
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                //提交主窗体响应
 | 
	
		
			
				|  |  | +                bool deleteResult = false;
 | 
	
		
			
				|  |  | +                if (ShowDeleteDialog(sampleSelectName))
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    //设置当前状态
 | 
	
		
			
				|  |  | +                    m_MeasureAppForm.m_MessageStates = (int)MessageState.StartMeasure;
 | 
	
		
			
				|  |  | +                    deleteResult = m_MeasureAppForm.DeleteSample(sampleSelectName);
 | 
	
		
			
				|  |  | +                    if (deleteResult)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        //样品对象列表中无样品信息 则清除帧图对象列表信息
 | 
	
		
			
				|  |  | +                        bool result = m_MeasureAppForm.m_SamplepaceWindow.SampleIsEmptyClearSingleInfo();
 | 
	
		
			
				|  |  | +                        if (result)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            m_MeasureAppForm.m_MeasureRetWindow.SetInit();
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                return true;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            catch (Exception)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return false;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        private  bool ShowDeleteDialog(string sampleName)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            //国际化
 | 
	
		
			
				|  |  | +            OTSCommon.Language lan = new OTSCommon.Language();
 | 
	
		
			
				|  |  | +            Hashtable table = lan.GetNameTable("OTSIncAMeasureAppForm");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            string str1 = table["message5"].ToString();
 | 
	
		
			
				|  |  | +            string str2 = table["message6"].ToString();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            string sDeleteSampleName = str1;
 | 
	
		
			
				|  |  | +            sDeleteSampleName += sampleName;
 | 
	
		
			
				|  |  | +            sDeleteSampleName += "  信息 ?";
 | 
	
		
			
				|  |  | +            if (DialogResult.OK == MessageBox.Show(sDeleteSampleName, "Delete sample information prompt", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning))
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return true;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return false;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          public bool setSlopFocusParam(_5_OTSMeasureStatuImageFun.SlopFocus slopFocus)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              if (slopFocus == null)
 | 
	
	
		
			
				|  | @@ -4408,6 +4632,30 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |          #endregion
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          #region 获取样品孔图片
 | 
	
		
			
				|  |  | +        private  int GetSampleHoleIndex(StageDrawingData oTSSampleStageData, string sampleHoleName, ref OTSSampleHoleInfo sampleHoleInfo)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            try
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                int sampleHoleIndex = -1;
 | 
	
		
			
				|  |  | +                if (oTSSampleStageData.sSHoleInfoList.Count > 0)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    for (int i = 0; i < oTSSampleStageData.sSHoleInfoList.Count; i++)
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        if (oTSSampleStageData.sSHoleInfoList[i].sSHoleName == sampleHoleName)
 | 
	
		
			
				|  |  | +                        {
 | 
	
		
			
				|  |  | +                            sampleHoleInfo = oTSSampleStageData.sSHoleInfoList[i];
 | 
	
		
			
				|  |  | +                            sampleHoleIndex = i;
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                return sampleHoleIndex;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            catch (Exception)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                return -1;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          public void GetBSEPictures()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              //获取当前工作的测量区域信息
 | 
	
	
		
			
				|  | @@ -4422,7 +4670,7 @@ namespace OTSMeasureApp
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      //获取当前样品孔的索引 与 样品中对应的测量区域
 | 
	
		
			
				|  |  |                      OTSSampleHoleInfo sampleHoleInfo = null;
 | 
	
		
			
				|  |  | -                    int sampleHoleIndex = OTSSamplespaceGraphicsPanelFun.GetSampleHoleIndex(m_visualStage.GetOTSSampleStageData(), m_SampleHoleSelectName, ref sampleHoleInfo);
 | 
	
		
			
				|  |  | +                    int sampleHoleIndex =GetSampleHoleIndex(m_visualStage.GetOTSSampleStageData(), m_SampleHoleSelectName, ref sampleHoleInfo);
 | 
	
		
			
				|  |  |                      if (sampleHoleInfo != null)
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          
 |