Browse Source

Merge branch 'dev' of http://172.16.3.77:10080/gaoshipeng/OTS2_0 into dev

zhangjiaxin 4 years ago
parent
commit
c7166830cb

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

+ 14 - 14
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/CMsrDisplayResults.cs

@@ -16,7 +16,7 @@ namespace OTSModelSharp
     {   // Type ID
         private int m_nTypeId;
         // area (micros)
-        private System.UInt32 m_nArea;
+        private double m_nArea;
         // particle number
         private System.UInt32 m_nNumber;
         private string m_sName;
@@ -49,11 +49,11 @@ namespace OTSModelSharp
             m_nTypeId = a_nTypeId;
         }
         // area (micros)
-        public System.UInt32 GetArea()
+        public double GetArea()
         {
             return m_nArea;
         }
-        public void SetArea(System.UInt32 a_nArea)
+        public void SetArea(double a_nArea)
         {
             m_nArea = a_nArea;
         }
@@ -102,7 +102,7 @@ namespace OTSModelSharp
         // radio
         double m_dRadio;
         // measured area (micros)
-        System.UInt32 m_nMeasuredArea;
+        double m_nMeasuredArea;
         // result items list
         List<CMsrResultItem> m_listResultItems;
 
@@ -127,15 +127,15 @@ namespace OTSModelSharp
             m_dRadio = a_dRadio;
         }
         // measured area (micros)
-        public System.UInt32 GetMeasuredArea()
+        public double GetMeasuredArea()
         {
             return m_nMeasuredArea;
         }
-        public void SetMeasuredArea(System.UInt32 a_nMeasuredArea)
+        public void SetMeasuredArea(double a_nMeasuredArea)
         {
             m_nMeasuredArea = a_nMeasuredArea;
         }
-        public void CumulateMeasuredArea(System.UInt32 a_nMeasuredArea)
+        public void CumulateMeasuredArea(double a_nMeasuredArea)
         {
             m_nMeasuredArea += a_nMeasuredArea;
         }
@@ -154,18 +154,18 @@ namespace OTSModelSharp
                 m_listResultItems.Add(cMsrResultItem);
             }
         }
-        public System.UInt32 GetTotalParticleArea()
+        public double GetTotalParticleArea()
         {
-            System.UInt32 nArea = 0;
+            double nArea = 0;
             foreach (CMsrResultItem poResultItem in m_listResultItems)
             {
                 nArea += poResultItem.GetArea();
             }
             return nArea;
         }
-        public System.UInt32 GetTotalparticleIdentifyArea()
+        public double GetTotalparticleIdentifyArea()
         {
-            System.UInt32 nArea = 0;
+            double nArea = 0;
             foreach (CMsrResultItem poResultItem in m_listResultItems)
             {
                 if (poResultItem.GetTypeId() > 7)
@@ -192,7 +192,7 @@ namespace OTSModelSharp
             {
                 return dDisplayRadio;
             }
-            System.UInt32 nTotalParticleArea = GetTotalParticleArea();
+            double nTotalParticleArea = GetTotalParticleArea();
             dDisplayRadio = (double)nTotalParticleArea / (double)m_nMeasuredArea * m_dRadio;
             return dDisplayRadio;
         }
@@ -204,7 +204,7 @@ namespace OTSModelSharp
             if (itr != null)
             {
 
-                itr.SetArea((uint)a_poResultItem.GetArea() + itr.GetArea());
+                itr.SetArea(a_poResultItem.GetArea() + itr.GetArea());
                 itr.SetNumber(itr.GetNumber() + 1);
             }
             else            
@@ -212,7 +212,7 @@ namespace OTSModelSharp
                 CMsrResultItem pMsrResultItem = new CMsrResultItem();
                 pMsrResultItem.SetTypeId(a_poResultItem.GetClassifyId());
 
-                pMsrResultItem.SetArea((System.UInt32)(a_poResultItem.GetArea() + 0.5));
+                pMsrResultItem.SetArea(a_poResultItem.GetArea() + 0.5);
                 pMsrResultItem.SetNumber(1);
                 pMsrResultItem.SetName(a_poResultItem.GetTypeName());
                 m_listResultItems.Add(pMsrResultItem);

+ 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);
 
         }
        

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

@@ -648,12 +648,12 @@ namespace OTSModelSharp
 
                     ++nNewFieldId;
 
