Parcourir la source

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

beijing il y a 1 an
Parent
commit
a93b1fd3a6
1 fichiers modifiés avec 12 ajouts et 13 suppressions
  1. 12 13
      OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

+ 12 - 13
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

@@ -2539,10 +2539,12 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXrayList& a_vXPoints, std::vector<Bru
 	long nCollectCount = (long)a_vXPoints.size();
 	long nTotalPixelCount = 0;
 
-
-	boost::scoped_array<SHORT*> pixelTimes(new SHORT *[nCollectCount]);
-	boost::scoped_array<BrukerDll::TFeatureData> features(new BrukerDll::TFeatureData[nCollectCount]);
+	SHORT* pixelTimes(new SHORT[nCollectCount]);
+	BrukerDll::PFeatureDataList features = new BrukerDll::TFeatureData[nCollectCount];
 	std::vector<BrukerDll::TSegment> extraSegments;
+	/*boost::scoped_array<SHORT*> pixelTimes(new SHORT *[nCollectCount]);
+	boost::scoped_array<BrukerDll::TFeatureData> features(new BrukerDll::TFeatureData[nCollectCount]);
+	std::vector<BrukerDll::TSegment> extraSegments;*/
 
 	for (size_t i = 0; i < nCollectCount; i++)
 	{
@@ -2552,12 +2554,12 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXrayList& a_vXPoints, std::vector<Bru
 		{
 			int segCount = features[i].SegmentCount;
 			auto ofeature = a_vFeatures[i];
-			features.get()->Segments = new BrukerDll::TSegment[segCount];
+			features->Segments = new BrukerDll::TSegment[segCount];
 			for (int j = 0; j < segCount; j++)
 			{
-				features.get()->Segments[j].XStart = ofeature.pSegment[j].XStart;
-				features.get()->Segments[j].XCount = ofeature.pSegment[j].XCount;
-				features.get()->Segments[j].Y = ofeature.pSegment[j].Y;
+				features->Segments[j].XStart = ofeature.pSegment[j].XStart;
+				features->Segments[j].XCount = ofeature.pSegment[j].XCount;
+				features->Segments[j].Y = ofeature.pSegment[j].Y;
 			}
 
 			// calculate pixel time
@@ -2568,9 +2570,7 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXrayList& a_vXPoints, std::vector<Bru
 			{
 				nPixelCount += ofeature.pSegment[j].XCount;
 			}
-			SHORT pt= (SHORT)(ceil((double)a_nACTimeMS * 1000.0 / (double)nPixelCount));
-			
-			pixelTimes[i] = &pt;
+			pixelTimes[i] = (WORD)(ceil((double)a_nACTimeMS * 1000.0 / (double)nPixelCount));
 
 			nTotalPixelCount += nPixelCount;
 		}
@@ -2585,15 +2585,14 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXrayList& a_vXPoints, std::vector<Bru
 			extraSegments[extraSegments.size() - 1].Y = a_vXPoints[i]->GetPosition().y;
 			features[i].SegmentCount = 1;
 			features[i].Segments = &extraSegments[extraSegments.size() - 1];
-			SHORT pt= (SHORT)(a_nACTimeMS * 1000);
-			pixelTimes[i] = &pt;
+			pixelTimes[i] = (WORD)(a_nACTimeMS * 1000);
 			
 		}
 	}
 
 	// ask bruker to collect a set of x-ray data
 
-	if (!StartFeatureListMeasurement(nCollectCount, features.get(), pixelTimes.get()))
+	if (!StartFeatureListMeasurement(nCollectCount, features, &pixelTimes))
 	{
 		// failed to call StartFeatureListMeasurement method
 		LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPointsByFeatures: failed to call StartFeatureListMeasurement method."));