ソースを参照

refine the cleanness_nd lib. add some comments

gsp 11 ヶ月 前
コミット
6e01b73251

+ 2 - 2
Bin/x64/Debug/Config/ReportTemplate/Inca_Template/ReportTemplateConfig.xml

@@ -122,11 +122,11 @@
     <str_kllb_qcys>C</str_kllb_qcys>
     <str_kllb_DeleteClass>misc</str_kllb_DeleteClass>
     <list_str_kllb_DeleteClass>
-      <YS0>SiC</YS0>
     </list_str_kllb_DeleteClass>
     <list_int_kllb_number>18</list_int_kllb_number>
     <list_str_kllb_DeleteClass_Serial>
-      <YS0>20001</YS0>
+      <YS0>10002</YS0>
+      <YS1>20001</YS1>
     </list_str_kllb_DeleteClass_Serial>
   </M_KLLBXX>
   <M_address>

+ 3 - 5
Bin/x64/Debug/Config/ReportTemplate/TCleannessA_Template/ReportTemplateConfig.xml

@@ -12,8 +12,7 @@
     <str_xzkl>全部颗粒</str_xzkl>
     <int_xzkl>0</int_xzkl>
     <LOGName>ReportIdentification.bmp</LOGName>
-    <StandardLibraryName>
-    </StandardLibraryName>
+    <StandardLibraryName>OTSCleanlinessSTD1.db</StandardLibraryName>
   </M_SY>
   <M_YMYJ>
     <str_tb_ymwb>锂电异物分析报告</str_tb_ymwb>
@@ -137,10 +136,9 @@
   <whole>
     <list_str_MainPriority>System.Collections.Generic.List`1[System.String]</list_str_MainPriority>
     <list_str_SecondaryPriority>System.Collections.Generic.List`1[System.String]<YS0>Nialloy</YS0><YS1>Fe-O</YS1><YS2>Fe-Cr</YS2><YS3>Fe-alloy</YS3></list_str_SecondaryPriority>
-    <str_MainPriority>
-    </str_MainPriority>
+    <str_MainPriority>Corundum Al2O3 , Corundum Al2O3 , Al Alloy Si&lt;5 , Zr , Al Alloy Si&lt;5 , Al Alloy Si&gt;5 , Mineral Blasting , F Rich, PTFE , Other Particles , Other Particles , Non-Ferrous Metals , SiO2 , Si/Si-C/Si-N , Mineral Fibre , Mineral Si-Al-O , Mineral Si-Al-Ca-O , Mineral Si-Al-K-O , Talc Si-Mg-(Al)-O , Calcium Carbonate , Calcium Compounds , Mineral With Na , Other Mineral , Mineral With Na , Other Mineral , Iron Rich , Steel , Steel , Low-Alloy St. Other , Low-Mn Steel , Low-Cr Steel , Low-Mn Steel , Low-Alloy St. Other , Ferrous Blasting , High-Alloy Steel , Coating Mn-P , Coating Cr , Coating Zn-Cr , Coating Zn-Ni , Coating Zn , Coating Zn-P , Ferrous Blasting , Iron Rich , Coating V , Brass Cu-Zn , Bronze Cu-Sn , Titanium , Non-Ferrous Metals , Cl Rich, PVC , Salts , Cl Rich, PVC , Cl Rich, PVC , Salts , Lubricants Mo/Ba-S , Calcium Carbonate , Al Alloy Si&gt;5 , Al Alloy Si&lt;5 , Salts , Mineral Si-Al-Ca-O , Mineral with Na , Other Mineral , Coating Zn-Cr , Coating Zn , Coating Zn-P , F Rich, PTFE , Lubricants Mo/Ba-S , Other Particles , Other Particles</str_MainPriority>
     <str_SecondaryPriority>Nialloy,Fe-O,Fe-Cr,Fe-alloy</str_SecondaryPriority>
