Sfoglia il codice sorgente

diagnosis the feature mode xray collecting method.

lizhongsys 3 anni fa
parent
commit
f82264296f

+ 21 - 16
OTSCPP/OTSClrInterface/ControlClr/OTSControlFunExport.cpp

@@ -230,19 +230,22 @@ namespace OTSCLRINTERFACE
 		{
 			auto feature = features[i]->GetOTSFeaturePtr();
 			auto otsSegs = feature->GetSegmentsList();
-			std::vector<BrukerSegment> listSegment;
+			//auto otsSegs = feature->GetSegmentsList();
+			//std::vector<BrukerSegment*> listSegment;
+			BrukerSegment* segArray = new BrukerSegment[otsSegs.size()];
 			for (int j = 0; j < otsSegs.size(); j++)
 			{
 				auto seg = otsSegs[j];
-				BrukerSegment oSegment;
-				oSegment.XCount = seg->GetLength();
-				oSegment.XStart = seg->GetStart();
-				oSegment.Y = seg->GetHeight();
-				listSegment.push_back(oSegment);
+				//BrukerSegment* oSegment=new BrukerSegment();
+				BrukerSegment* oSegment = &segArray[j];
+				oSegment->XCount = seg->GetLength();
+				oSegment->XStart = seg->GetStart();
+				oSegment->Y = seg->GetHeight();
+				//listSegment.push_back(oSegment);
 			}
 			BrukerFeature oFeature;
-			oFeature.SegmentCount = listSegment.size();
-			oFeature.pSegment = &listSegment[0];
+			oFeature.SegmentCount = otsSegs.size();
+			oFeature.pSegment = segArray;
 			listFeatures.push_back(oFeature);
 		}
 		// set get quantify info flag
@@ -309,19 +312,21 @@ namespace OTSCLRINTERFACE
 		{
 			auto feature = parts[i]->GetOTSParticlePtr()->GetFeature();
 			auto otsSegs = feature->GetSegmentsList();
-			std::vector<BrukerSegment> listSegment;
+			//std::vector<BrukerSegment*> listSegment;
+			BrukerSegment* segArray = new BrukerSegment[otsSegs.size()];
 			for (int j = 0; j < otsSegs.size(); j++)
 			{
 				auto seg = otsSegs[j];
-				BrukerSegment oSegment;
-				oSegment.XCount = seg->GetLength();
-				oSegment.XStart = seg->GetStart();
-				oSegment.Y = seg->GetHeight();
-				listSegment.push_back(oSegment);
+				//BrukerSegment* oSegment=new BrukerSegment();
+				BrukerSegment* oSegment = &segArray[j];
+				oSegment->XCount = seg->GetLength();
+				oSegment->XStart = seg->GetStart();
+				oSegment->Y = seg->GetHeight();
+				//listSegment.push_back(oSegment);
 			}
 			BrukerFeature oFeature;
-			oFeature.SegmentCount = listSegment.size();
-			oFeature.pSegment = &listSegment[0];
+			oFeature.SegmentCount = otsSegs.size();
+			oFeature.pSegment = segArray;
 
 			listFeatures.push_back(oFeature);
 		}

+ 7 - 7
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

@@ -3099,7 +3099,7 @@ BOOL COTSBrukerImpl::SetXRayPoints(CPosXraysList& a_listXrayPois, const DWORD a_
 	return TRUE;
 }
 
-BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<BrukerFeature>& a_vFeatures, DWORD a_nACTimeMS)
+BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<BrukerFeature> a_vFeatures, DWORD a_nACTimeMS)
 {
 	// bruker dll handle check
 	ASSERT(m_pBrukerDllHandle);
@@ -3126,12 +3126,12 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<Br
 	}
 
 	// set SEM to external
-	if (!SetSEMExternalOn())
-	{
-		// failed to call SetSEMExternalOn method
-		LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPointsByFeatures: failed to call SetSEMExternalOn method."));
-		return FALSE;
-	}
+	//if (!SetSEMExternalOn())
+	//{
+	//	// failed to call SetSEMExternalOn method
+	//	LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPointsByFeatures: failed to call SetSEMExternalOn method."));
+	//	return FALSE;
+	//}
 
 	// create array of BrukerSegment
 	long nCollectCount = (long)a_vXPoints.size();

+ 1 - 1
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.h

@@ -143,7 +143,7 @@ namespace OTSController {
 		// m_bDoQuantification should be set first. 
 		BOOL GetXRayByPoints(CPosXraysList& a_listXrayPois, DWORD a_nACTimeMS);
 		BOOL SetXRayPoints(CPosXraysList& a_listXrayPois, const DWORD a_nACTimeMS);
-		BOOL GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<BrukerFeature>& a_vFeatures, DWORD a_nACTimeMS);
+		BOOL GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<BrukerFeature> a_vFeatures, DWORD a_nACTimeMS);
 		BOOL SetXRayPointsByFeature(CPosXraysList& a_vXPoints, const DWORD a_nACTimeMS);
 	protected:
 		// close client