Explorar el Código

fix the bug that thin grade and wide grade are always the same.

gsp hace 2 años
padre
commit
216c27d7fb

+ 3 - 3
OTSCPP/OTSRptCalculate/GBCal/CGBCalculate.cpp

@@ -960,7 +960,7 @@ namespace OTSGBCalculate
 		}
 
 		
-			pGBFieldData = NormalizeParticles(a_rectGBField, myOTSFields, a_sizePixelImage, nOTSFieldWidth, nOTSFieldHeight);
+			pGBFieldData = NormalizeParticlesAndIdentifyChemicalType(a_rectGBField, myOTSFields, a_sizePixelImage, nOTSFieldWidth, nOTSFieldHeight);
 			pGBFieldData->myReleventOTSFlds = myOTSFields;
 	
 		return pGBFieldData;
@@ -970,7 +970,7 @@ namespace OTSGBCalculate
 
 
 	// normalize particles for the GBFields
-	CGBFieldDataPtr CGBCalculate::NormalizeParticles(COTSRect a_rectGBField, COTSFieldDataList myOTSFields, CSize a_sizePixelImage, int nFieldWidth,int nFieldHeight)
+	CGBFieldDataPtr CGBCalculate::NormalizeParticlesAndIdentifyChemicalType(COTSRect a_rectGBField, COTSFieldDataList myOTSFields, CSize a_sizePixelImage, int nFieldWidth,int nFieldHeight)
 	{
 		// inits
 		CGBFieldDataPtr pGBFieldData(new CGBFieldData);
@@ -990,7 +990,7 @@ namespace OTSGBCalculate
 			for (auto part : OTSField->GetParticleList())
 			{
 				CPoint fieldPos = OTSField->GetPosition();
-				//CPoint fieldTopLeft = CPoint(fieldPos.x - nFieldWidth / 2, fieldPos.y + nFieldHeight/2);
+			
 				CPoint fieldTopLeft = OTSField->GetRect().GetTopLeft();
 				double fwidth = nFieldWidth;
 				double pixelsize = fwidth / a_sizePixelImage.cx;

+ 1 - 1
OTSCPP/OTSRptCalculate/GBCal/CGBCalculate.h

@@ -41,7 +41,7 @@ namespace OTSGBCalculate
 		//get the GB field within thr rectangle
 		CGBFieldDataPtr GetOneGBField(COTSRect a_rectGBField, COTSFieldDataList& a_listOTSFields, CSize sizePixelImage, int a_nFieldWidth, int nOTSFieldHeight);
 		//  normalize particles for the GBFields
-		CGBFieldDataPtr NormalizeParticles(COTSRect a_rectGBField, COTSFieldDataList a_listOTSFields, CSize sizePixelImage, int a_nFieldWidth, int a_nFieldHeight);
+		CGBFieldDataPtr NormalizeParticlesAndIdentifyChemicalType(COTSRect a_rectGBField, COTSFieldDataList a_listOTSFields, CSize sizePixelImage, int a_nFieldWidth, int a_nFieldHeight);
 
 		//计算一个数据源中所获得的GBFields转化的统计数据
 		CGridDatasList GetGridDataListForOneDataSource(CGBGradeData* gradeData, CALCULATE_TABLE_TYPE tableType);

+ 2 - 21
OTSCPP/OTSRptCalculate/GBCal/CGBLevel.cpp

@@ -153,7 +153,7 @@ namespace OTSGBCalculate
 		case GB_LEVEL_TYPE::A_TYPE:
 
 
-			for (auto pAparticle : m_GBField->listAThinParticles)
+			for (auto pAparticle : m_GBField->listAWideParticles)
 			{
 
 				double dLength = pAparticle->GetDMax();
@@ -167,7 +167,7 @@ namespace OTSGBCalculate
 		case  GB_LEVEL_TYPE::B_TYPE:
 
 			dLengthAll = 0;
-			for (auto pBparticle : m_GBField->listBThinParticles)
+			for (auto pBparticle : m_GBField->listBWideParticles)
 			{
 
 				double dLength = pBparticle->GetDMax();
@@ -266,26 +266,7 @@ namespace OTSGBCalculate
 
 		return GB_GRADE_TYPE::INVALID;
 	}
-	/*GB_GRADE_TYPE CGBLevel::GetMyDSGrade()
-	{
-		switch (m_nLevel)
-		{
-		case GB_LEVEL_TYPE::DS_TYPE:
-			double dFeretDiameterMax = 0;
-			for (auto pDSParticles : m_GBField->listDSParticles)
-			{
-				double dFeretDiameter = pDSParticles->GetFeretDiameter();
-				if (dFeretDiameter > dFeretDiameterMax)
-				{
-					dFeretDiameterMax = dFeretDiameter;
-				}
-			}
-			m_FeretDiameterMax = dFeretDiameterMax;
-			return	GetDSGrade(dFeretDiameterMax);
-		}
 
-		return GB_GRADE_TYPE::INVALID;
-	}*/
 
 	double CGBLevel::GetMaxFeretDiameter()
 	{