-    <list_str_MainPriority_Serial>System.Collections.Generic.List`1[System.String]</list_str_MainPriority_Serial>
+    <list_str_MainPriority_Serial>System.Collections.Generic.List`1[System.String]<YS0>40001</YS0><YS1>40002</YS1><YS2>40003</YS2><YS3>40004</YS3><YS4>40005</YS4><YS5>40006</YS5><YS6>40007</YS6><YS7>40008</YS7><YS8>40009</YS8><YS9>40010</YS9><YS10>40011</YS10><YS11>40012</YS11><YS12>40013</YS12><YS13>40014</YS13><YS14>40015</YS14><YS15>40016</YS15><YS16>40017</YS16><YS17>40018</YS17><YS18>40019</YS18><YS19>40020</YS19><YS20>40021</YS20><YS21>40022</YS21><YS22>40023</YS22><YS23>40024</YS23><YS24>40025</YS24><YS25>40026</YS25><YS26>40027</YS26><YS27>40028</YS27><YS28>40029</YS28><YS29>40030</YS29><YS30>40031</YS30><YS31>40032</YS31><YS32>40033</YS32><YS33>40034</YS33><YS34>40035</YS34><YS35>40036</YS35><YS36>40037</YS36><YS37>40038</YS37><YS38>40039</YS38><YS39>40040</YS39><YS40>40041</YS40><YS41>40042</YS41><YS42>40043</YS42><YS43>40044</YS43><YS44>40045</YS44><YS45>40046</YS45><YS46>40047</YS46><YS47>40048</YS47><YS48>40049</YS48><YS49>40050</YS49><YS50>40051</YS50><YS51>40052</YS51><YS52>40053</YS52><YS53>40054</YS53><YS54>40055</YS54><YS55>40056</YS55><YS56>40057</YS56><YS57>40058</YS57><YS58>40059</YS58><YS59>40060</YS59><YS60>40061</YS60><YS61>40062</YS61><YS62>40063</YS62><YS63>40064</YS63><YS64>40065</YS64><YS65>40066</YS65><YS66>40067</YS66></list_str_MainPriority_Serial>
   </whole>
   <M_DZ>
     <Notes>

BIN
Bin/x64/Debug/Config/SysData/Cleanness_ND.db


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

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData RunMode="ProfessionalMode" SysType="IncA">
+<XMLData RunMode="ProfessionalMode" SysType="TCCleannessA">
   <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="NoSTDDB" SteelTechnology="0" UseSysSTD="true" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="0:AUTO" MatrixStep="50" OverlapParam="0" ParticleSelectionCondition="">
     <Member RegName="BGGray" end="255" start="80" />

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

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData systype="IncA">
+<XMLData systype="TCCleannessA">
   <Member RegName="Scale" strValue="1000" />
   <Member RegName="DefaultComputedColName" strValue="Area,EquivalentCircleDiameter,MaxDiameter,MinDiameter,DiameterRatio,FerretDiameter,PERP,PERI,INSCR,MEAN,ELONG,ASPECT_ELONG,Orientation" />
   <Member RegName="ElementsColName" strValue="C,O,Al,Fe,F,Ti,Na,Mn,Mg" />
-  <Member RegName="PartSizeFile" name="lj.psf" />
+  <Member RegName="PartSizeFile" name="ljNuw.psf" />
   <Member RegName="TRIO_CHART_TYPE" strValue="CaO.SiO₂.Al₂O₃" />
   <Member RegName="SIZE_CAL_METHOD_TYPE" strValue="DMAX" />
 </XMLData>

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/ResourceForMeasureSourceGrid-ZH.xml

@@ -433,7 +433,7 @@
         <member itemKey="12321" itemName="" itemText="空"/>
         <member itemKey="12322" itemName="" itemText="设定错误,没有获取SEM数据"/>
         <member itemKey="12323" itemName="" itemText="设定警示,测量区域超出样品孔"/>
-        <member itemKey="12324" itemName="" itemText="设定警示,设定的分辨率太低,请修改像素尺寸为颗粒直径最小值的一半以下"/>
+        <member itemKey="12324" itemName="" itemText="设定警示,设定的分辨率太低,请修改像素尺寸为颗粒直径最小值的一半以下,或修改颗粒最小尺寸为像素尺寸的2倍以上"/>
         <member itemKey="12325" itemName="" itemText="测量完成"/>
         <member itemKey="12326" itemName="" itemText="设定完好"/>
         <member itemKey="12327" itemName="" itemText="设定错误,工作文件未保存"/>

