浏览代码

在 SmpLMeasure.cs 中添加 GetXRayByPoints

CXS 5 年之前
父节点
当前提交
0fcd8f54f8

+ 2 - 0
OTS/OTSModelSharp/DataPublic.cs

@@ -120,5 +120,7 @@ namespace OTSModelSharp
         public const String STR_APPNAME_OTSINCA = "OTSIncA";
         public const String STR_COFIGPATH = "Config";
         public const String STR_SYSTEM_DATA = "SysData";
+
+
     }
 }

+ 27 - 35
OTS/OTSModelSharp/Measure/GetBSEPic/SmplMeasure.cs

@@ -1685,11 +1685,11 @@ namespace OTSModelSharp
             IEDSController pEDSController = m_HardwareMgr.GetEDSControl();  //OTSEDSBase pEDSController = GetEDSControl();
 
             // init EDS controller
-            //if (!pEDSController.Init())
-            //{
-            //    loger.Error("GetXRayByFeatures: failed to inti EDS (%s).", pEDSController.GetName());
-            //    return false;
-            //}
+            if (!pEDSController.Init())
+            {
+                loger.Error("GetXRayByFeatures: failed to inti EDS (%s).", pEDSController.GetName());
+                return false;
+            }
             // set get quantify info flag, firstly only get x-ray data
 
             if (!a_bElementInfo)
@@ -1737,39 +1737,32 @@ namespace OTSModelSharp
         bool GetXRayByFeatures(List<COTSParticle> a_listParticles, int a_nXRayAQTime, bool a_bElementInfo /*= FALSE*/)
         {
             // get EDS controller
-             pEDSController = GetEDSControl();
-            ASSERT(pEDSController);
-            if (!pEDSController)
+            IEDSController pEDSController = GetEDSControl();
+            //ASSERT(pEDSController);
+            if (pEDSController == null)
             {
-                LogErrorTrace(__FILE__, __LINE__, _T("GetXRayByFeatures: failed to get EDS controller."));
-                return FALSE;
+                loger.Error("GetXRayByFeatures: failed to get EDS controller.");
+                return false;
             }
             // get out if particles list is empty
-            if (a_listParticles.size() == 0)
+            if (a_listParticles.Count() == 0)
             {
-                return TRUE;
+                return true;
             }
             // init EDS controller
-            if (!pEDSController->Init())
+            if (!pEDSController.Init())
             {
-                LogErrorTrace(__FILE__, __LINE__, _T("GetXRayByFeatures: failed to inti EDS (%s)."), pEDSController->GetName());
-                return FALSE;
+                loger.Error("GetXRayByFeatures: failed to inti EDS (%s).", pEDSController.GetName());
+                return false;
             }
 
             // set get quantify info flag
-            pEDSController->SetQuantification(a_bElementInfo);
+            pEDSController.SetQuantification(a_bElementInfo);
 
+            int nSize = (int)a_listParticles.Count();
 
+            loger.Error("Too many feature Xray! Divide into multi times!");
 
-
-            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)
@@ -1777,16 +1770,16 @@ namespace OTSModelSharp
                 nTimes += 1;
             }
 
-            COTSParticleList listPosXRayTemp;
+            List<COTSParticle> listPosXRayTemp=new List<COTSParticle>();
 
             for (int i = 0; i < nTimes; i++)
             {
-                listPosXRayTemp.clear();
+                listPosXRayTemp.Clear();
                 for (int m = 0; m < 512; m++)
                 {
                     if (i * 512 + m < nSize)
                     {
-                        listPosXRayTemp.push_back(a_listParticles[i * 512 + m]);
+                        listPosXRayTemp.Add(a_listParticles[i * 512 + m]);
                     }
                     else
                     {
@@ -1798,16 +1791,16 @@ namespace OTSModelSharp
 
 
                 // get the features list of the particles
-                CPosXraysList listPosXRay;
-                std::vector<std::vector<BrukerSegment>> listBrukerFeatures;//covert these particles into brukerfeatures.
-                for (auto pPart : listPosXRayTemp)
+                List<CPosXray> listPosXRay=new List<CPosXray>();
+                List<OTSIncAMeasureApp.OTSMeasureControl.BrukerSegment> listBrukerFeatures = new List<BrukerSegment>();//covert these particles into brukerfeatures.
+                foreach (var pPart in listPosXRayTemp)
                 {
-                    if (pPart->GetXrayInfo() == nullptr)
+                    if (pPart.GetXrayInfo() == null)
                     {
                         continue;
                     }
-                    auto pFeature = pPart->GetFeature();
-                    COTSSegmentsList listSegment = pFeature->GetSegmentsList();
+                    var pFeature = pPart.GetFeature();
+                    List<`COTSSegments> listSegment = pFeature->GetSegmentsList();
 
                     std::vector<BrukerSegment> listBrukSegment;
                     for (auto Segment : listSegment)
@@ -1836,6 +1829,5 @@ namespace OTSModelSharp
 
             return TRUE;
         }
-
     }
 }

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

@@ -55,7 +55,9 @@ namespace OTSIncAMeasureApp.OTSMeasureControl
 
     public interface IEDSController
     {
+        bool Init();
         void SetQuantification(bool a_bQuantification);
         bool GetXRayByPoints(ref List<CPosXray> a_vXRayPoints,int a_nXRayAQTime);
+        string GetName();
     }
 }

+ 0 - 1
OTS/OTSModelSharp/OTSModelSharp.csproj

@@ -160,7 +160,6 @@
     </Compile>
     <Compile Include="Measure\GetStageInfo\StageFile.cs" />
     <Compile Include="Measure\GetXrayInfo\PosXrayFileMgr.cs" />
-    <Compile Include="OTSControl\EBrukerErrorCode.cs" />
     <Compile Include="OTSCrypt.cs" />
     <Compile Include="OTSDataType\CBSEImg.cs" />
     <Compile Include="OTSDataType\CDomain.cs" />