|
|
@@ -562,44 +562,6 @@ namespace OTSMeasureApp
|
|
|
PrepareVisualMeasureField(GetWorkingVisualSample());
|
|
|
}
|
|
|
}
|
|
|
- public void DrawRectangleByLengthAndWidth()
|
|
|
- {
|
|
|
- frmInitializeLengthAndWidthRectangle frmInput = new frmInitializeLengthAndWidthRectangle();
|
|
|
- DialogResult result = frmInput.ShowDialog();
|
|
|
- if (result == DialogResult.OK)
|
|
|
- {
|
|
|
- double length = frmInput.length;
|
|
|
- double wide = frmInput.width;
|
|
|
- var sam = GetWorkingVisualSample();
|
|
|
- CMeasureArea area= sam.GetMeasureGDIObject();
|
|
|
- PointF center = new PointF(area.GetZoomedRegionF().Left + area.GetZoomedRegionF().Width / 2, area.GetZoomedRegionF().Top + area.GetZoomedRegionF().Height / 2);
|
|
|
- PointF otslt = new PointF(), otsrb = new PointF();
|
|
|
- PointF lt = new PointF((float)(center.X - m_visualStage.MicronConvertToPixel(length) / 2), (float)(center.Y - m_visualStage.MicronConvertToPixel(wide) / 2));
|
|
|
- PointF rb = new PointF((float)(center.X + m_visualStage.MicronConvertToPixel(length) / 2), (float)(center.Y + m_visualStage.MicronConvertToPixel(wide) / 2));
|
|
|
-
|
|
|
- m_visualStage.m_SEMStageData.ConvertSEMToOTSCoord(lt, ref otslt);
|
|
|
- m_visualStage.m_SEMStageData.ConvertSEMToOTSCoord(rb, ref otsrb);
|
|
|
-
|
|
|
- var visualRec = m_visualStage.GetCtrlCoordRectF(otslt, otsrb);
|
|
|
- Color MeasureColor = Color.Red;
|
|
|
- CMeasureArea newGDI = new CMeasureArea(visualRec, ShapeType.RECTANGLE, "", sam.GetSampleName(), MeasureColor);
|
|
|
-
|
|
|
- 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());
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- SetWorkSampleMeasureArea(para);
|
|
|
- PrepareVisualMeasureField(GetWorkingVisualSample());
|
|
|
- }
|
|
|
- }
|
|
|
public void SetWorkSampleMeasureArea(SampleMeasurePara SMeasurePara)
|
|
|
{
|
|
|
COTSSample WSample = m_MeasureAppForm.m_ProjParam.GetResultData().GetWorkingSample();
|