+ 1 - 1
Bin/x64/Debug/Version.txt

@@ -1,7 +1,7 @@
 =====================================
 update history
 ------OTS3.2 2024-12
-优化测量程序测量流程多样品操作更加流
+优化测量程序测量流程多样品操作更加流
 优化测量在运行中的稳定性,更好的支持各种电镜运行情况
 优化报告程序优化三元图的显示,让每个粒级之间更加好区分(以形状和颜色区分)
 优化报告程序图形显示模块,让图表显示更加简洁流畅

+ 15 - 21
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -195,7 +195,7 @@ namespace OTSModelSharp
 
             }
 
-            //long nBrukerDwellTime = OTSDataType.otsdataconst.DWELLTIME_BRUKER_VALUES[DwellTimeId];
+          
 
 
             if (!pScanController.Init())
@@ -564,12 +564,12 @@ namespace OTSModelSharp
         private bool GetSEMDataGnrFromHw(ref CSEMDataGnr SemDataGnr)
         {
             double kv = 0, brightness = 0, contrast = 0;
-          
-                var hw = SemController.GetSEMController();
-                hw.GetSemHighTension(ref kv);
-                hw.GetSemBrightness(ref brightness);
-                hw.GetSemContrast(ref contrast);
-           
+
+            var hw = SemController.GetSEMController();
+            hw.GetSemHighTension(ref kv);
+            hw.GetSemBrightness(ref brightness);
+            hw.GetSemContrast(ref contrast);
+
 
             SemDataGnr.SetValue(kv, brightness, contrast);
             return true;
@@ -611,30 +611,24 @@ namespace OTSModelSharp
 
                     return;
                 }
+                var pSEMDataGnr = new CSEMDataGnr();
+                log.Info("Get Kv, Brightness and Contrast!");
+                GetSEMDataGnrFromHw(ref pSEMDataGnr);
 
 
-
-                //var pSEMDataUsing = new CSEMDataGnr();
-                //log.Info("Get Kv, Brightness and Contrast!");
-                //GetSEMDataGnrFromHw(ref pSEMDataUsing);
-
-
-                //m_pSampleRstFile.SetSEMGnr(pSEMDataUsing);
+                m_pSampleRstFile.SetSEMDataGnr(pSEMDataGnr);
 
                 // record SEM data
                 COTSMsrPrjResultData pProjMgrFile = m_pMsrThread.GetProjResultData();
+                CSEMStageData pSEMStageData = pProjMgrFile.GetSEMStageData();
 
 
-                //CSEMStageData pSEMStageData = pProjMgrFile.GetSEMStageData();
-
-
-                //m_pSampleRstFile.SetSEMStageData(pSEMStageData);
+                m_pSampleRstFile.SetSEMStageData(pSEMStageData);
 
-                // record stage
-                //CStage pStage = pProjMgrFile.GetStage();
+                CStage pStage = pProjMgrFile.GetStage();
 
 
-                //m_pSampleRstFile.SetSEMStage(pStage);
+                m_pSampleRstFile.SetSEMStage(pStage);
 
 
                 //-----save the static measure result file data into xml file and the dynamic data of every field will be saved into sqlite database

+ 76 - 76
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CSmplMsrResult.cs

@@ -50,11 +50,11 @@ namespace OTSModelSharp
         // file version string
         string m_strFileVersion;
         // SEM sample stage
-        //CSEMStageData m_pSEMStageData;
+        CSEMStageData m_pSEMStageData;
         //// sample stage
-        //CStage m_pStage;
-      
-        //CSEMDataGnr m_pSEMData;
+        CStage m_pStage;
+
+        CSEMDataGnr m_pSEMData;
         // sample setting
         COTSSample m_pSample;
         // switch
