Jelajahi Sumber

add workingDistance parameter to the BC regulate parameter.

GSP 3 minggu lalu
induk
melakukan
629342cf2c

+ 2 - 2
Bin/x64/Debug/Config/SysData/OTSProgMgrParam.pmf

@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData RunMode="ProfessionalMode" SysType="TCCleannessA">
+<XMLData RunMode="ProfessionalMode" SysType="IncA">
   <Member RegName="BrightnessContrastRegulateParam" AutoRegulateType="EveryPeriod" BrightPhaseElement="Al" BrightPhaseValue="124" DarkPhaseElement="C" DarkPhaseValue="11" InitialBrightness="45.53382111" InitialContrast="60.21995716" mag="100" Period="5" StdMaterialOTSPos="41475,-4357" ToRun="false" />
   <Member RegName="GenParam" DefaultArea="50" DefaultSampleName="Sample" DefaultShape="1" EngineType="0:InclustionEngine" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="Baohuzha" SteelTechnology="0" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="0:AUTO" MatrixStep="0" OverlapParam="0" ParticleSelectionCondition="">
     <Member RegName="BGGray" end="77" start="0" />
-    <Member RegName="IncArea" end="1000" start="10" />
+    <Member RegName="IncArea" end="1000" start="60" />
     <Member RegName="ParticleGray" end="255" start="0" />
   </Member>
   <Member RegName="ImageScanParam" FieldDistributeMode="0:Normal" ImageResolution="3:_1024_768" SatrtImageMode="1:Snake" ScanImageSpeed="0:low" StopMode="0:CoverMode" StopParamArea="10" StopParamFields="2" StopParamMeasTime="360" StopParamParticles="5000" />

+ 1 - 1
Bin/x64/Debug/Config/SysData/OTSReportMgrParam.rpf

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData systype="TCCleannessA">
+<XMLData systype="IncA">
   <Member RegName="Scale" strValue="1000" />
   <Member RegName="DefaultComputedColName" strValue="Area,MinDiameter,DiameterRatio,PERP,XRayDataCount" />
   <Member RegName="ElementsColName" strValue="O,Mg,Si,Ti,Pm,N,Na,Cl,K,S,Ca,Al,Zr,P,Fe,Zn,Cu,F,Sn,Br,V,Ba,Ni,Mo,Cr" />

+ 6 - 3
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CBrightnessContrastRegulateParam.cs

@@ -36,6 +36,7 @@ namespace OTSMeasureApp._0_OTSModel.OTSDataType
         public int period = 60;//minutes to run the regulation
         public AutoRegulateType autoRegulateType = AutoRegulateType.EveryPeriod; //自动调节类型
         public bool toRun = false;
+        public double workingDistance = 10.0;    
         public override void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
         {
             xInt xbrphasevalue  = new xInt();
@@ -49,6 +50,7 @@ namespace OTSMeasureApp._0_OTSModel.OTSDataType
             xDouble xinitialContrast = new xDouble(this.initialContrast);
             xInt xPeriod = new xInt(this.period);
             xString xAutoRegulateType = new xString(this.autoRegulateType.ToString());
+            xDouble xworkingDistance = new xDouble(this.workingDistance);
             Slo slo = new Slo();
             slo.Register("ToRun", xtorun);
             slo.Register("BrightPhaseElement", xbrphaseelement);
@@ -60,7 +62,8 @@ namespace OTSMeasureApp._0_OTSModel.OTSDataType
             slo.Register("InitialContrast", xinitialContrast); 
             slo.Register("StdMaterialOTSPos", xStart);
             slo.Register("Period", xPeriod);
-            slo.Register("AutoRegulateType", xAutoRegulateType);    
+            slo.Register("AutoRegulateType", xAutoRegulateType);
+            slo.Register("WorkingDistance", xworkingDistance);
 
             if (isStoring)
             {
@@ -75,7 +78,7 @@ namespace OTSMeasureApp._0_OTSModel.OTSDataType
                 xinitialContrast.AssignValue(initialContrast);
                 xPeriod.AssignValue(period);
                 xAutoRegulateType.AssignValue(autoRegulateType.ToString());
-
+                xworkingDistance.AssignValue(workingDistance);
 
                 slo.Serialize(true, classDoc, rootNode);
             }
@@ -93,7 +96,7 @@ namespace OTSMeasureApp._0_OTSModel.OTSDataType
                 initialContrast = xinitialContrast.value();
                 period = xPeriod.value();
                 autoRegulateType = (AutoRegulateType)Enum.Parse(typeof(AutoRegulateType), xAutoRegulateType.value(), true); 
-
+                workingDistance = xworkingDistance.value();
             }
         }
     }

