Sfoglia il codice sorgente

improve the cleanliness system logic. Remove the particle gray filter feature.

gsp 3 anni fa
parent
commit
89772cb5e4

+ 13 - 13
OTSIncAMeasureApp/0-OTSModel/Measure/1-OTSInclution/SmplMeasureInclution.cs

@@ -33,11 +33,11 @@ namespace OTSModelSharp
             nNewFieldId = m_pSampleRstFile.GetIdForANewField();
 
             // create a field
-            curFldData = new CFieldDataIncA(a_pBSEImg, m_pSample.CalculatePixelSize());
+            curFldData = new CFieldDataIncA(a_pBSEImg, m_Sample.CalculatePixelSize());
             curFldData.SetId(nNewFieldId);
             curFldData.SetPosition(fldCenter);
             //first step:remove background of the bse image and compound all the finded particles.
-            COTSXRayParam pXRayParam = m_pSample.GetMsrParams().GetXRayParam();
+            COTSXRayParam pXRayParam = m_Sample.GetMsrParams().GetXRayParam();
             loger.Info("Begin to process image and get all particles!");
             if (!GetOriginalParticles())
             {
@@ -74,7 +74,7 @@ namespace OTSModelSharp
           
 
             // save field files
-            m_pSample.GetMsrStatus().SetStatus(OTS_MSR_SAMPLE_STATUS.SUCCESSED);
+            m_Sample.GetMsrStatus().SetStatus(OTS_MSR_SAMPLE_STATUS.SUCCESSED);
 
             StartSaveFileThread(curFldData);
 
@@ -135,9 +135,9 @@ namespace OTSModelSharp
         {
             // remove over sized particles, too small particles and get a analysis particles list
             // get pixel size
-            double dPixelSize = m_pSample.CalculatePixelSize();        
+            double dPixelSize = m_Sample.CalculatePixelSize();        
          
-            CSampleParam pMsrParam = m_pSample.GetMsrParams();
+            CSampleParam pMsrParam = m_Sample.GetMsrParams();
             COTSImageProcParam pImgProcessParam = pMsrParam.GetImageProcessParam();
             curFldData.FilterParticles(pImgProcessParam, dPixelSize );
 
@@ -165,19 +165,19 @@ namespace OTSModelSharp
         public bool CollectParticlesXrayData()
         {
             // get x-ray parameters
-            COTSXRayParam pXRayParam = m_pSample.GetMsrParams().GetXRayParam();
+            COTSXRayParam pXRayParam = m_Sample.GetMsrParams().GetXRayParam();
 
 
 
             var listAnalysisparts = curFldData.ListAnalysisParticles;
 
-            var pStatus = m_pSample.GetMsrStatus();
+            var pStatus = m_Sample.GetMsrStatus();
          
             ////=============================================
             curFldData.CreateXrayList(listAnalysisparts); 
 
           
-            var xraymode = m_pSample.GetMsrParams().GetXRayParam().GetScanMode();
+            var xraymode = m_Sample.GetMsrParams().GetXRayParam().GetScanMode();
 
             // get x-ray list (analysis) by particle features
           uint  nXRayAQTime = (uint)pXRayParam.GetMidAnalyAQTime();
@@ -223,7 +223,7 @@ namespace OTSModelSharp
                 // go through all analysis particles
                 for (int i = 0; i < nSize; ++i)
                 {
-                    string libname = m_pSample.GetMsrParams().GetSTDName();
+                    string libname = m_Sample.GetMsrParams().GetSTDName();
                     ClassifyIncAParticle(quantifyparts[i], libname);
                 }
                
@@ -239,9 +239,9 @@ namespace OTSModelSharp
         public bool ClassifyIncAParticle(COTSParticleClr particle, string libname)// classify particles
         {
 
-            int steelTech = (int)m_pSample.GetMsrParams().GetSteelTechnology();
+            int steelTech = (int)m_Sample.GetMsrParams().GetSteelTechnology();
             particle.SetType((int)OTS_PARTCLE_TYPE.NOT_IDENTIFIED);
-            if (m_pSample.IfUsingSysSTD())
+            if (m_Sample.IfUsingSysSTD())
             {
 
                 if (libname != "NoSTDDB")
@@ -278,10 +278,10 @@ namespace OTSModelSharp
         public bool GetOriginalParticles()
         {
             // measure status
-            CMsrSampleStatus pStatus = m_pSample.GetMsrStatus();
+            CMsrSampleStatus pStatus = m_Sample.GetMsrStatus();
 
             // get image process parameter
-            CSampleParam pMsrParam = m_pSample.GetMsrParams();
+            CSampleParam pMsrParam = m_Sample.GetMsrParams();
             COTSImageProcParam pImgProcessParam = pMsrParam.GetImageProcessParam();
 
             // remove BES image background

+ 55 - 51
OTSIncAMeasureApp/0-OTSModel/Measure/2-OTSCleanliness/SmplMeasureCleanliness.cs

@@ -24,12 +24,12 @@ namespace OTSModelSharp
         }
 
         // field image process
-        public override bool FieldImageProcess(Point fldCenter, CBSEImgClr a_pBSEImg)
+        public override bool FieldImageProcess(Point fldCenter, CBSEImgClr a_BSEImg)
         {
             int nNewFieldId;
             nNewFieldId = m_pSampleRstFile.GetIdForANewField();
             //first step:remove background of the bse image and compound all the finded particles.
-            CFieldDataClean curFldDataMgr = new CFieldDataClean( a_pBSEImg,m_pSample.CalculatePixelSize());
+            CFieldDataClean curFldDataMgr = new CFieldDataClean( a_BSEImg,m_Sample.CalculatePixelSize());
             curFldDataMgr.SetId(nNewFieldId);
             curFldDataMgr.SetPosition(fldCenter);
             if (!GetOriginalParticles())
@@ -56,7 +56,7 @@ namespace OTSModelSharp
             //special treatment.
             //ParticleSpecialTreatment();
             loger.Info("Begin to Calculate the image property of every particle!");
-            var analysisparts = curFldDataMgr.ListAnalysisParticles;
+            var analysisparts = curFldDataMgr.ListBigParticles;
             curFldDataMgr.CalParticleImageProp(analysisparts);//calculate particle image property such as feret diameter, DMAX etc.
 
             ClassifyParticles(curFldDataMgr);
@@ -64,7 +64,7 @@ namespace OTSModelSharp
   
 
             // save field files
-            m_pSample.GetMsrStatus() .SetStatus(OTS_MSR_SAMPLE_STATUS.SUCCESSED);
+            m_Sample.GetMsrStatus() .SetStatus(OTS_MSR_SAMPLE_STATUS.SUCCESSED);
 
             StartSaveFileThread(curFldDataMgr);
 
@@ -82,7 +82,7 @@ namespace OTSModelSharp
                 while (fieldQueue.Count() > 0)
                 {
                     CFieldDataClean f = (CFieldDataClean) fieldQueue.Dequeue();
-                    double pixelSize = m_pSample.CalculatePixelSize();
+                    double pixelSize = m_Sample.CalculatePixelSize();
 
           
 
@@ -124,12 +124,12 @@ namespace OTSModelSharp
         {
             // 1)remove over sized particles, too small particles and get a analysis particles list
            
-            double dPixelSize = m_pSample.CalculatePixelSize();
+            double dPixelSize = m_Sample.CalculatePixelSize();
 
 
           
            
-            CSampleParam pMsrParam = m_pSample.GetMsrParams();
+            CSampleParam pMsrParam = m_Sample.GetMsrParams();
             COTSImageProcParam pImgProcessParam = pMsrParam.GetImageProcessParam();
             curFldData.FilterParticles(pImgProcessParam, dPixelSize);
             if (curFldData.NoAnalysisParticle())
@@ -138,7 +138,7 @@ namespace OTSModelSharp
             }
             //2) according to the quantify threshold size value saperate the analysis particles into two group :the bigparticles and the smallparticles.
 
-            int quantifyThreshold = m_pSample.GetMsrParams().GetXRayParam().GetQuantifyMinSize();
+            int quantifyThreshold = m_Sample.GetMsrParams().GetXRayParam().GetQuantifyMinSize();
 
             var smallparts = fld.ListSmallParticles;
             var bigparts = fld.ListBigParticles;
@@ -156,41 +156,44 @@ namespace OTSModelSharp
                 }
             }
             // 3) according to the presettings,make sure we won't do the xray processing work for too many small particles.
-            var fieldParam = m_pSample.GetMsrParams().GetImageScanParam();
-            double smallPartnum;
-             List<COTSParticleClr> smallPartList = new  List<COTSParticleClr>();
-            double percentage = 100;
-            switch (fieldParam.GetFieldStopMode())
-            {
-                case otsdataconst.OTS_MEASURE_FIELD_STOP_MODE.ParticlesPercentage:
-                    percentage = fieldParam.GetFieldSmallParticlesPercentage();
-                    percentage = percentage / 100;// according to the percentage
-                    smallPartnum = smallparts.Count() * percentage;
-                    for (int i = 0; i < smallPartnum; i++)
-                    {
-
-                        smallPartList.Add(smallparts[i]);
-                    }
-                    break;
-                case otsdataconst.OTS_MEASURE_FIELD_STOP_MODE.Particles:
-                    percentage = 1;
-                    smallPartnum = fieldParam.GetFieldSmallParticleNum();//according to the numbers.
-                    if (smallPartnum < smallparts.Count())
-                    {
-                        for (int i = 0; i < smallPartnum; i++)
-                        {
-                            smallPartList.Add(smallparts[i]);
-                        }
-                    }
-                    break;
-                default:
-                    percentage = 1;
-                    smallPartList = smallparts;
-                    break;
-            }
-
-            fld.ListSmallParticles = smallPartList;
-            fld.SmallParticlePercentage=percentage;
+            //var fieldParam = m_Sample.GetMsrParams().GetImageScanParam();
+            //double smallPartnum;
+            // List<COTSParticleClr> smallPartList = new  List<COTSParticleClr>();
+            //double percentage = 100;
+            //switch (fieldParam.GetFieldStopMode())
+            //{
+            //    case otsdataconst.OTS_MEASURE_FIELD_STOP_MODE.ParticlesPercentage:
+            //        percentage = fieldParam.GetFieldSmallParticlesPercentage();
+            //        percentage = percentage / 100;// according to the percentage
+            //        smallPartnum = smallparts.Count() * percentage;
+            //        for (int i = 0; i < smallPartnum; i++)
+            //        {
+
+            //            smallPartList.Add(smallparts[i]);
+            //        }
+            //        break;
+            //    case otsdataconst.OTS_MEASURE_FIELD_STOP_MODE.Particles:
+            //        percentage = 1;
+            //        smallPartnum = fieldParam.GetFieldSmallParticleNum();//according to the numbers.
+            //        if (smallPartnum < smallparts.Count())
+            //        {
+            //            for (int i = 0; i < smallPartnum; i++)
+            //            {
+            //                smallPartList.Add(smallparts[i]);
+            //            }
+            //        }
+            //        break;
+            //    default:
+            //        percentage = 1;
+            //        smallPartList = smallparts;
+            //        break;
+            //}
+
+            fld.ListSmallParticles = smallparts;
+            fld.ListBigParticles = bigparts;
+            //fld.SmallParticlePercentage=percentage;
+            loger.Info("SmallQuantifyParts: " + smallparts.Count);
+            loger.Info("BigQuantifyParts: " + bigparts.Count);
 
             return true;
         }
@@ -198,7 +201,7 @@ namespace OTSModelSharp
         public bool CollectParticlesXrayData(CFieldDataClean fld)
         {
             // get x-ray parameters
-            COTSXRayParam pXRayParam = m_pSample.GetMsrParams ().GetXRayParam();
+            COTSXRayParam pXRayParam = m_Sample.GetMsrParams ().GetXRayParam();
 
             // calculate search x-ray acquire time
             uint nXRayAQTime;
@@ -207,7 +210,7 @@ namespace OTSModelSharp
             var bigparts = fld.ListBigParticles;
 
 
-            var pStatus = m_pSample.GetMsrStatus();
+            var pStatus = m_Sample.GetMsrStatus();
            
          
             //// particle x-ray analysis
@@ -253,7 +256,7 @@ namespace OTSModelSharp
           var  m_ClassifyEngine = new CClassifyEngine();
             for (int i = 0; i < bigparts.Count(); i++)
             {
-                var engine = m_ClassifyEngine.GetParticleEngine(m_pSample.GetMsrParams().GetSTDName());
+                var engine = m_ClassifyEngine.GetParticleEngine(m_Sample.GetMsrParams().GetSTDName());
                 var p = bigparts[i];
                
                 // there will be very less particle satisfied the condition ,so we use only one MaxEDS time,though we set MaxEDSTime for every rule separately .Here we store the last one.
@@ -275,7 +278,7 @@ namespace OTSModelSharp
                 if (!m_EDSHardwareMgr.GetXRayByFeatures(partsMax, edsTime, true))
                 {
                     loger.Error("ImageProcess: call GetXRayByFeatures method for MaxEDS");
-                   m_pSample.GetMsrStatus(). SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
+                   m_Sample.GetMsrStatus(). SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
                     StartSaveFileThread(curFldData);
 
                     return;
@@ -291,7 +294,7 @@ namespace OTSModelSharp
             try
             {
               
-                string libname = m_pSample.GetMsrParams().GetSTDName();
+                string libname = m_Sample.GetMsrParams().GetSTDName();
                 if (libname != "NoSTDDB")
                 {
                    loger.Info("Begin to classify big particles!Using " + libname);
@@ -317,11 +320,11 @@ namespace OTSModelSharp
         public bool GetOriginalParticles()
         {
             // measure status
-            CMsrSampleStatus pStatus = m_pSample.GetMsrStatus();
+            CMsrSampleStatus pStatus = m_Sample.GetMsrStatus();
 
    
            // get image process parameter
-           CSampleParam pMsrParam = m_pSample.GetMsrParams();
+           CSampleParam pMsrParam = m_Sample.GetMsrParams();
             COTSImageProcParam pImgProcessParam = pMsrParam.GetImageProcessParam();
 
             // remove BES image background
@@ -468,7 +471,8 @@ namespace OTSModelSharp
                 {
                     area += p.GetArea();
                 }
-                partInfo.Area = Convert.ToInt32(area / f.SmallParticlePercentage);
+                //partInfo.Area = Convert.ToInt32(area / f.SmallParticlePercentage);
+                partInfo.Area =(int) area ;
                 smallparts.Add(partInfo);
             }
             foreach (CSmallParticleInfo smallp in smallparts)

+ 12 - 5
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/COTSFieldData.cs

@@ -130,14 +130,20 @@ namespace OTSModelSharp
             double nAreaHigh = (oAreaRange.GetEnd() / 2) * (oAreaRange.GetEnd() / 2) * 3.14159;
             // gray level range
             CIntRange oParticleGrayRange = a_pImageProcessParam.GetParticleGray();
-            int nGrayLow = oParticleGrayRange.GetStart();
-            int nGrayHigh = oParticleGrayRange.GetEnd();
+            //here,no longer consider the gray range of particles,for we can make it by regulate the background range.
+            //-------------------------------------------
+            //int nGrayLow = oParticleGrayRange.GetStart();
+            //int nGrayHigh = oParticleGrayRange.GetEnd();
+            //-------------------------------------------
             // get particles list
             List<COTSParticleClr> listParticles =m_listParticles;
             // go through each particles
 
             int nTagId = 0;
             int nAnalysisPartId = 0;
+            int tooSmallnum = 0;
+         
+            int overSizenum = 0;
 
             foreach (COTSParticleClr pParticle in listParticles)
             {
@@ -155,14 +161,14 @@ namespace OTSModelSharp
                 if (dPartArea > (double)nAreaHigh)
                 {
                     pParticle.SetType((int)otsdataconst.OTS_PARTCLE_TYPE.OVERSIZE);
-
+                    overSizenum += 1;
                     continue;
                 }
                 // too small to measure
                 else if (dPartArea < (double)nAreaLow)
                 {
                     pParticle.SetType((int)otsdataconst.OTS_PARTCLE_TYPE.SMALL);
-
+                    tooSmallnum += 1;
                     continue;
                 }
                 // add the particle into the output particles list
@@ -171,7 +177,8 @@ namespace OTSModelSharp
                 m_listAnalysisParticles.Add(pParticle);
                 ++nAnalysisPartId;
             }
-
+            logger.Info("TooSmall Particles: " + tooSmallnum);
+            logger.Info("OverSize Particles: " + overSizenum);
 
         }
        

+ 24 - 24
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/CSmplMeasure.cs

@@ -26,7 +26,7 @@ namespace OTSModelSharp
         protected bool bSaveThreadWorking;
         protected System.Threading.Thread m_thread_ptr;
    
-        protected COTSSample m_pSample;
+        protected COTSSample m_Sample;
         protected CMsrThread m_pMsrThread;
         string m_strWorkingFolder;
 
@@ -67,14 +67,14 @@ namespace OTSModelSharp
             m_ScanHardwareMgr = new ScanController();
             m_EDSHardwareMgr = new EDSController();
             m_listHoleBSEImg = new CHoleBSEImgsList();
-            m_pSample = a_pSample;
+            m_Sample = a_pSample;
             
         }
 
        public void SetSample(COTSSample a_pSample)
         {
             
-            m_pSample = a_pSample;
+            m_Sample = a_pSample;
             m_pSampleRstFile.SetSample(a_pSample);
         }
 
@@ -88,7 +88,7 @@ namespace OTSModelSharp
 
         bool SetSEMDataMrs()
         {
-            var pSEMDataMsr = m_pSample.GetSEMDataMsr();
+            var pSEMDataMsr = m_Sample.GetSEMDataMsr();
             //ASSERT(pSEMDataMsr);
             double dMag = pSEMDataMsr.GetMagnification();
             double dWorkDis = pSEMDataMsr.GetWorkingDistance();
@@ -167,7 +167,7 @@ namespace OTSModelSharp
 
 
             // scan parameters
-            var pMsrParam = m_pSample.GetMsrParams();
+            var pMsrParam = m_Sample.GetMsrParams();
             var pImgScanParam = pMsrParam.GetImageScanParam();
 
             // get image size
@@ -256,16 +256,16 @@ namespace OTSModelSharp
                 a_strWorkingFolder += "\\";
             }
 
-            m_strWorkingFolder = a_strWorkingFolder + m_pSample.GetName() + "\\";
+            m_strWorkingFolder = a_strWorkingFolder + m_Sample.GetName() + "\\";
         }
         bool CalculateUnMeasuredFieldsCenters(out List<System.Drawing.Point> a_listFieldCenter)
         {       
 
             // sample measure parameters
-            CSampleParam pMsrParam = m_pSample.GetMsrParams();
+            CSampleParam pMsrParam = m_Sample.GetMsrParams();
             COTSImgScanPrm  poImageScanParam = pMsrParam.GetImageScanParam();
-            CSEMDataMsr poSEMDataMsr = m_pSample.GetSEMDataMsr();
-            CMsrSampleStatus pStatus = m_pSample.GetMsrStatus();
+            CSEMDataMsr poSEMDataMsr = m_Sample.GetSEMDataMsr();
+            CMsrSampleStatus pStatus = m_Sample.GetMsrStatus();
 
             // measured field centers list
             List<System.Drawing.Point> listCompletedCenter = pStatus.GetCompletedFieldsCenter();
@@ -274,7 +274,7 @@ namespace OTSModelSharp
             CFieldPositionMgr pFieldMgr = new CFieldPositionMgr();
 
             // init field centers list manager
-            if (!pFieldMgr.Init(m_pSample.GetMsrArea(), poImageScanParam, poSEMDataMsr, listCompletedCenter))
+            if (!pFieldMgr.Init(m_Sample.GetMsrArea(), poImageScanParam, poSEMDataMsr, listCompletedCenter))
             {
                 loger.Error("CalculateFieldsCenters: failed to init field centres list manager.");
                 a_listFieldCenter = new List<System.Drawing.Point>();
@@ -302,10 +302,10 @@ namespace OTSModelSharp
             int nStopField = a_pScanParam.GetStopParamFields();
 
             // completed fields number
-            CMsrSampleStatus pMsrSampleStatus = m_pSample.GetMsrStatus();
+            CMsrSampleStatus pMsrSampleStatus = m_Sample.GetMsrStatus();
             int nCompeltedField = pMsrSampleStatus.GetCompletedFields();
 
-            CMsrDisplayResults pMsrResults = m_pSample.GetMsrResults();
+            CMsrDisplayResults pMsrResults = m_Sample.GetMsrResults();
             List<CMsrResultItem> listMsrResult = pMsrResults.GetResultItems();
             int nNumParticle = 0;
             foreach (var pResult in listMsrResult)
@@ -450,7 +450,7 @@ namespace OTSModelSharp
             using (AutoResetSEMControl autoReset = new AutoResetSEMControl(this)) //when this method exit ,the SetSEMExternalOff and ResetScan will be called automatically.
             {
                 // let the main thread to know that this sample measurement starts
-                var pStatus = m_pSample.GetMsrStatus();
+                var pStatus = m_Sample.GetMsrStatus();
                 pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.INPROCESS);
 
 
@@ -461,11 +461,11 @@ namespace OTSModelSharp
                 ST_MSTMsg MsgSmpStart = new ST_MSTMsg();
                 MsgSmpStart.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
                 MsgSmpStart.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.INPROCESS;
-                MsgSmpStart.STMSampleStu.cSampleName = m_pSample.GetName();
+                MsgSmpStart.STMSampleStu.cSampleName = m_Sample.GetName();
 
                 m_pMsrThread.SendMessageToMeasureApp(MsgSmpStart);
 
-                loger.Info(m_pSample.GetName() + " Measurement started!");
+                loger.Info(m_Sample.GetName() + " Measurement started!");
                 // get SEM controller to set magnification and working distance
                 if (!SetSEMDataMrs())
                 {
@@ -559,7 +559,7 @@ namespace OTSModelSharp
                     }
 
                     // check if sample measurement completes
-                    COTSImgScanPrm pScanParam = m_pSample.GetMsrParams().GetImageScanParam();
+                    COTSImgScanPrm pScanParam = m_Sample.GetMsrParams().GetImageScanParam();
                     int nTotalFieldSize = (int)umMeasuredlistFieldCenter.Count;
 
 
@@ -651,7 +651,7 @@ namespace OTSModelSharp
                     uint measuredArea = 0; // this area should be the field area
                     var a_pBSEImg = curFldData.GetBSEImage();
                     
-                    double dPixelSize = m_pSample.CalculatePixelSize();
+                    double dPixelSize = m_Sample.CalculatePixelSize();
                    
                         measuredArea = (uint)(a_pBSEImg.GetHeight() * a_pBSEImg.GetWidth()* dPixelSize * dPixelSize + 0.5); //Get measured area
                     if (!CumulateFieldData(curFldData.ListAnalysisParticles, measuredArea))
@@ -691,9 +691,9 @@ namespace OTSModelSharp
                 //merging particles
                 loger.Info("Merging big particles on the field edge!");
                 CImageHandler imgpro = new CImageHandler();
-                int scanfldsize = m_pSample.GetSEMDataMsr().GetScanFieldSize();
+                int scanfldsize = m_Sample.GetSEMDataMsr().GetScanFieldSize();
                 List<COTSParticleClr> mergedParticles = new List<COTSParticleClr>();
-                imgpro.MergeBigBoundaryParticles(m_pSampleRstFile.GetFieldData(), m_pSample.CalculatePixelSize(), scanfldsize, m_pSample.GetResolutionSize(), ref mergedParticles);
+                imgpro.MergeBigBoundaryParticles(m_pSampleRstFile.GetFieldData(), m_Sample.CalculatePixelSize(), scanfldsize, m_Sample.GetResolutionSize(), ref mergedParticles);
 
                 
 
@@ -713,7 +713,7 @@ namespace OTSModelSharp
                 ST_MSTMsg MsgSmplEnd = new ST_MSTMsg();
                 MsgSmplEnd.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
                 MsgSmplEnd.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.SUCCESSED;
-                MsgSmplEnd.STMSampleStu.cSampleName = m_pSample.GetName();
+                MsgSmplEnd.STMSampleStu.cSampleName = m_Sample.GetName();
                 m_pMsrThread.SendMessageToMeasureApp(MsgSmplEnd);
             }
     }
@@ -724,7 +724,7 @@ namespace OTSModelSharp
             {
 
                     // let the main thread to know that this sample measurement starts
-                    CMsrSampleStatus pStatus = m_pSample.GetMsrStatus();
+                    CMsrSampleStatus pStatus = m_Sample.GetMsrStatus();
                 pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.INPROCESS);
 
                 // set current time to current time
@@ -734,7 +734,7 @@ namespace OTSModelSharp
                 ST_MSTMsg MsgSmpStart=new ST_MSTMsg();
                 MsgSmpStart.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
                 MsgSmpStart.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.INPROCESS;
-               MsgSmpStart.STMSampleStu.cSampleName=m_pSample.GetName();
+               MsgSmpStart.STMSampleStu.cSampleName=m_Sample.GetName();
 
 
                 // get SEM controller to set magnification and working distance
@@ -808,7 +808,7 @@ namespace OTSModelSharp
                     }
 
                     // check if sample measurement completes
-                    COTSImgScanPrm  pScanParam = m_pSample.GetMsrParams().GetImageScanParam();
+                    COTSImgScanPrm  pScanParam = m_Sample.GetMsrParams().GetImageScanParam();
                     int nTotalFieldSize = listFieldCenter.Count;
                
  
@@ -939,7 +939,7 @@ namespace OTSModelSharp
         {
 
             // get measure result items of the sample
-            CMsrDisplayResults pMsrResults = m_pSample.GetMsrResults();
+            CMsrDisplayResults pMsrResults = m_Sample.GetMsrResults();
 
             // cumulate field data info
             //pMsrResults.CumulateMeasureResults(listResultItems);

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/Measurethread.cd

@@ -65,7 +65,7 @@
       </Path>
     </AssociationLine>
     <TypeIdentifier>
-      <HashCode>EQAAECMA0QIAAAAEIQAAAAEQAAIMkABJAIIECQgUAEA=</HashCode>
+      <HashCode>EQAAECMA0QIAAAAEIQAAAAEQAAIIkABJAIIECQgUAMA=</HashCode>
       <FileName>0-OTSModel\Measure\GetBSEPic\CSmplMeasure.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>

+ 1 - 0
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSImageScanParam.cs

@@ -126,6 +126,7 @@ namespace OTSDataType
         public void SetStopParamParticles(int a_nStopParamParticles) { m_nStopParamParticles = a_nStopParamParticles; }
 
         //测量帧终止方式
+        //no longer consider the field stop mode ,for we can get the same result by regulate the min size of particle to filter  the too small particles.
         public OTS_MEASURE_FIELD_STOP_MODE GetFieldStopMode() { return m_nFieldStopMode; }
         public void SetFieldStopMode(OTS_MEASURE_FIELD_STOP_MODE a_nFieldStopMode) { m_nFieldStopMode = a_nFieldStopMode; }
         //帧完成面积百分比

+ 51 - 39
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSSample.cs

@@ -1048,19 +1048,7 @@ namespace OTSDataType
                                    
                                     break;
                                 case OTS_BGREMOVE_TYPE.MANUAL:
-                                    // particle area min
-                                  
-                                        poPropItem = new CPropItem();
-                                        nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_AREA_MIN;
-                                        poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
-                                        a_listPropItems.Add(poPropItem);
                                    
-                                    // particle area max
-                                   
-                                        poPropItem = new CPropItem();
-                                        nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_AREA_MAX;
-                                        poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
-                                        a_listPropItems.Add(poPropItem);
                                    
                                     // BG gray level min
                                     
@@ -1075,21 +1063,39 @@ namespace OTSDataType
                                         nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.BG_GRAY_MAX;
                                         poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
                                         a_listPropItems.Add(poPropItem);
-                                   
+                                    //here,no longer consider the gray range of particles,for we can get the same result by regulate the background range.(gsp 2021.8.13)
+                                    //---------------------------------------
                                     // particle gray level min
-                                    
-                                        poPropItem = new CPropItem();
-                                        nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_GRAY_MIN;
-                                        poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
-                                        a_listPropItems.Add(poPropItem);
-                                    
+
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_GRAY_MIN;
+                                    poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
+                                    a_listPropItems.Add(poPropItem);
+
                                     // particle gray level max
-                                   
-                                        poPropItem = new CPropItem();
-                                        nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_GRAY_MAX;
-                                        poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
-                                        a_listPropItems.Add(poPropItem);
-                                   
+
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_GRAY_MAX;
+                                    poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
+                                    a_listPropItems.Add(poPropItem);
+                                    //----------------------------------------
+
+                                    // particle area min
+
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_AREA_MIN;
+                                    poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
+                                    a_listPropItems.Add(poPropItem);
+
+                                    // particle area max
+
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_AREA_MAX;
+                                    poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
+                                    a_listPropItems.Add(poPropItem);
+
+                            
+
                                     break;
 
                             }
@@ -1509,19 +1515,7 @@ namespace OTSDataType
 
                                     break;
                                 case OTS_BGREMOVE_TYPE.MANUAL:
-                                    // particle area min
-
-                                    poPropItem = new CPropItem();
-                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_AREA_MIN;
-                                    poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
-                                    a_listPropItems.Add(poPropItem);
-
-                                    // particle area max
-
-                                    poPropItem = new CPropItem();
-                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_AREA_MAX;
-                                    poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
-                                    a_listPropItems.Add(poPropItem);
+                                  
 
                                     // BG gray level min
 
@@ -1536,7 +1530,8 @@ namespace OTSDataType
                                     nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.BG_GRAY_MAX;
                                     poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
                                     a_listPropItems.Add(poPropItem);
-
+                                    //here,no longer consider the gray range of particles,for we can get the same result by regulate the background range.(gsp 2021.8.13)
+                                    //---------------------------------------------
                                     // particle gray level min
 
                                     poPropItem = new CPropItem();
@@ -1550,6 +1545,23 @@ namespace OTSDataType
                                     nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_GRAY_MAX;
                                     poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.INT, false, bShow);
                                     a_listPropItems.Add(poPropItem);
+                                    //----------------------------------------------
+
+                                    // particle area min
+
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_AREA_MIN;
+                                    poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
+                                    a_listPropItems.Add(poPropItem);
+
+                                    // particle area max
+
+                                    poPropItem = new CPropItem();
+                                    nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.PARTICLE_AREA_MAX;
+                                    poPropItem.SetSmplParameter(modelResource, nItemId, OTS_ITEM_TYPES.DOUBLE, false, bShow);
+                                    a_listPropItems.Add(poPropItem);
+
+
 
                                     break;