@@ -90,13 +90,13 @@ namespace OTSModelSharp
         {
         
             m_strFileVersion = ("");
-      
-            //m_pSEMStageData = new CSEMStageData();
-           
-            //m_pStage = new CStage();
- 
-            //m_pSEMData = new CSEMDataGnr();
-      
+
+            m_pSEMStageData = new CSEMStageData();
+
+            m_pStage = new CStage();
+
+            m_pSEMData = new CSEMDataGnr();
+
             m_bSwitch = false;
            
 
@@ -126,43 +126,43 @@ namespace OTSModelSharp
             m_pSample = a_pSample;
 
         }
-        //public CSEMStageData GetSEMStageData()
-        //{
-        //    return m_pSEMStageData;
-        //}
-        //public void SetSEMStageData(CSEMStageData a_pSEMStageData)
-        //{
-         
-        //    m_pSEMStageData = a_pSEMStageData;
-        //}
+        public CSEMStageData GetSEMStageData()
+        {
+            return m_pSEMStageData;
+        }
+        public void SetSEMStageData(CSEMStageData a_pSEMStageData)
+        {
+
+            m_pSEMStageData = a_pSEMStageData;
+        }
         //// sample stage
-        //public CStage GetStage()
-        //{
-        //    return m_pStage;
-        //}
-        //public void SetStage(CStage a_pStage)
-        //{
-        //    if (a_pStage != null)
-        //    {
-        //        return;
-        //    }
-        //    m_pStage = a_pStage;
-        //}
+        public CStage GetStage()
+        {
+            return m_pStage;
+        }
+        public void SetStage(CStage a_pStage)
+        {
+            if (a_pStage != null)
+            {
+                return;
+            }
+            m_pStage = a_pStage;
+        }
         //// SEM condition
-        //public CSEMDataGnr GetSEMStage()
-        //{
-        //    return m_pSEMData;
-        //}
-        //public void SetSEMStage(CSEMDataGnr a_pSEMData)
-        //{
-        //    if (a_pSEMData != null)
-        //    {
-        //        return;
-        //    }
-        //    m_pSEMData = a_pSEMData;
-        //}
+        public CSEMDataGnr GetSEMStage()
+        {
+            return m_pSEMData;
+        }
+        public void SetSEMStage(CSEMDataGnr a_pSEMData)
+        {
+            if (a_pSEMData != null)
+            {
+                return;
+            }
+            m_pSEMData = a_pSEMData;
+        }
+
 
- 
 
 
         public void Serialize(bool isStoring, XmlDocument classDoc, XmlNode rootNode)
@@ -175,9 +175,9 @@ namespace OTSModelSharp
             slo.Register("FileMark", xnFileMark);
             slo.Register("Version", xnVersion);
             slo.Register("Switch", xbSwitch);
-            //slo.Register("SEMStageData", m_pSEMStageData);
-            //slo.Register("Stage", m_pStage);
-            //slo.Register("SEMData", m_pSEMData);
+            slo.Register("SEMStageData", m_pSEMStageData);
+            slo.Register("Stage", m_pStage);
+            slo.Register("SEMData", m_pSEMData);
             slo.Register("Sample", m_pSample);
             //slo.Register("Fields", xfields);
             if (isStoring)
@@ -315,33 +315,33 @@ namespace OTSModelSharp
             return m_strParticleImageFolder;
 
         }
-       
-       
-        //public void SetSEMGnr(CSEMDataGnr a_pSEMGnr)
-        //{
-         
-        //    if (a_pSEMGnr == null)
-        //    {
-        //        logger.Info("input a invalid SEM general data pointer.");
-        //        return;
-        //    }
-
-
-        //   m_pSEMData= a_pSEMGnr;
-        //}
-
-        //public void SetSEMStage(CStage a_pStage)
-        //{
-        //    //ASSERT(a_pStage);
-        //    if (a_pStage == null)
-        //    {
-        //        logger.Info("input a invalid stage pointer.");
-        //        return;
-        //    }
-      
-        //    m_pStage= a_pStage;
-        //}
-       
-      
+
+
+        public void SetSEMDataGnr(CSEMDataGnr a_pSEMGnr)
+        {
+
+            if (a_pSEMGnr == null)
+            {
+                logger.Info("input a invalid SEM general data pointer.");
+                return;
+            }
+
+
+            m_pSEMData = a_pSEMGnr;
+        }
+
+        public void SetSEMStage(CStage a_pStage)
+        {
+            //ASSERT(a_pStage);
+            if (a_pStage == null)
+            {
+                logger.Info("input a invalid stage pointer.");
+                return;
+            }
+
+            m_pStage = a_pStage;
+        }
+
+
     }
 }

