Parcourir la source

Merge branch 'Release2.3' of http://36.129.163.148:10080/gaoshipeng/OTS2_0 into Release2.3

CXS il y a 3 ans
Parent
commit
ebe747f804

+ 22 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/2-OTSCleanliness/SmplMeasureCleanliness.cs

@@ -143,11 +143,32 @@ namespace OTSModelSharp
            
             CSampleParam pMsrParam = m_Sample.GetMsrParams();
             COTSImageProcParam pImgProcessParam = pMsrParam.GetImageProcessParam();
+            var pXRayParam = pMsrParam.GetXRayParam();
             curFldData.InitParticles(pImgProcessParam, dPixelSize);
             if (curFldData.NoAnalysisParticle())
             {
                 log.Warn("There's no analysis particles!");
             }
+
+            var listXray = curFldData.GetListAnalysisParticles().OrderByDescending(x => x.GetActualArea()).ToList();
+            var listXray1 = new List<COTSParticleClr>();
+
+            if (listXray.Count > pXRayParam.GetXrayLimit())
+            {
+                for (var i = 0; i < pXRayParam.GetXrayLimit(); i++)
+                {
+
+                    listXray1.Add(listXray[i]);
+                }
+
+            }
+            else
+            {
+                listXray1 = listXray;
+            }
+
+
+
             //2) according to the quantify threshold size value saperate the analysis particles into two group :the bigparticles and the smallparticles.
 
             double quantifyThreshold = m_Sample.GetMsrParams().GetXRayParam().GetFeatureModeMinSize();
@@ -156,7 +177,7 @@ namespace OTSModelSharp
             var bigparts = fld.ListBigParticles;
 
 
-            foreach (var part in curFldData.GetListAnalysisParticles())
+            foreach (var part in listXray1)
             {
                 double equalCircleDiameter = Math.Sqrt(part.GetActualArea() / 3.14159) * 2f;
                 if (equalCircleDiameter < quantifyThreshold)