|
@@ -159,97 +159,6 @@ namespace OTSMeasureApp
|
|
|
//国际化
|
|
|
lan = new OTSCommon.Language(this);
|
|
|
table = lan.GetNameTable(this.Name);
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 画圆形测试区域 事件
|
|
|
- /// </summary>
|
|
|
- public void DrawCircleMeasure()
|
|
|
- {
|
|
|
- //手绘测量区域类型为圆形
|
|
|
- m_DrawMeasureType = CreateRectangleType.Circle;
|
|
|
- m_IsDrawMeasure = true;
|
|
|
- m_DrawMeasureGDIObject = null;
|
|
|
- this.Cursor = Cursors.Hand;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 画矩形测试区域 事件
|
|
|
- /// </summary>
|
|
|
- public void DrawRectangleMeasure()
|
|
|
- {
|
|
|
- //手绘测量区域类型为矩形
|
|
|
- m_DrawMeasureType = CreateRectangleType.SampleBackGround_Rectangle;
|
|
|
-
|
|
|
- m_IsDrawMeasure = true;
|
|
|
- m_DrawMeasureGDIObject = null;
|
|
|
- this.Cursor = Cursors.Hand;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 画多边形测试区域 事件
|
|
|
- /// </summary>
|
|
|
- public void DrawPolygonMeasure()
|
|
|
- {
|
|
|
- m_DrawMeasureType = CreateRectangleType.Polygon;
|
|
|
- m_IsDrawMeasure = true;
|
|
|
- m_DrawMeasureGDIObject = null;
|
|
|
- this.Cursor = Cursors.Hand;
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 三点画圆形测试区域 事件 先多边形后圆形
|
|
|
- /// </summary>
|
|
|
- public void DrawCircleMeasureByThreePoints()
|
|
|
- {
|
|
|
- //手绘测量区域类型为圆形
|
|
|
- m_DrawMeasureType = CreateRectangleType.CircleByThreePoints;
|
|
|
- m_IsDrawMeasure = true;
|
|
|
- m_DrawMeasureGDIObject = null;
|
|
|
- this.Cursor = Cursors.Hand;
|
|
|
- }
|
|
|
- public void DrawRingShapeArea()
|
|
|
- {
|
|
|
- //手绘测量区域类型为圆形
|
|
|
- m_DrawMeasureType = CreateRectangleType.RingShape;
|
|
|
- RingGdiDataInput frmInput = new RingGdiDataInput();
|
|
|
- if (frmInput.ShowDialog() == DialogResult.OK)
|
|
|
- {
|
|
|
- float diameter = (float)m_visualStage.MicronConvertToPixel(frmInput.Diameter);
|
|
|
- float ringwidth = (float)m_visualStage.MicronConvertToPixel(frmInput.RingWidth);
|
|
|
- var sam = GetWorkingVisualSample();
|
|
|
- SizeF size = new SizeF(diameter, diameter);
|
|
|
- var position = sam.GetMeasureGDIObject().GetZoomedRegionF().Location;
|
|
|
- RectangleF rec = sam.GetMeasureGDIObject().GetZoomedRegionF();
|
|
|
- PointF centerPos = new PointF(position.X + rec.Width / 2, position.Y + rec.Height / 2);
|
|
|
- PointF newRegionFPos = new PointF(centerPos.X - diameter / 2, centerPos.Y - diameter / 2);
|
|
|
- RectangleF rectangle = new RectangleF(newRegionFPos, size);
|
|
|
- Color MeasureColor = Color.Red;
|
|
|
- CRingGDIObject newGDI;
|
|
|
-
|
|
|
- newGDI = new CRingGDIObject(rectangle, CreateRectangleType.RingShape, sam.GetSampleGDIObject().NameOrHoleName, sam.GetSampleName(), MeasureColor);
|
|
|
- newGDI.SetRingWidth(ringwidth);
|
|
|
-
|
|
|
- newGDI.SetZoomNumber(m_visualStage.GetZoomNum());
|
|
|
- newGDI.SetDisplayRefPoint(m_visualStage.GetDisplayRefPoint());
|
|
|
-
|
|
|
- newGDI.IsWorkSample = true;
|
|
|
-
|
|
|
-
|
|
|
- sam.SetMeasureGDIObject(newGDI);
|
|
|
-
|
|
|
-
|
|
|
- m_DrawPolygonFinishGDIObject = null;
|
|
|
- m_DrawMeasureGDIObject = null;
|
|
|
-
|
|
|
- var para = m_visualStage.GetSampleMeasurePara(sam.GetMeasureGDIObject());
|
|
|
-
|
|
|
- m_MeasureAppForm.m_ProjParam.SetWorkSampleHoleAndMeasureArea(para);
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
#region 菜单操作
|
|
|
private void CMStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
|
|
@@ -342,6 +251,97 @@ namespace OTSMeasureApp
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
+ /// <summary>
|
|
|
+ /// 画圆形测试区域 事件
|
|
|
+ /// </summary>
|
|
|
+ public void DrawCircleMeasure()
|
|
|
+ {
|
|
|
+ //手绘测量区域类型为圆形
|
|
|
+ m_DrawMeasureType = CreateRectangleType.Circle;
|
|
|
+ m_IsDrawMeasure = true;
|
|
|
+ m_DrawMeasureGDIObject = null;
|
|
|
+ this.Cursor = Cursors.Hand;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 画矩形测试区域 事件
|
|
|
+ /// </summary>
|
|
|
+ public void DrawRectangleMeasure()
|
|
|
+ {
|
|
|
+ //手绘测量区域类型为矩形
|
|
|
+ m_DrawMeasureType = CreateRectangleType.SampleBackGround_Rectangle;
|
|
|
+
|
|
|
+ m_IsDrawMeasure = true;
|
|
|
+ m_DrawMeasureGDIObject = null;
|
|
|
+ this.Cursor = Cursors.Hand;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 画多边形测试区域 事件
|
|
|
+ /// </summary>
|
|
|
+ public void DrawPolygonMeasure()
|
|
|
+ {
|
|
|
+ m_DrawMeasureType = CreateRectangleType.Polygon;
|
|
|
+ m_IsDrawMeasure = true;
|
|
|
+ m_DrawMeasureGDIObject = null;
|
|
|
+ this.Cursor = Cursors.Hand;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 三点画圆形测试区域 事件 先多边形后圆形
|
|
|
+ /// </summary>
|
|
|
+ public void DrawCircleMeasureByThreePoints()
|
|
|
+ {
|
|
|
+ //手绘测量区域类型为圆形
|
|
|
+ m_DrawMeasureType = CreateRectangleType.CircleByThreePoints;
|
|
|
+ m_IsDrawMeasure = true;
|
|
|
+ m_DrawMeasureGDIObject = null;
|
|
|
+ this.Cursor = Cursors.Hand;
|
|
|
+ }
|
|
|
+ public void DrawRingShapeArea()
|
|
|
+ {
|
|
|
+ //手绘测量区域类型为圆形
|
|
|
+ m_DrawMeasureType = CreateRectangleType.RingShape;
|
|
|
+ RingGdiDataInput frmInput = new RingGdiDataInput();
|
|
|
+ if (frmInput.ShowDialog() == DialogResult.OK)
|
|
|
+ {
|
|
|
+ float diameter = (float)m_visualStage.MicronConvertToPixel(frmInput.Diameter);
|
|
|
+ float ringwidth = (float)m_visualStage.MicronConvertToPixel(frmInput.RingWidth);
|
|
|
+ var sam = GetWorkingVisualSample();
|
|
|
+ SizeF size = new SizeF(diameter, diameter);
|
|
|
+ var position = sam.GetMeasureGDIObject().GetZoomedRegionF().Location;
|
|
|
+ RectangleF rec = sam.GetMeasureGDIObject().GetZoomedRegionF();
|
|
|
+ PointF centerPos = new PointF(position.X + rec.Width / 2, position.Y + rec.Height / 2);
|
|
|
+ PointF newRegionFPos = new PointF(centerPos.X - diameter / 2, centerPos.Y - diameter / 2);
|
|
|
+ RectangleF rectangle = new RectangleF(newRegionFPos, size);
|
|
|
+ Color MeasureColor = Color.Red;
|
|
|
+ CRingGDIObject newGDI;
|
|
|
+
|
|
|
+ newGDI = new CRingGDIObject(rectangle, CreateRectangleType.RingShape, sam.GetSampleGDIObject().NameOrHoleName, sam.GetSampleName(), MeasureColor);
|
|
|
+ newGDI.SetRingWidth(ringwidth);
|
|
|
+
|
|
|
+ newGDI.SetZoomNumber(m_visualStage.GetZoomNum());
|
|
|
+ newGDI.SetDisplayRefPoint(m_visualStage.GetDisplayRefPoint());
|
|
|
+
|
|
|
+ newGDI.IsWorkSample = true;
|
|
|
+
|
|
|
+
|
|
|
+ sam.SetMeasureGDIObject(newGDI);
|
|
|
+
|
|
|
+
|
|
|
+ m_DrawPolygonFinishGDIObject = null;
|
|
|
+ m_DrawMeasureGDIObject = null;
|
|
|
+
|
|
|
+ var para = m_visualStage.GetSampleMeasurePara(sam.GetMeasureGDIObject());
|
|
|
+
|
|
|
+ m_MeasureAppForm.m_ProjParam.SetWorkSampleHoleAndMeasureArea(para);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public CVisualSampleArea GetWorkingVisualSample()
|
|
|
{
|
|
|
|
|
@@ -2705,6 +2705,19 @@ namespace OTSMeasureApp
|
|
|
|
|
|
if (runType == MSR_RUN_TYPE.RUNSampleHoleImage)
|
|
|
{
|
|
|
+ //-------maybe take more than one visualsample hole image for one sample,
|
|
|
+ //if the previous visual area's fields don't finish,then the unfinished field's area may overlap with the current visualsample's area.
|
|
|
+ // then there positions will conflict. So we should remove the unfinished fields first.
|
|
|
+ var completeHoleImgs = new List<CRectangleGDIObject>();
|
|
|
+ foreach (var holeImgfld in sam.FrameOfHoleGDIObjects)
|
|
|
+ {
|
|
|
+ if (holeImgfld.BSEImage != null)
|
|
|
+ {
|
|
|
+ completeHoleImgs.Add(holeImgfld);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sam.FrameOfHoleGDIObjects = completeHoleImgs;
|
|
|
+ //------
|
|
|
foreach (var r in visualfieldRects)
|
|
|
{
|
|
|
r.SetDisplayRefPoint(m_visualStage.GetDisplayRefPoint());
|
|
@@ -2725,6 +2738,8 @@ namespace OTSMeasureApp
|
|
|
createImageRect.NameOrHoleName = r.NameOrHoleName;
|
|
|
createImageRect.SetZoomNumber(m_visualStage.GetZoomNum());
|
|
|
createImageRect.SetDisplayRefPoint(m_visualStage.GetDisplayRefPoint());
|
|
|
+
|
|
|
+
|
|
|
sam.FrameOfHoleGDIObjects.Add(createImageRect);
|
|
|
}
|
|
|
|