+ 1 - 1
OTSIncAMeasureApp/10-OTSSplashScreen/OTSSplashScreen_Cleanness.Designer.cs

@@ -66,7 +66,7 @@ namespace OTSMeasureApp._10_OTSSplashScreen
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(139, 20);
             this.label3.TabIndex = 6;
-            this.label3.Text = "Version : 3.1";
+            this.label3.Text = "Version : 3.2";
             // 
             // richTextBox1
             // 

+ 2 - 2
OTSIncAMeasureApp/10-OTSSplashScreen/OTSSplashScreen_Cleanness.resx

@@ -121,7 +121,7 @@
   <data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAMMAAAC3CAYAAACvzOp9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
-        wwAADsMBx2+oZAAAOrtJREFUeF7tfQd4nNWZbjaAuiW5URKSzQ2BQJLdZFNudrMtm5vsvWmbbLClGY1k
+        wgAADsIBFShKgAAAOrtJREFUeF7tfQd4nNWZbjaAuiW5URKSzQ2BQJLdZFNudrMtm5vsvWmbbLClGY1k
         m246hCRsIKEETEhCAOOq3qsrzVQ3jAslFBuDARsDbtjGsurM/NPe+77nH1kz8sixjY0tdB4/r2c0c/5z
         zv/P937llO98LBaLwcLCIoaPRaNRWFhYRGEtg4VFHJYMFhZxWDJYWMRhyWBhEYclg4VFHJYMFhZxWDJY
         WMRhyWBhEYclg4VFHHYG2sIiDmsZLCzisJbBwiIOaxksLOKwlsHCIg5rGSws4rBksLCIw5LBwiIOSwYL
@@ -378,7 +378,7 @@
   <data name="pictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAALgAAAAlCAYAAADxyyNaAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
-        wwAADsMBx2+oZAAACm1JREFUeF7tnH1sVWcdx6fRLNs/00QHAzVukUYTdTr+WNQtJkvUway4jTG26bZI
+        wgAADsIBFShKgAAACm1JREFUeF7tnH1sVWcdx6fRLNs/00QHAzVukUYTdTr+WNQtJkvUway4jTG26bZI
         kCUucWKWJYoyIhKNTjoGFjZe5KXrygataQeUFTbX0Ta8WTraUaC2hdL2cnvp+nLbe9tejvd3zvO75znn
         fs/7uU3h9pN8k97n/J7fc7h8z7nP2zk3KNPkDfUfXlLmLNqk3Dp/naVmPLBW2Vd3XtS49pk2+HXO2HhK
         uePhjdDMTpp5/ytKT9+wyHRt4tvgD/9ur+HLuOvp7eKIYiinO0bVkevnjnCt0J02pvz/wJq3fLfSPzgq

+ 4 - 1
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.Designer.cs

@@ -179,6 +179,7 @@ namespace OTSMeasureApp
             this.pictureBox1.Size = new System.Drawing.Size(1275, 692);
             this.pictureBox1.TabIndex = 5;
             this.pictureBox1.TabStop = false;
+           
             this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint);
             this.pictureBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
             this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
@@ -207,10 +208,12 @@ namespace OTSMeasureApp
             this.Text = "OTSSamplespaceWindow";
             this.TopMost = true;
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+           
             this.Load += new System.EventHandler(this.OTSSamplespaceWindow_Load);
+           
             this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OTSSamplespaceWindow_KeyDown);
             this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.OTSSamplespaceWindow_KeyUp);
-            this.Resize += new System.EventHandler(this.OTSSamplespaceWindow_Resize);
+           
             this.CMStrip.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             this.ResumeLayout(false);

+ 13 - 13
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -160,7 +160,8 @@ namespace OTSMeasureApp
         //国际化
         OTSCommon.Language lan;
         Hashtable table;
