|  | @@ -3,13 +3,14 @@ using System.Collections.Generic;
 | 
	
		
			
				|  |  |  using System.Drawing;
 | 
	
		
			
				|  |  |  using System.Linq;
 | 
	
		
			
				|  |  |  using System.Text;
 | 
	
		
			
				|  |  | +using System.Threading;
 | 
	
		
			
				|  |  |  using System.Threading.Tasks;
 | 
	
		
			
				|  |  |  using OTSCOMMONCLR;
 | 
	
		
			
				|  |  |  using OTSDataType;
 | 
	
		
			
				|  |  |  using OTSModelSharp.Measure.OTSCleanliness;
 | 
	
		
			
				|  |  |  using OTSModelSharp.ServiceCenter;
 | 
	
		
			
				|  |  |  using OTSModelSharp.ServiceInterface;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +using static OTSDataType.otsdataconst;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  namespace OTSModelSharp
 | 
	
		
			
				|  |  |  {
 | 
	
	
		
			
				|  | @@ -33,25 +34,18 @@ namespace OTSModelSharp
 | 
	
		
			
				|  |  |              curFldDataMgr.SetId(nNewFieldId);
 | 
	
		
			
				|  |  |              curFldDataMgr.SetPosition(fldCenter);
 | 
	
		
			
				|  |  |              GetOriginalParticles();
 | 
	
		
			
				|  |  | -            //{
 | 
	
		
			
				|  |  | -            //    StartSaveFileThread(curFldDataMgr);
 | 
	
		
			
				|  |  | -            //    loger.Error("ImageProcess: failed to find any particles.");
 | 
	
		
			
				|  |  | -            //    return false;
 | 
	
		
			
				|  |  | -            //}
 | 
	
		
			
				|  |  | + 
 | 
	
		
			
				|  |  |              // second step :filter the finded particles.
 | 
	
		
			
				|  |  |              FilterParticles(curFldDataMgr);
 | 
	
		
			
				|  |  | -            //{
 | 
	
		
			
				|  |  | -            //    StartSaveFileThread(curFldDataMgr);
 | 
	
		
			
				|  |  | -            //    loger.Info("ImageProcess: there is no particles to be analyzed.");
 | 
	
		
			
				|  |  | -            //    return false;
 | 
	
		
			
				|  |  | -            //}
 | 
	
		
			
				|  |  | +            COTSXRayParam pXRayParam = m_Sample.GetMsrParams().GetXRayParam();
 | 
	
		
			
				|  |  |              //collect xray data.
 | 
	
		
			
				|  |  | -            CollectParticlesXrayData(curFldDataMgr);
 | 
	
		
			
				|  |  | -            //{
 | 
	
		
			
				|  |  | -            //    StartSaveFileThread(curFldDataMgr);
 | 
	
		
			
				|  |  | -            //    loger.Info("ImageProcess: there is no particles to be analyzed.");
 | 
	
		
			
				|  |  | -            //    return false;
 | 
	
		
			
				|  |  | -            //}
 | 
	
		
			
				|  |  | +            if (pXRayParam.GetUsingXray() == (int)OTS_USING_X_RAY.Yes)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                Thread.Sleep(100);
 | 
	
		
			
				|  |  | +                CollectParticlesXrayData(curFldDataMgr);
 | 
	
		
			
				|  |  | +                Thread.Sleep(100);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +      
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              //special treatment.
 | 
	
		
			
				|  |  |              //ParticleSpecialTreatment();
 | 
	
	
		
			
				|  | @@ -192,8 +186,8 @@ namespace OTSModelSharp
 | 
	
		
			
				|  |  |              fld.ListSmallParticles = smallparts;
 | 
	
		
			
				|  |  |              fld.ListBigParticles = bigparts;
 | 
	
		
			
				|  |  |              //fld.SmallParticlePercentage=percentage;
 | 
	
		
			
				|  |  | -            loger.Info("SmallQuantifyParts: " + smallparts.Count);
 | 
	
		
			
				|  |  | -            loger.Info("BigQuantifyParts: " + bigparts.Count);
 | 
	
		
			
				|  |  | +            loger.Info("SmallQuantifyParts (<" + quantifyThreshold.ToString("f2") + "): " + smallparts.Count);
 | 
	
		
			
				|  |  | +            loger.Info("BigQuantifyParts (>=" + quantifyThreshold.ToString("f2")+ "): " + bigparts.Count);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              return ;
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -223,12 +217,7 @@ namespace OTSModelSharp
 | 
	
		
			
				|  |  |              // get x-ray list (analysis) by particle features
 | 
	
		
			
				|  |  |              nXRayAQTime = (uint)pXRayParam.GetMidAnalyAQTime();
 | 
	
		
			
				|  |  |              m_EDSHardwareMgr.GetXRayByFeatures(bigparts, nXRayAQTime, true);
 | 
	
		
			
				|  |  | -            //{
 | 
	
		
			
				|  |  | -            //    loger.Error("ImageProcess: call GetXRayByFeatures method.");
 | 
	
		
			
				|  |  | -            //    pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
 | 
	
		
			
				|  |  | -            //    StartSaveFileThread(curFldData);
 | 
	
		
			
				|  |  | -            //    return false;
 | 
	
		
			
				|  |  | -            //}
 | 
	
		
			
				|  |  | +  
 | 
	
		
			
				|  |  |           
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -237,13 +226,7 @@ namespace OTSModelSharp
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              // get x-ray list (analysis) by points
 | 
	
		
			
				|  |  |              m_EDSHardwareMgr.GetXRayByPoints(smallparts, nXRayAQTime, true);
 | 
	
		
			
				|  |  | -            //{ // failed to call GetXRayByPoints method
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            //    loger.Error("ImageProcess: call GetXRayByPoints method.");
 | 
	
		
			
				|  |  | -            //    pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
 | 
	
		
			
				|  |  | -            //    StartSaveFileThread(curFldData);
 | 
	
		
			
				|  |  | -            //    return false;
 | 
	
		
			
				|  |  | -            //}
 | 
	
		
			
				|  |  | +     
 | 
	
		
			
				|  |  |              return ;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -276,13 +259,7 @@ namespace OTSModelSharp
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  List<CPosXrayClr> maxEDSXrays = new List<CPosXrayClr>();
 | 
	
		
			
				|  |  |                  m_EDSHardwareMgr.GetXRayByFeatures(partsMax, edsTime, true);
 | 
	
		
			
				|  |  | -                //{
 | 
	
		
			
				|  |  | -                //    loger.Error("ImageProcess: call GetXRayByFeatures method for MaxEDS");
 | 
	
		
			
				|  |  | -                //   m_Sample.GetMsrStatus(). SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
 | 
	
		
			
				|  |  | -                //    StartSaveFileThread(curFldData);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                //    return;
 | 
	
		
			
				|  |  | -                //}
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              }
 |