浏览代码

添加对焦参数

HaoShuang 5 年之前
父节点
当前提交
a2df7e5c0e
共有 4 个文件被更改,包括 16 次插入4 次删除
  1. 1 1
      ManulDo/MainForm.Designer.cs
  2. 1 0
      MeasureData/MeasureData.csproj
  3. 7 0
      MeasureData/MeasureParam.cs
  4. 7 3
      MeasureThread/Measure.cs

+ 1 - 1
ManulDo/MainForm.Designer.cs

@@ -615,7 +615,7 @@
             this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.groupBox1);
             this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.Name = "MainForm";
+            //this.Name = "MainForm";
             this.Text = "测量流程测试";
             this.groupBox1.ResumeLayout(false);
             this.groupBox2.ResumeLayout(false);

+ 1 - 0
MeasureData/MeasureData.csproj

@@ -49,6 +49,7 @@
   <ItemGroup>
     <Compile Include="ConfigFile.cs" />
     <Compile Include="CutHole.cs" />
+    <Compile Include="FocusParam.cs" />
     <Compile Include="MeasureFile.cs" />
     <Compile Include="MeasureParam.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />

+ 7 - 0
MeasureData/MeasureParam.cs

@@ -124,6 +124,12 @@ namespace MeasureData
         }
 
         //对焦参数
+        private FocusParam focusP;
+        public FocusParam AutoFocus
+        {
+            get { return this.focusP; }
+            set { this.focusP = value; }
+        }
 
         //能谱参数
 
@@ -165,6 +171,7 @@ namespace MeasureData
             slo_msparam.Register("FIBTemp", FIBtemp);
             slo_msparam.Register("PTTemp", PTtemp);
             slo_msparam.Register("FocusMode", FocMode);
+            slo_msparam.Register("FocusParam", AutoFocus);
 
             if (isStoring)
             {

+ 7 - 3
MeasureThread/Measure.cs

@@ -1592,11 +1592,15 @@ namespace MeasureThread
 
             return true;
         }
-        
 
-            //2. 计算评价函数
-            //3. 获取焦距
+        //自动聚焦
+        public bool AutoFocus(string a_strPath, out int a_nWd)
+        {
+            a_nWd = 0;
+            a_nWd = (int)Math.Ceiling(iSEM.GetWorkingDistance() * 100000000 + 0.5);//获取当前的工作距离
+
             return true;
+
         }
     }
 }