-        public CDisplayGDIObject sampleHoleImageBuffer;
+      public CDisplayGDIObject sampleHoleImageBuffer = new CDisplayGDIObject(new RectangleF(0, 0, 10, 10), GDIType.SampleHoleImageBuffer);
+
         #region 设置双缓冲
         /// <summary>
         /// 设置双缓冲
@@ -919,7 +920,7 @@ namespace OTSMeasureApp
             m_visualSamples = new List<CVisualSampleArea>();
 
 
-            this.ResizeRedraw = true;
+            this.ResizeRedraw = false;
             control_Ruler2 = new Control_Ruler();
             Point rulerLocation = new Point(10, this.Height - (int)(control_Ruler2.Height * 2));
             control_Ruler2.Location = rulerLocation;
@@ -928,8 +929,8 @@ namespace OTSMeasureApp
 
             pictureBox1.BackColor = Color.Transparent;
 
-            sampleHoleImageBuffer = new CDisplayGDIObject(new RectangleF(0, 0, this.Width, this.Height), GDIType.SampleHoleImageBuffer); ;
-            sampleHoleImageBuffer.BSEImage = new Bitmap(this.Width, this.Height);
+            sampleHoleImageBuffer = new CDisplayGDIObject(new RectangleF(0, 0, m_MeasureAppForm.Width, m_MeasureAppForm.Height), GDIType.SampleHoleImageBuffer); ;
+            sampleHoleImageBuffer.BSEImage = new Bitmap(m_MeasureAppForm.Width, m_MeasureAppForm.Height);//the m_measureAppForm.Width and Height is large enough to contain the BSE image and not changed.
 
 
         }
@@ -2161,7 +2162,7 @@ namespace OTSMeasureApp
             {
                 Image thumbnail = img.BSEImage.GetThumbnailImage((int)m_RegionF.Width + 2, (int)m_RegionF.Height + 2, null, IntPtr.Zero);
                 var g = Graphics.FromImage(sampleHoleImageBuffer.BSEImage);
-                log.Warn(startPointF);
+              
                 g.DrawImage(thumbnail, startPointF);
             }
 
@@ -2178,7 +2179,11 @@ namespace OTSMeasureApp
             if (IsShowSampleHoleImage)
             {
                 //e.Graphics.DrawImage(sampleHoleImageBuffer.BSEImage, sampleHoleImageBuffer.GetOrigionalDrawRegionF());
-                e.Graphics.DrawImage(sampleHoleImageBuffer.BSEImage, sampleHoleImageBuffer.GetZoomedRegionF());
+                if (sampleHoleImageBuffer.BSEImage != null)
+                {
+                    e.Graphics.DrawImage(sampleHoleImageBuffer.BSEImage, sampleHoleImageBuffer.GetZoomedRegionF());
+                }
+                    
 
             }
 
@@ -3198,7 +3203,6 @@ namespace OTSMeasureApp
 
 
             m_visualStage.FrameOfHoleGDIObjects.Clear();
-            //sampleHoleImageBuffer = new CDisplayGDIObject(new RectangleF(0, 0, this.Width, this.Height), CreateRectangleType.SampleHoleImageBuffer); ;
             var w = sampleHoleImageBuffer.BSEImage.Width;
             var h = sampleHoleImageBuffer.BSEImage.Height;
             sampleHoleImageBuffer.BSEImage = new Bitmap(w, h);
@@ -3269,11 +3273,7 @@ namespace OTSMeasureApp
             this.OnMouseMove(e);
         }
 
-        private void OTSSamplespaceWindow_Resize(object sender, EventArgs e)
-        {
-            sampleHoleImageBuffer = new CDisplayGDIObject(new RectangleF(0, 0, this.Width, this.Height), GDIType.SampleHoleImageBuffer); ;
-            sampleHoleImageBuffer.BSEImage = new Bitmap(this.Width, this.Height);
-
-        }
+      
     }
 }
+

+ 1 - 0
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -216,6 +216,7 @@
   <ItemGroup>
     <Reference Include="FEIApiControl">
       <HintPath>..\OpenDll\FEIAPI\FEIApiControl.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>

+ 42 - 49
OTSIncAMeasureApp/ServiceCenter/CPP(Bruker)API/ScanController.cs

