@wang_qi0307 5 years ago
parent
commit
eef4a2c808
3 changed files with 49 additions and 3 deletions
  1. 2 0
      HOZProject/App.config
  2. 44 0
      HOZProject/FormUnitControl.cs
  3. 3 3
      MeasureThread/Measure.cs

+ 2 - 0
HOZProject/App.config

@@ -53,5 +53,7 @@
       <add key="WebServerPort" value="12345"/>
       <!--远程算法地址-->
       <add key="WebServerUrl" value="FIB_degree_recognize,test2,FIB_verify,test4,test5,test6,test7,test8"/>
+
+      <add key=""/>
     </appSettings>
 </configuration>

+ 44 - 0
HOZProject/FormUnitControl.cs

@@ -1597,6 +1597,50 @@ namespace HOZProject
             }
         }
 
+        public void AnalysisPosition(Double centerX,Double centerY,Double firstX,Double firstY,Double distance,int rag,ref List<Double> ptsx,ref List<Double> ptsy)
+        {
+            //求样品1的水平角度
+            double angle = 0;
+
+            //清空所有点信息
+            ptsx.Clear();
+            ptsy.Clear();
+            //将第一个点加入到点信息中
+            ptsx.Add(firstX);
+            ptsy.Add(firstY);
+
+            //计算第一个点与X轴的交角度数
+            angle = Math.Atan2(ptsy[0] - centerY, centerX - ptsx[0]) * 180 / Math.PI;
+
+            //这里是求与第一个点横向排列的其他点的移动角度
+            //就是按45度向左向右移动的度
+            angle = 45 - angle;
+            angle = angle * Math.PI / 180;
+
+            double tx = 0;
+            double ty = 0;
+            for (int j = 0; j < rag; j++)
+            {
+                //计算每行第一个点的坐标
+                if (j > 0)
+                {
+                    tx = distance * j * Math.Sin(angle);
+                    ty = distance * j * Math.Cos(angle);
+                    ptsx.Add(tx + ptsx[0]);
+                    ptsy.Add(ptsy[0] - ty);
+                }
+                //计算每行其他点的坐标
+                for (int i = 1; i < rag; i++)
+                {
+                    tx = distance * i * Math.Cos(angle);
+                    ty = distance * i * Math.Sin(angle);
+                    ptsx.Add(tx + ptsx[j * rag]);
+                    ptsy.Add(ty + ptsy[j * rag]);
+                }
+            }
+        }
+
+
         private void btn30_Click(object sender, EventArgs e)
         {
             txtsample1x.Text = "21.7";

+ 3 - 3
MeasureThread/Measure.cs

@@ -751,13 +751,13 @@ namespace MeasureThread
             {
                 //1.控制SEM放大600X
                 arg.State = "SEM";
-                if (!iSEM.SetMagnification(m_measureFile.MParam.Photograph_Magnification))
+                if (!iSEM.SetMagnification(m_measureFile.MParam.Location_Magnification))
                 {
-                    arg.Message = "放大" + m_measureFile.MParam.Photograph_Magnification.ToString("0.0") + "倍失败";
+                    arg.Message = "放大" + m_measureFile.MParam.Location_Magnification.ToString("0.0") + "倍失败";
                     SendMsg("1-2");
                     return false;
                 }
-                arg.Message = "放大" + m_measureFile.MParam.Photograph_Magnification.ToString("0.0") + "倍成功";
+                arg.Message = "放大" + m_measureFile.MParam.Location_Magnification.ToString("0.0") + "倍成功";
                 SendMsg("1-2");
 
                 //2.控制SEM自动对焦、亮度、对比度