-                    uint measuredArea = 0; // this area should be the field area
+                    double measuredArea = 0; // this area should be the field area
                     var a_pBSEImg = curFldData.GetBSEImage();
                     
                     double dPixelSize = m_Sample.CalculatePixelSize();
                    
-                        measuredArea = (uint)(a_pBSEImg.GetHeight() * a_pBSEImg.GetWidth()* dPixelSize * dPixelSize + 0.5); //Get measured area
+                        measuredArea = a_pBSEImg.GetHeight() * a_pBSEImg.GetWidth()* dPixelSize * dPixelSize + 0.5; //Get measured area
                     if (!CumulateFieldData(curFldData.ListAnalysisParticles, measuredArea))
                     { // failed to call SaveFieldFile method
                         loger.Error("ImageProcess: call CumulateFieldData method.");
@@ -935,7 +935,7 @@ namespace OTSModelSharp
             }
         }
         // Cumulate field data info
-        public virtual bool CumulateFieldData( List<COTSParticleClr> listParticles, uint a_nMeasuredArea)
+        public virtual bool CumulateFieldData( List<COTSParticleClr> listParticles, double a_nMeasuredArea)
         {
 
             // get measure result items of the sample

+ 18 - 14
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSSample.cs

@@ -298,6 +298,8 @@ namespace OTSDataType
                 case OTS_SAMPLE_PROP_GRID_ITEMS.WORKING_DISTANCE:
                 case OTS_SAMPLE_PROP_GRID_ITEMS.RATIO:
                 case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_TO_MEASURE_AREA:
+                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA:
+                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE_AREA:
                 default:
                     {
                         // something wrong, return false
@@ -552,23 +554,12 @@ namespace OTSDataType
                     }
                     break;
 
-                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA:
-                    {
-                        a_nValue = (int)m_poMsrResults.GetMeasuredArea();
-                    }
-                    break;
-
                 case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE:
                     {
                         a_nValue = (int)m_poMsrResults.GetTotalParticleNumber();
                     }
                     break;
 
-                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE_AREA:
-                    {
-                        a_nValue = (int)m_poMsrResults.GetTotalParticleArea();
-                    }
-                    break;
                 case OTS_SAMPLE_PROP_GRID_ITEMS.FIELDSTOP_AREAPERCENTAGE:
                     {
                         a_nValue = m_poMsrParams.GetImageScanParam().GetFieldAreaPercentage();
@@ -823,9 +814,9 @@ namespace OTSDataType
                 // read only properties, treat same as default
                 case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_FIELDS:
                 case OTS_SAMPLE_PROP_GRID_ITEMS.COMPLETED_FIELDS:
-                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA:
+                
                 case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE:
-                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE_AREA:
+                
                 default:
                     {
                         // something wrong, return false
@@ -2021,7 +2012,20 @@ namespace OTSDataType
 
                         double dFieldArea = 0; // this area should be the field area
                         dFieldArea = CalculateAFieldArea();
-                        a_dValue = (double)m_poSEMDataMsr.GetTotalFields() * dFieldArea;//
+                        a_dValue = m_poSEMDataMsr.GetTotalFields() * dFieldArea;
+                    }
+                    break;
+
+                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA:
+                    {
+                        a_dValue = m_poMsrResults.GetMeasuredArea();
+                    }
+                    break;
+
+
+                case OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_PARTICLE_AREA:
+                    {
+                        a_dValue = m_poMsrResults.GetTotalParticleArea();
                     }
                     break;
 

+ 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();

+ 1 - 1
OTSIncAMeasureApp/8-OTSSampleMeasureInfo/OTSSampleData.cs

@@ -401,7 +401,7 @@ namespace OTSMeasureApp
             //测量面积
             SampleData sData30 = new SampleData();
             sData30.iSampleId = OTS_SAMPLE_PROP_GRID_ITEMS.TOTAL_AREA;
-            sData30.iSampleValType = OTS_ITEM_TYPES.INT;
+            sData30.iSampleValType = OTS_ITEM_TYPES.DOUBLE;
             sData30.sSCaptionName = "测量面积";
             sData30.SampleVal = 120;
             m_SMInfo.SampleDataList.Add(sData30);

+ 0 - 1
OTSSysMgrApp/ControllerSettingForm.cs

@@ -983,7 +983,6 @@ namespace OTSSysMgrApp
                         lbXrayCount.Text = nXrayCount.ToString();
                     }
                 }
-                log.Info("Area collection successful!");
             }
             catch (Exception ex)
             {