@@ -2,16 +2,8 @@
 using FEIApiControl;
 
 using OTSCLRINTERFACE;
-
-using OTSDataType;
 using OTSMeasureApp.ServiceCenter;
-using System;
-using System.Collections.Generic;
 using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
 using static OxfordExtenderWrapper.ExtenderIpcUI;
 
 namespace OTSModelSharp.ServiceCenter
@@ -19,12 +11,12 @@ namespace OTSModelSharp.ServiceCenter
     public class ScanController : IScanController
     {
         private OTSCLRINTERFACE.COTSControlFunExport scan;
-        static IScanController scanctrl=null;
+        static IScanController scanctrl = null;
         public static APIClass ApiClass = null;
-      
+
         int imageWidth = 0;
         int imageHeight = 0;
-        public  static IScanController GetScanController()
+        public static IScanController GetScanController()
         {
             var semtype = FileHelper.GetXMLInformations("SemControllerName");
             if (scanctrl == null)
@@ -45,42 +37,43 @@ namespace OTSModelSharp.ServiceCenter
                     {
                         imageSrcType = ImageInputSourceType.Bse;
                     }
-                    
+
                     scanctrl = new OxfordScanController(imageSrcType);
                 }
-                else 
-                { 
-                    scanctrl = new ScanController(semtype); 
+                else
+                {
+                    scanctrl = new ScanController(semtype);
                 }
-           
-                
+
+
             }
             return scanctrl;
         }
         private ScanController(string devicetype)
         {
-           
-                this.scan = OTSCLRINTERFACE.COTSControlFunExport.GetControllerInstance(devicetype);
+
+            this.scan = OTSCLRINTERFACE.COTSControlFunExport.GetControllerInstance(devicetype);
 
         }
 
         public CBSEImgClr AcquireBSEImage()
         {
 
-                if (!scan.IsConnected())
-                {
-                    return null;
-                }
+            if (!scan.IsConnected())
+            {
+                return null;
+            }
+
+            Rectangle r = new Rectangle();
+            CBSEImgClr bse = new CBSEImgClr(r);
+            NLog.LogManager.GetCurrentClassLogger().Info("Bruker:Begin to acquire BSE image!");
+            if (!scan.AcquireBSEImage(ref bse))
+            {
+                return null;
+            }
+            NLog.LogManager.GetCurrentClassLogger().Info("Bruker:End acquiring BSE image!");
+            return bse;
 
-                Rectangle r = new Rectangle();
-                CBSEImgClr bse = new CBSEImgClr(r);
-                if (!scan.AcquireBSEImage( ref bse))
-                {
-                    return null;
-                }
-               
-                return bse;
-           
         }
 
         public bool Init()
@@ -90,12 +83,12 @@ namespace OTSModelSharp.ServiceCenter
                 scan.ConncetSem();
             }
             return scan.ScanInit();
-            
+
         }
 
         public bool SetDwellTime(DwellTimeLevel val)
         {
-            double dwelltime=2;
+            double dwelltime = 2;
             switch (val)
             {
                 case DwellTimeLevel.Low:
@@ -111,29 +104,29 @@ namespace OTSModelSharp.ServiceCenter
 
 
             }
-                if (!scan.IsConnected())
-                {
-                    return false;
-                }
+            if (!scan.IsConnected())
+            {
+                return false;
+            }
+
+            return scan.SetDwellTime((int)dwelltime);
 
-                return scan.SetDwellTime((int)dwelltime);
-           
         }
 
-        public bool SetImageSize(int width,int height)
+        public bool SetImageSize(int width, int height)
         {
             imageWidth = width;
             imageHeight = height;
-       
-                if (!scan.IsConnected())
-                {
-                    return false;
-                }
-                return scan.SetImageSize(width, height);
-            
+
+            if (!scan.IsConnected())
+            {
+                return false;
+            }
+            return scan.SetImageSize(width, height);
+
         }
 
-        public CBSEImgClr AcquireRectangleBSEImage( Rectangle rec)
+        public CBSEImgClr AcquireRectangleBSEImage(Rectangle rec)
         {
             return null;
         }

