Browse Source

Merge branch 'GSP' of http://36.129.169.60:30080/gogsadmin/OTS into GSP

GSP 1 month ago
parent
commit
7aba4b075b

+ 31 - 18
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -294,10 +294,10 @@ namespace OTSMeasureApp
                     break;
                 case "SlopFocusMenuItem":
 
-                    if (slopFocus == null)
-                    {
+                    //if (slopFocus == null)
+                    //{
                         slopFocus = new SlopFocus(this);
-                    }
+                    //}
 
                     slopFocus.Show();
 
@@ -460,7 +460,9 @@ namespace OTSMeasureApp
                 var para = m_visualStage.GetSampleMeasurePara(sam.GetMeasureGDIObject());
 
                 SetWorkSampleMeasureArea(para);
-                if(frmInput.IsInclinedPlaneFocus) m_MeasureAppForm.m_ProjParam.GetWorkSample().GetMsrParams().SlopParam = frmInput.GetCSlopFocusParam();
+                if (frmInput.IsInclinedPlaneFocus)
+                { 
+                    m_MeasureAppForm.m_ProjParam.GetWorkSample().GetMsrParams().SlopParam = frmInput.GetCSlopFocusParam(); }
                 CSEMFieldData semdata = m_MeasureAppForm.m_ProjParam.GetResultData().GetWorkingSample().GetSEMDataMsr();
                 semdata.SetMagnification(frmInput.GetMagnification());
                 PrepareVisualMeasureField(GetWorkingVisualSample());
@@ -497,6 +499,16 @@ namespace OTSMeasureApp
 
 
 
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        
         public void DrawCircleByFixedpoint()
         {
             frmInitializeImageboundary frmInput = new frmInitializeImageboundary();
@@ -515,17 +527,10 @@ namespace OTSMeasureApp
                 float r;
                 PointF Centerpoint;
                 GetTriangleExcenterRadius(otsfir, otssec, otsthi, out r, out Centerpoint);
+                PointF lt = new PointF(Centerpoint.X - r, Centerpoint.Y - r);
+                PointF rb=new PointF(Centerpoint.X + r, Centerpoint.Y + r);
+                RectangleF rectangleThree = m_visualStage.GetCtrlCoordRectF(lt, rb);
 
-                RectangleF rectangleThree = new RectangleF(new PointF(Centerpoint.X - r, Centerpoint.Y - r), new SizeF(r * 2, r * 2));
-                //if (m_visualStage.CheckMeasureAreaIsBeyondStageArea(rectangleThree))
-                //{
-                //    m_IsDrawMeasure = true;
-                //}
-                //else
-                //{
-                //    m_IsDrawMeasure = false;
-                //    return;
-                //}
                 Color MeasureColor = Color.Red;
                 CMeasureArea newGDI = new CMeasureArea(rectangleThree, ShapeType.CIRCLE, "", sam.GetSampleName(), MeasureColor);
 
@@ -538,8 +543,13 @@ namespace OTSMeasureApp
                 var para = m_visualStage.GetSampleMeasurePara(sam.GetMeasureGDIObject());
 
                 SetWorkSampleMeasureArea(para);
-                if (frmInput.IsInclinedPlaneFocus) m_MeasureAppForm.m_ProjParam.GetWorkSample().GetMsrParams().SlopParam = frmInput.GetCSlopFocusParam();
-                CSEMFieldData semdata = m_MeasureAppForm.m_ProjParam.GetResultData().GetWorkingSample().GetSEMDataMsr();
+                
+
+                
+                if (frmInput.IsInclinedPlaneFocus) {
+                    m_MeasureAppForm.m_ProjParam.GetWorkSample().GetMsrParams().SlopParam = frmInput.GetCSlopFocusParam();
+                }
+                CSEMFieldData semdata = m_MeasureAppForm.m_ProjParam.GetWorkSample().GetSEMDataMsr();
                 semdata.SetMagnification(frmInput.GetMagnification());
                 PrepareVisualMeasureField(GetWorkingVisualSample());
             }
@@ -579,7 +589,6 @@ namespace OTSMeasureApp
                 {
                     return s;
                 }
-
             }
             return null;
         }
@@ -2613,7 +2622,11 @@ namespace OTSMeasureApp
             }
 
         }