+ 24 - 1
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CBrightnessContrastAdjust.cs

@@ -178,6 +178,25 @@ namespace OTSMeasureApp._1_OTSMeasure.Measure._3_MeasureFlow
                 Thread.Sleep(hardWareDelay);
             }
 
+            return true;
+        }
+        public bool SetWorkingDistance(double wd)
+        {
+            //var wd = m_BrightnessContrastRegulateParam.workingDistance; 
+            // get SEM controller 
+            var pSEMController = m_SemHardwareMgr;
+
+            log.Info("Begin to set working distance to " + wd.ToString("F2"));
+
+            // move SEM to the position (rotation 0)
+            if (!pSEMController.SetWorkingDistance(wd)) 
+            {
+                log.Error("failed to set working distance!");
+                return false;
+            }
+
+           
+
             return true;
         }
         public void StopBrightnessContrastAdjust()
@@ -238,7 +257,11 @@ namespace OTSMeasureApp._1_OTSMeasure.Measure._3_MeasureFlow
                   
                     return;
                 }
-           
+                if(!SetWorkingDistance( m_BrightnessContrastRegulateParam.workingDistance))
+                {
+                    log.Error(" failed to set working distance.");
+                    return;
+                }   
                 m_SemHardwareMgr.SetSemContrast(m_BrightnessContrastRegulateParam.initialContrast);
                 m_SemHardwareMgr.SetSemBrightness(m_BrightnessContrastRegulateParam.initialBrightness);
                 CBSEImgClr pBSEIamge = m_ScanHardwareMgr.AcquireBSEImage();

+ 1 - 0
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSMeasureStatusWindow.cs

@@ -1894,6 +1894,7 @@ namespace OTSMeasureApp
             frmBC.initialContrast = param.initialContrast;
             frmBC.autoregulateType = param.autoRegulateType;
             frmBC.period = param.period;
+            frmBC.workingDistance=param.workingDistance;
             frmBC.stageData = m_MeasureAppForm.m_ProjParam.GetDefaultParam().GetStageDataParam();
             frmBC.isToRun = param.toRun;
             frmBC.Show();

+ 37 - 15
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/frmBCRegulate.Designer.cs

@@ -57,6 +57,8 @@
             this.txtperiod = new System.Windows.Forms.TextBox();
             this.radiobtnEverySample = new System.Windows.Forms.RadioButton();
             this.radiobtnEveryPeriod = new System.Windows.Forms.RadioButton();
+            this.txtWD = new System.Windows.Forms.TextBox();
+            this.label8 = new System.Windows.Forms.Label();
             this.groupBox2.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -64,7 +66,7 @@
             // 
             this.txtstdpos.Location = new System.Drawing.Point(161, 36);
             this.txtstdpos.Name = "txtstdpos";
-            this.txtstdpos.Size = new System.Drawing.Size(132, 21);
+            this.txtstdpos.Size = new System.Drawing.Size(75, 21);
             this.txtstdpos.TabIndex = 0;
             // 
             // cbobrele
@@ -78,21 +80,21 @@
             "Zn"});
             this.cbobrele.Location = new System.Drawing.Point(162, 104);
             this.cbobrele.Name = "cbobrele";
-            this.cbobrele.Size = new System.Drawing.Size(68, 20);
+            this.cbobrele.Size = new System.Drawing.Size(55, 20);
             this.cbobrele.TabIndex = 1;
             // 
             // txtbrvalue
             // 