+ 2 - 0
OTSIncAMeasureApp/ServiceCenter/FEIAutoScript/FEIScanController.cs

@@ -26,10 +26,12 @@ namespace OTSMeasureApp.ServiceCenter
             CBSEImgClr bse = new CBSEImgClr(r);
             bse.InitImageData(imageWidth, imageHeight);
             byte[] imgData = new byte[imageWidth * imageHeight];
+            NLog.LogManager.GetCurrentClassLogger().Info("FEI:Begin to acquire BSE image!");
             if (!ApiClass.RunAcquireImage(imageWidth, imageHeight, dwelltime, "", ref imgData))
             {
                 return null;
             }
+            NLog.LogManager.GetCurrentClassLogger().Info("FEI:End acquiring BSE image!");
             bse.SetImageData(imgData, imageWidth, imageHeight);
 
             return bse;

+ 2 - 2
OTSIncAMeasureApp/ServiceCenter/OxfordExtender/OxfordScanController.cs

@@ -41,9 +41,9 @@ namespace OTSMeasureApp.ServiceCenter
                 p.DwellTime = dwelltime;
                 p.sourceType = imagesourceType;
 
-                NLog.LogManager.GetCurrentClassLogger().Info("Begin to acquire BSE image!");
+                NLog.LogManager.GetCurrentClassLogger().Info("oxford:Begin to acquire BSE image!");
                 iExtender.AquisitionImage(ref p);
-                NLog.LogManager.GetCurrentClassLogger().Info("End acquiring BSE image!");
+                NLog.LogManager.GetCurrentClassLogger().Info("oxford:End acquiring BSE image!");
                 bse.SetImageData(p.ImageData, imageWidth, imageHeight);
 
                 return bse;

+ 7 - 7
OTSIncAReportApp/2-CommonFunction/OTSRstMgrFunction/ResultFile.cs

@@ -106,28 +106,28 @@ namespace OTSIncAReportApp.OTSRstMgrFunction
         }
         public int GetXAxisStart()
         {
-            Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
+            //Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
             int xStart = Convert.ToInt32(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["SEMStageData"])["Members"])["XAxis"])["start"]);
             int xEnd = Convert.ToInt32(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["SEMStageData"])["Members"])["XAxis"])["end"]);
             return xStart;
         }
         public int GetXAxisEnd()
         {
-            Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
+            //Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
 
             int xEnd = Convert.ToInt32(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["SEMStageData"])["Members"])["XAxis"])["end"]);
             return xEnd;
         }
         public int GetYAxisStart()
         {
-            Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
+            //Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
 
             int yStart = Convert.ToInt32(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["SEMStageData"])["Members"])["YAxis"])["start"]);
             return yStart;
         }
         public int GetYAxisEnd()
         {
-            Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
+            //Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
 
             int yEnd = Convert.ToInt32(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["SEMStageData"])["Members"])["YAxis"])["end"]);
             return yEnd;
@@ -146,12 +146,12 @@ namespace OTSIncAReportApp.OTSRstMgrFunction
             Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["Sample"])["Members"]);
             Dictionary<string, object> imageScanParam = (Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)sampleMembers["MsrParams"])["Members"])["ImageScanParam"];
             Dictionary<string, object> SEMDataMsr = (Dictionary<string, object>)sampleMembers["SEMDataMsr"];
-            Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
+          
            
             string ImageResolution = imageScanParam["ImageResolution"].ToString();
             int width = int.Parse(ImageResolution.Split('_')[1]);
             return width;
-            //int height = int.Parse(ImageResolution.Split('_')[2]);
+           
         }
         public int GetImageHeight()
         {
@@ -171,7 +171,7 @@ namespace OTSIncAReportApp.OTSRstMgrFunction
             Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["Sample"])["Members"]);
             Dictionary<string, object> imageScanParam = (Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)sampleMembers["MsrParams"])["Members"])["ImageScanParam"];
             Dictionary<string, object> SEMDataMsr = (Dictionary<string, object>)sampleMembers["SEMDataMsr"];
-            Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
+          
             float ScanFieldSizeX = float.Parse(SEMDataMsr["ScanFieldSize"].ToString());
            
             string ImageResolution = imageScanParam["ImageResolution"].ToString();