فهرست منبع

修改 SmplMeasure.cs错误

CXS 5 سال پیش
والد
کامیت
2fc06ed5cf

+ 109 - 7
OTS/OTSModelSharp/Measure/GetBSEPic/SmplMeasure.cs

@@ -986,10 +986,10 @@ namespace OTSModelSharp
       //      return pSEMController;
       //}
 
-       public COTSScanBase GetScanControl()
+       public IScanController GetScanControl()
         {
             // scan controller
-            COTSScanBase pScanController = null;
+            IScanController pScanController = null;
 
             // get scan controller
             pScanController = m_pMsrThread.GetScanController();
@@ -998,10 +998,10 @@ namespace OTSModelSharp
             return pScanController;
         }
 
-       public OTSEDSBase GetEDSControl()
+       public IEDSController GetEDSControl()
         {
             // EDS controller
-            OTSEDSBase pEDSController = null;
+            IEDSController pEDSController = null;
 
             // get EDS controller
             pEDSController = m_pMsrThread.GetEDSController();
@@ -1068,7 +1068,7 @@ namespace OTSModelSharp
         }
 
         // get pixel size
-        public bool GetPixelSize(double a_dPixelSize)
+        public bool GetPixelSize(ref double a_dPixelSize)
         {
 
             a_dPixelSize = m_pSample.CalculatePixelSize();
@@ -1318,7 +1318,7 @@ namespace OTSModelSharp
             MergeBigBoundaryParticles(mergedParts);
             double pixelSize = 0;
 
-            this.GetPixelSize(pixelSize);
+            this.GetPixelSize(ref pixelSize);
 
             oTSFieldMgr.CalMergedParticleImageProp(mergedParts, pixelSize);
 
@@ -1363,7 +1363,7 @@ namespace OTSModelSharp
             List<COTSSegment> boarderSegs;
             var allFields = m_pSmplMsrResultFileMgr.GetSmplMsrResultFile().GetFieldData();
             double pixelSize = 0;
-            this.GetPixelSize(pixelSize);
+            this.GetPixelSize(ref pixelSize);
             var FldMgr = new CFieldMgr();
             FldMgr.SetSEMDataMsr(this.GetSample().GetSEMDataMsr());
 
@@ -1734,6 +1734,108 @@ namespace OTSModelSharp
             // ok, return TRUE
             return true;
         }
+        bool GetXRayByFeatures(List<COTSParticle> a_listParticles, int a_nXRayAQTime, bool a_bElementInfo /*= FALSE*/)
+        {
+            // get EDS controller
+             pEDSController = GetEDSControl();
+            ASSERT(pEDSController);
+            if (!pEDSController)
+            {
+                LogErrorTrace(__FILE__, __LINE__, _T("GetXRayByFeatures: failed to get EDS controller."));
+                return FALSE;
+            }
+            // get out if particles list is empty
+            if (a_listParticles.size() == 0)
+            {
+                return TRUE;
+            }
+            // init EDS controller
+            if (!pEDSController->Init())
+            {
+                LogErrorTrace(__FILE__, __LINE__, _T("GetXRayByFeatures: failed to inti EDS (%s)."), pEDSController->GetName());
+                return FALSE;
+            }
+
+            // set get quantify info flag
+            pEDSController->SetQuantification(a_bElementInfo);
+
+
+
+
+            int nSize = (int)a_listParticles.size();
+
+
+            if (nSize > 512)
+            {
+                m_pMsrThread->SendLogMessageToMeasureApp(_T("Too many feature Xray! Divide into multi times!"), PostLogLevel::error);
+
+            }
+            int nTimes = nSize / 512;
+            int nLast = nSize % 512;
+            if (nLast != 0)
+            {
+                nTimes += 1;
+            }
+
+            COTSParticleList listPosXRayTemp;
+
+            for (int i = 0; i < nTimes; i++)
+            {
+                listPosXRayTemp.clear();
+                for (int m = 0; m < 512; m++)
+                {
+                    if (i * 512 + m < nSize)
+                    {
+                        listPosXRayTemp.push_back(a_listParticles[i * 512 + m]);
+                    }
+                    else
+                    {
+                        break;
+                    }
+
+                }
+
+
+
+                // get the features list of the particles
+                CPosXraysList listPosXRay;
+                std::vector<std::vector<BrukerSegment>> listBrukerFeatures;//covert these particles into brukerfeatures.
+                for (auto pPart : listPosXRayTemp)
+                {
+                    if (pPart->GetXrayInfo() == nullptr)
+                    {
+                        continue;
+                    }
+                    auto pFeature = pPart->GetFeature();
+                    COTSSegmentsList listSegment = pFeature->GetSegmentsList();
+
+                    std::vector<BrukerSegment> listBrukSegment;
+                    for (auto Segment : listSegment)
+                    {
+                        BrukerSegment BrukSeg;
+                        BrukSeg.XCount = Segment->GetLength();
+                        BrukSeg.Y = Segment->GetHeight();
+                        BrukSeg.XStart = Segment->GetStart();
+                        listBrukSegment.push_back(BrukSeg);
+                    }
+
+                    listBrukerFeatures.push_back(listBrukSegment);
+                    listPosXRay.push_back(pPart->GetXrayInfo());
+                }
+
+                if (listPosXRay.size() > 0)
+                {
+                    if (!pEDSController->GetXRayByFeatures(listPosXRay, listBrukerFeatures, a_nXRayAQTime))
+                    {
+                        LogErrorTrace(__FILE__, __LINE__, _T("GetXRayByFeatures: failed to get xray by features."));
+                        return FALSE;
+                    }
+                }
+            }
+
+
+            return TRUE;
+        }
 
     }
 }