-            this.txtbrvalue.Location = new System.Drawing.Point(240, 104);
+            this.txtbrvalue.Location = new System.Drawing.Point(223, 104);
             this.txtbrvalue.Name = "txtbrvalue";
-            this.txtbrvalue.Size = new System.Drawing.Size(58, 21);
+            this.txtbrvalue.Size = new System.Drawing.Size(84, 21);
             this.txtbrvalue.TabIndex = 2;
             // 
             // txtdarkvalue
             // 
-            this.txtdarkvalue.Location = new System.Drawing.Point(240, 78);
+            this.txtdarkvalue.Location = new System.Drawing.Point(223, 78);
             this.txtdarkvalue.Name = "txtdarkvalue";
-            this.txtdarkvalue.Size = new System.Drawing.Size(58, 21);
+            this.txtdarkvalue.Size = new System.Drawing.Size(84, 21);
             this.txtdarkvalue.TabIndex = 3;
             // 
             // cbodarkele
@@ -105,26 +107,26 @@
             "Cu"});
             this.cbodarkele.Location = new System.Drawing.Point(162, 79);
             this.cbodarkele.Name = "cbodarkele";
-            this.cbodarkele.Size = new System.Drawing.Size(68, 20);
+            this.cbodarkele.Size = new System.Drawing.Size(55, 20);
             this.cbodarkele.TabIndex = 4;
             // 
             // txtinitbr
             // 
             this.txtinitbr.Location = new System.Drawing.Point(162, 179);
             this.txtinitbr.Name = "txtinitbr";
-            this.txtinitbr.Size = new System.Drawing.Size(131, 21);
+            this.txtinitbr.Size = new System.Drawing.Size(145, 21);
             this.txtinitbr.TabIndex = 5;
             // 
             // txtinitcontrast
             // 
             this.txtinitcontrast.Location = new System.Drawing.Point(162, 213);
             this.txtinitcontrast.Name = "txtinitcontrast";
-            this.txtinitcontrast.Size = new System.Drawing.Size(131, 21);
+            this.txtinitcontrast.Size = new System.Drawing.Size(144, 21);
             this.txtinitcontrast.TabIndex = 6;
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(303, 38);
+            this.button1.Location = new System.Drawing.Point(313, 38);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(62, 19);
             this.button1.TabIndex = 7;
@@ -219,7 +221,7 @@
             // 
             this.txtMag.Location = new System.Drawing.Point(162, 143);
             this.txtMag.Name = "txtMag";
-            this.txtMag.Size = new System.Drawing.Size(131, 21);
+            this.txtMag.Size = new System.Drawing.Size(144, 21);
             this.txtMag.TabIndex = 14;
             // 
             // label6
@@ -233,7 +235,7 @@
             // 
             // button4
             // 
-            this.button4.Location = new System.Drawing.Point(304, 85);
+            this.button4.Location = new System.Drawing.Point(313, 79);
             this.button4.Name = "button4";
             this.button4.Size = new System.Drawing.Size(60, 21);
             this.button4.TabIndex = 16;
@@ -243,7 +245,7 @@
             // 
             // button5
             // 
-            this.button5.Location = new System.Drawing.Point(303, 192);
+            this.button5.Location = new System.Drawing.Point(315, 192);
             this.button5.Name = "button5";
             this.button5.Size = new System.Drawing.Size(60, 21);
             this.button5.TabIndex = 17;
@@ -253,7 +255,7 @@
             // 
             // button6
             // 
-            this.button6.Location = new System.Drawing.Point(369, 192);
+            this.button6.Location = new System.Drawing.Point(381, 191);
             this.button6.Name = "button6";
             this.button6.Size = new System.Drawing.Size(57, 22);
             this.button6.TabIndex = 18;
@@ -263,7 +265,7 @@
             // 
             // button7
             // 
-            this.button7.Location = new System.Drawing.Point(369, 38);
+            this.button7.Location = new System.Drawing.Point(381, 38);
             this.button7.Name = "button7";
             this.button7.Size = new System.Drawing.Size(57, 19);
             this.button7.TabIndex = 19;
@@ -333,11 +335,29 @@
             this.radiobtnEveryPeriod.Text = "Every Period";
             this.radiobtnEveryPeriod.UseVisualStyleBackColor = true;
             // 
