浏览代码

delete useless codes.

gsp 4 年之前
父节点
当前提交
4e501bb1cd

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

@@ -47,14 +47,10 @@ namespace OTSModelSharp
       
             if (pXRayParam.GetUsingXray() == (int)OTS_USING_X_RAY.Yes)
             {
-                Thread.Sleep(1000);
+                Thread.Sleep(100);
                 CollectParticlesXrayData();
-                //{
-                //    StartSaveFileThread(curFldData);
-                //    loger.Error("ImageProcess: failed to collect xray data!");
-                //    return false;
-                //}
-                Thread.Sleep(1000);
+             
+                Thread.Sleep(100);
             }
             loger.Info("Begin to Calculate the image property of every particle!");
             var analysisparts = curFldData.ListAnalysisParticles;

+ 16 - 39
OTSIncAMeasureApp/0-OTSModel/Measure/2-OTSCleanliness/SmplMeasureCleanliness.cs

@@ -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;
-                //}
+        
 
 
             }

+ 7 - 7
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/COTSFieldData.cs

@@ -126,8 +126,8 @@ namespace OTSModelSharp
             m_listAnalysisParticles = new List<COTSParticleClr>();
             // get area range
             CDoubleRange oAreaRange = a_pImageProcessParam.GetIncAreaRange();
-            double nAreaLow = (oAreaRange.GetStart() / 2) * (oAreaRange.GetStart() / 2) * 3.14159;
-            double nAreaHigh = (oAreaRange.GetEnd() / 2) * (oAreaRange.GetEnd() / 2) * 3.14159;
+            double dAreaLow = (oAreaRange.GetStart() / 2) * (oAreaRange.GetStart() / 2) * 3.14159;
+            double dAreaHigh = (oAreaRange.GetEnd() / 2) * (oAreaRange.GetEnd() / 2) * 3.14159;
             // gray level range
             CIntRange oParticleGrayRange = a_pImageProcessParam.GetParticleGray();
             //here,no longer consider the gray range of particles,for we can make it by regulate the background range.
@@ -144,7 +144,7 @@ namespace OTSModelSharp
             int tooSmallnum = 0;
          
             int overSizenum = 0;
-
+            logger.Info("Total Particles: " + listParticles.Count);
             foreach (COTSParticleClr pParticle in listParticles)
             {
                 // get particle area 
@@ -158,14 +158,14 @@ namespace OTSModelSharp
                 // set field id
                 pParticle.SetFieldId(GetId());
                 // oversize particles
-                if (dPartArea > (double)nAreaHigh)
+                if (dPartArea > (double)dAreaHigh)
                 {
                     pParticle.SetType((int)otsdataconst.OTS_PARTCLE_TYPE.OVERSIZE);
                     overSizenum += 1;
                     continue;
                 }
                 // too small to measure
-                else if (dPartArea < (double)nAreaLow)
+                else if (dPartArea < (double)dAreaLow)
                 {
                     pParticle.SetType((int)otsdataconst.OTS_PARTCLE_TYPE.SMALL);
                     tooSmallnum += 1;
@@ -177,8 +177,8 @@ namespace OTSModelSharp
                 m_listAnalysisParticles.Add(pParticle);
                 ++nAnalysisPartId;
             }
-            logger.Info("TooSmall Particles: " + tooSmallnum);
-            logger.Info("OverSize Particles: " + overSizenum);
+            logger.Info("TooSmall Particles (<"+ dAreaLow .ToString("f2") + "): " + tooSmallnum);
+            logger.Info("OverSize Particles (>"+ dAreaHigh.ToString("f2") + "): " + overSizenum);
 
         }
        

+ 1 - 4
OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs

@@ -1336,10 +1336,7 @@ namespace OTSMeasureApp
             }
           
             bool MeasurementStatus = false;
-            if (null == Sample)
-            {
-                return false;
-            }
+           
 
             //样品的标题名 (Treeview的根节点名)           
             SMeasureInfo.sSampleSoluName = m_ResultData.GetFileName();