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