-
+        public CSlopFocusParam getSlopFocusParam()
+        {
+            CSlopFocusParam cSlopFocusParam = m_MeasureAppForm.m_ProjParam.GetWorkSample().GetMsrParams().SlopParam;
+            return cSlopFocusParam;
+        }
         protected override bool ProcessDialogKey(Keys keyData)
         {
 

+ 15 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/SlopFocus.cs

@@ -33,6 +33,21 @@ namespace OTSMeasureApp
             //国际化
             lan = new OTSCommon.Language(this);
             table = lan.GetNameTable(this.Name);
+            CSlopFocusParam cSlopFocusParam = oTSSamplespaceWindow.getSlopFocusParam();
+            if(cSlopFocusParam!=null)
+            {
+                slopFocusParam = cSlopFocusParam;
+                cB_enable.Checked = slopFocusParam.IsUsingSlopParam;
+                tB_FirstPointX.Text = slopFocusParam.FirstPoint.X.ToString();
+                tB_FirstPointY.Text = slopFocusParam.FirstPoint.Y.ToString();
+                tB_FirstPointD.Text = slopFocusParam.FirstWD.ToString();
+                tB_SecondPointX.Text = slopFocusParam.SecondPoint.X.ToString();
+                tB_SecondPointY.Text = slopFocusParam.SecondPoint.Y.ToString();
+                tB_SecondPointD.Text = slopFocusParam.SecondWD.ToString();
+                tB_ThirdPointX.Text = slopFocusParam.ThirdPoint.X.ToString();
+                tB_ThirdPointY.Text = slopFocusParam.ThirdPoint.Y.ToString();
+                tB_ThirdPointD.Text = slopFocusParam.ThirdWD.ToString();
+            }
         }
         public CSlopFocusParam GetCSlopFocusParam()
         {

+ 3 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/VisualGDIObjects/CVisualStage.cs

@@ -384,6 +384,9 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
                 return new CDisplayGDIObject(realStartX, realStartY, realEndX - Math.Abs(realStartX), realEndY - Math.Abs(realStartY),  type, content, name);
            
         }
+
+
+
         public RectangleF GetCtrlCoordRectF(PointF OTSLeftTop, PointF OTSRightBottom)
         {
             try

+ 12 - 6
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/frmInitializeImageboundary.cs

@@ -34,8 +34,8 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
             double Pr = 0;
             if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
             {
-                tB_FirstPointX.Text = Px.ToString();
-                tB_FirstPointY.Text = Py.ToString();
+                tB_FirstPointX.Text = Math.Round(Px,2).ToString();
+                tB_FirstPointY.Text = Math.Round(Py, 2).ToString();
             }
             double WD = 0;
             if (cfun.GetWorkingDistance(ref WD))
@@ -52,8 +52,8 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
             double Pr = 0;
             if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
             {
-                tB_SecondPointX.Text = Px.ToString();
-                tB_SecondPointY.Text = Py.ToString();
+                tB_SecondPointX.Text = Math.Round(Px, 2).ToString();
+                tB_SecondPointY.Text = Math.Round(Py, 2).ToString();
             }
             double WD = 0;
             if (cfun.GetWorkingDistance(ref WD))
@@ -92,10 +92,16 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
             double Px = 0;
             double Py = 0;
             double Pr = 0;
+            
+            
+            
+            
+            
+            
             if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
             {
-                tB_ThirdPointX.Text = Px.ToString();
-                tB_ThirdPointY.Text = Py.ToString();
+                tB_ThirdPointX.Text = Math.Round(Px, 2).ToString();
+                tB_ThirdPointY.Text = Math.Round(Py, 2).ToString();
             }
             double WD = 0;
             if (cfun.GetWorkingDistance(ref WD))

+ 6 - 9
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/frmInitializeTwoPointRectangle.cs

@@ -39,9 +39,8 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
             double Pr = 0;
             if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
             {
-                tB_LTPointX.Text = Px.ToString();
-                tB_LTPointY.Text = Py.ToString();
-                LTPoint = new PointF((float)Px, (float)Py);
+                tB_LTPointX.Text = Math.Round(Px,2).ToString();
+                tB_LTPointY.Text = Math.Round(Py, 2).ToString();
             }
             double WD = 0;
             if (cfun.GetWorkingDistance(ref WD))
@@ -58,9 +57,8 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
 
             if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
             {
-                tB_RBPointX.Text = Px.ToString();
-                tB_RBPointY.Text = Py.ToString();
-                RBPoint = new PointF((float)Px, (float)Py);
+                tB_RBPointX.Text = Math.Round(Px,2).ToString();
+                tB_RBPointY.Text = Math.Round(Py, 2).ToString();
             }
             double WD = 0;
 
@@ -124,9 +122,8 @@ namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
             double Pr = 0;
             if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
             {
-                tBx_TheThirdPointX.Text = Px.ToString();
-                tBx_TheThirdPointY.Text = Py.ToString();
-                TheThirdPoint = new PointF((float)Px, (float)Py);
+                tBx_TheThirdPointX.Text = Math.Round(Px,2).ToString();
+                tBx_TheThirdPointY.Text = Math.Round(Py,2).ToString();
             }
             double WD = 0;
             if (cfun.GetWorkingDistance(ref WD))

+ 0 - 3
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -1824,9 +1824,6 @@ namespace OTSMeasureApp
             this.Controls.Add(dropHintPanel);
             dropHintPanel.BringToFront();
         }
-
-
-
         private void OTSIncAMeasureAppForm_DragLeave(object sender, EventArgs e)
         {
             dropHintPanel.Visible = false;