+ 2 - 2
OTS/OTSModelSharp/Measure/GetBSEPic/SmplMeasureInc.cs

@@ -101,7 +101,7 @@ namespace OTSModelSharp.MeasureControl
             // remove over sized particles, too small particles and get a analysis particles list
             // get pixel size
             double dPixelSize = 0;
-            if (!m_HardwareMgr.GetEDSControl().GetPixelSize(ref dPixelSize))
+            if (!GetPixelSize(ref dPixelSize))
             { // failed to call GetPixelSize method
                 loger.Error("ImageProcess: call GetPixelSize method.");
                 pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
@@ -212,7 +212,7 @@ namespace OTSModelSharp.MeasureControl
             }
             // get x-ray list (analysis) by particle features
             nXRayAQTime = (uint)pXRayParam.GetMidAnalyAQTime();
-            if (!m_HardwareMgr.GetEDSControl().GetXRayByFeatures(listQuantifyParticles, listAnalysisXRay, nXRayAQTime, true))
+            if (!GetXRayByFeatures(listQuantifyParticles, listAnalysisXRay, nXRayAQTime, true))
             {
                 loger.Error("ImageProcess: call GetXRayByFeatures method.");
                 pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);

+ 1 - 0
OTS/OTSModelSharp/MeasureControl/IMeasureHardware.cs

@@ -40,6 +40,7 @@ namespace OTSIncAMeasureApp.OTSMeasureControl
         bool MoveSEMToPoint(Point poi, double rotation);
 
         bool  GetSEMControl();
+        bool GetWorkingDistance(double a_dWorkingDistance);
     }
     public interface IScanController
     {

+ 0 - 2
OTS/OTSModelSharp/OTSModelSharp.csproj

@@ -174,7 +174,6 @@
     <Compile Include="OTSDataType\CMsrSampleStatus.cs" />
     <Compile Include="OTSDataType\COTSEDSBrucker.cs" />
     <Compile Include="OTSDataType\COTSFieldData.cs" />
-    <Compile Include="OTSDataType\COTSHardwareMgr.cs" />
     <Compile Include="OTSDataType\COTSImageProcessParam.cs" />
     <Compile Include="OTSDataType\COTSImageScanParam.cs" />
     <Compile Include="OTSDataType\COTSLicenseInfo.cs" />
@@ -199,7 +198,6 @@
     <Compile Include="OTSDataType\SEMStageData.cs" />
     <Compile Include="OTSDataType\stage.cs" />
     <Compile Include="OTSDataType\XMLSerialization.cs" />
-    <Compile Include="OTSEDSBase.cs" />
     <Compile Include="OTSFileSys.cs" />
     <Compile Include="OTSLicMgr.cs" />
     <Compile Include="OTSModelresource.cs" />