+            // txtWD
+            // 
+            this.txtWD.Location = new System.Drawing.Point(271, 38);
+            this.txtWD.Name = "txtWD";
+            this.txtWD.Size = new System.Drawing.Size(35, 21);
+            this.txtWD.TabIndex = 22;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(242, 41);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(23, 12);
+            this.label8.TabIndex = 23;
+            this.label8.Text = "WD:";
+            // 
             // frmBCRegulate
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(494, 492);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.txtWD);
             this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.button8);
             this.Controls.Add(this.button7);
@@ -404,5 +424,7 @@
         private System.Windows.Forms.RadioButton radiobtnEverySample;
         private System.Windows.Forms.RadioButton radiobtnEveryPeriod;
         private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.TextBox txtWD;
+        private System.Windows.Forms.Label label8;
     }
 }

+ 9 - 2
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/frmBCRegulate.cs

@@ -22,6 +22,7 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
         public double initialBrightness;
         public double initialContrast;
         public int mag = 100; //放大倍数    
+        public double workingDistance = 10.0;
         public AutoRegulateType autoregulateType = AutoRegulateType.EveryPeriod; //自动调节类型
         public int period = 60; //minutes to run the regulation
         public CMeasure m_measureobj;
@@ -71,6 +72,7 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
             radiobtnEveryPeriod.Checked = autoregulateType == AutoRegulateType.EveryPeriod;
             radiobtnEverySample.Checked = autoregulateType == AutoRegulateType.EverySample;
             txtperiod.Text = period.ToString();
+            txtWD.Text = workingDistance.ToString("F2");    
             EnableAutoBC.Checked = isToRun;
         }
 
@@ -82,7 +84,10 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
             semController.GetSemPositionXY(ref x, ref y, ref r);
             stageData.ConvertSEMToOTSCoord( new Point((int)x, (int)y),ref stdPos);
             txtstdpos.Text = stdPos.ToString();
-           
+            double wd = 10;
+            semController.GetWorkingDistance(ref wd);
+            txtWD.Text =wd.ToString("F2"); 
+
         }
 
         private void button2_Click(object sender, EventArgs e)
@@ -120,6 +125,7 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
             param.toRun = EnableAutoBC.Checked;
             param.period= txtperiod.Text == "" ? 60 : int.Parse(txtperiod.Text);    
             param.autoRegulateType =radiobtnEveryPeriod.Checked ? AutoRegulateType.EveryPeriod : AutoRegulateType.EverySample;
+            param.workingDistance = double.Parse( txtWD.Text);  
             m_measureobj.m_pMeasureParam.GetDefaultParam().BrightnessContrastRegulationParam = param;
             Close();
         }
@@ -153,7 +159,8 @@ namespace OTSMeasureApp._5_OTSMeasureStatuImageFun
         private void button7_Click(object sender, EventArgs e)
         {
             CBrightnessContrastAdjust regulater = new CBrightnessContrastAdjust(m_measureobj);
-            regulater.MoveSEMToPoint(new PointF(stdPos.X, stdPos.Y));   
+            regulater.MoveSEMToPoint(new PointF(stdPos.X, stdPos.Y));
+            regulater.SetWorkingDistance(Convert.ToDouble(txtWD.Text));
         }
 
         private void button8_Click(object sender, EventArgs e)

+ 1 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/ImageAccess/FieldImage.cs

@@ -20,7 +20,7 @@ namespace OTSIncAReportApp._3_ServiceCenter.DataOperation.DataAccess
         /// 拼接颗粒黑白图
         /// </summary>
         /// <param name="sub">拼接字符串</param>
-        /// <param name="xs">xs = pixw / ScanFieldSize</param>
+        /// <param name="xs">xs =1/ pixw </param>
         /// <param name="path">报告文件路径</param>
         /// <param name="picHeight">图像高</param>
         /// <param name="picWidth">帧图宽</param>

File diff ditekan karena terlalu besar
+ 60 - 62
OTSVIPDoc/OTS安装培训-确认模板.docx


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini