|
@@ -9,6 +9,162 @@ namespace OTSClassifyEngine
|
|
|
{
|
|
|
|
|
|
using namespace OTSClassifyEngine;
|
|
|
+ const double MIN_ELEMENT_SUM = 0.02;
|
|
|
+ const long INC_DEFAULTSIZE = 100;
|
|
|
+ const long INC_ELEMENTSIZE_MIN = 0;
|
|
|
+ const CString STR_CONNECT = _T("-");
|
|
|
+ const CString STR_FE = _T("Fe");
|
|
|
+ const CString STR_C = _T("C");
|
|
|
+ const CString STR_SI = _T("Si");
|
|
|
+ const CString STR_O = _T("O");
|
|
|
+ const CString STR_SUL = _T("S");
|
|
|
+ const CString STR_N = _T("N");
|
|
|
+ const CString STR_CR = _T("Cr");
|
|
|
+ const double SIC_MOLAR_CUTOFF = 85.0;
|
|
|
+ const double FEO_MOLAR_CUTOFF = 85.0;
|
|
|
+
|
|
|
+ // key element
|
|
|
+ const long INC_KEY_ELEMENT_MAX = 4;
|
|
|
+ const double INC_KEY_ELEMENT_CUT_OFF = 0.02; // weight%
|
|
|
+ const double INC_KEY_ELEMENT_TOTAL_100 = 5.0; // total molar value
|
|
|
+ const CString INC_KEY_ELEMENT_NAMES[INC_KEY_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("S"),_T("N"),_T("O"),_T("C")
|
|
|
+ };
|
|
|
+
|
|
|
+ // sub element
|
|
|
+ const long INC_SUB_ELEMENT_MAX = 12;
|
|
|
+ const double INC_SUB_ELEMENT_CUT_OFF = 0.02; // weight%
|
|
|
+ const double INC_SUB_ELEMENT_TOTAL_100 = 5.0; // molar value
|
|
|
+ const CString INC_SUB_ELEMENT_NAMES[INC_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Mg"),_T("Al"),_T("Si"),_T("Ca"),_T("Ti"),_T("V"),_T("Mn"),_T("Zr"),_T("Nb"),_T("Mo"),_T("Ce"),_T("La")
|
|
|
+ };
|
|
|
+
|
|
|
+ // element 100 % molar value mapping cut off
|
|
|
+ const double ELEMENT_MAPPING_100MOLAR = 2.0;
|
|
|
+
|
|
|
+ // sulfur classification
|
|
|
+
|
|
|
+ const double MIN_SUL_MOLAR = ELEMENT_MAPPING_100MOLAR;
|
|
|
+ const double MIN_SUL_SUB_MOLAR = ELEMENT_MAPPING_100MOLAR;
|
|
|
+ const long INC_SUL_SUB_ELEMENT_MAX = 5;
|
|
|
+ const CString INC_SUL_SUB_ELEMENT_NAMES[INC_SUL_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Mn"),_T("Ca"),_T("Mg"),_T("Ce"),_T("La")
|
|
|
+ };
|
|
|
+ const CString INC_SULFILSES_NAMES[INC_SUL_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("MnS"),_T("CaS"),_T("MgS"),_T("Ce(La)2S3"),_T("Ce(La)2S3")
|
|
|
+ };
|
|
|
+ const double INC_SULFILSES_MAPPING_RATIO[INC_SUL_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ 1.0, 1.0, 1.0, 1.5, 1.5
|
|
|
+ };
|
|
|
+ const double SULFIDE_MOLAR_CUTOFF = 5.0;
|
|
|
+ const CString SULFIDE_STR = _T("Sulfide");
|
|
|
+
|
|
|
+ // O classification
|
|
|
+ const long INC_OXIDE_SUB_ELEMENT_MAX = 9;
|
|
|
+ const CString INC_OXIDE_SUB_ELEMENT_NAMES[INC_OXIDE_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Al"),_T("Mg"),_T("Si"),_T("Mn"),_T("Ca"),_T("Ce"),_T("Cr"),_T("Ti"),_T("La")
|
|
|
+ };
|
|
|
+ const CString INC_OXIDE_NAMES[INC_OXIDE_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Al2O3"),_T("MgO"),_T("SiO2"),_T("MnO"),_T("CaO"),_T("CeO"),_T("Oxide"),_T("Oxide"),_T("REOxide")
|
|
|
+ };
|
|
|
+ const double SIMPLE_OXIDE_MOLAR_CUTOFF = 90.0;
|
|
|
+ const long REOXIDE_KEY_ELEMENT_MAX = 2;
|
|
|
+ const CString REOXIDE_KEY_ELEMENT_NAMES[REOXIDE_KEY_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Ce"),_T("La")
|
|
|
+ };
|
|
|
+ const CString REOXIDE_STR = _T("REOxide");
|
|
|
+ const long REALOXIDE_SUB_ELEMENT_MAX = 2;
|
|
|
+ const CString REALOXIDE_SUB_ELEMENT_NAMES[REALOXIDE_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Si"),_T("Al")
|
|
|
+ };
|
|
|
+ const double REALOXIDE_ELEMELTS_MOLAR_CUTOFF = 90.0;
|
|
|
+ const CString REALOXIDE_STR = _T("REAlOxide");
|
|
|
+
|
|
|
+ const long SPINEL_KEY_ELEMENT_MAX = 2;
|
|
|
+ const double REALOXIDE_ELEMENT_MOLAR_LOW_CUTOFF = 20;
|
|
|
+ const CString SPINEL_KEY_ELEMENT_NAMES[SPINEL_KEY_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Mg"),_T("Al")
|
|
|
+ };
|
|
|
+ const double SPINEL_KEY_ELEMENT_MOLAR_TOTAL = 90.0;
|
|
|
+ const double SPINEL_ELEMENT_RATIO_MIN = 1.6;
|
|
|
+ const double SPINEL_ELEMENT_RATIO_MAX = 2.4;
|
|
|
+ const CString SPINEL_STR = _T("Spinel");
|
|
|
+
|
|
|
+ const CString SILICATE_KEY_ELEMENT_NAME = _T("Si");
|
|
|
+ const double SILICATE_KEY_ELEMENT_MOLAR_TOTAL_MIN = 10.0;
|
|
|
+ const double SILICATE_KEY_ELEMENT_MOLAR_TOTAL_MAX = 90.0;
|
|
|
+ const CString SILICATE_STR = _T("Silicate");
|
|
|
+ const long ALUMINATE_KEY_ELEMENT_MAX = 2;
|
|
|
+ const CString ALUMINATE_KEY_ELEMENT_NAME[ALUMINATE_KEY_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Al"),_T("Ca")
|
|
|
+ };
|
|
|
+ const double ALUMINAT_KEY_ELEMENT_MOLAR_TOTAL_MIN = 10.0;
|
|
|
+ const double ALUMINAT_KEY_ELEMENT_MOLAR_TOTAL_MAX = 90.0;
|
|
|
+ const CString ALUMINATE12CaO_7Al2O3_STR = _T("12CaO-7Al2O3");
|
|
|
+ const CString ALUMINATE3CaO_Al2O3_STR = _T("3CaO-Al2O3");
|
|
|
+ const CString ALUMINATE_STR = _T("Aluminate");
|
|
|
+ const CString Ca_ALUMINATE_STR = _T("Ca-Aluminate");
|
|
|
+
|
|
|
+ const CString STR_OXIDE = _T("O");
|
|
|
+ const double MIN_OXIDE_MOLAR = 5.0;
|
|
|
+ const double MIN_OXIDE_SUB_MOLAR_TOTAL = 5.0;
|
|
|
+ const double MIN_OXIDE_SUB_MOLAR_CUTOFF = ELEMENT_MAPPING_100MOLAR;
|
|
|
+ const CString OXIDE_STR = _T("Oxide");
|
|
|
+
|
|
|
+ // nitrogen classification
|
|
|
+ const long INC_NITR_SUB_ELEMENT_MAX = 8;
|
|
|
+ const CString INC_NITR_SUB_ELEMENT_NAMES[INC_NITR_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Ti"),_T("V"),_T("Nb"),_T("Al"),_T("Zr"),_T("Cr"),_T("La"),_T("Ce")
|
|
|
+ };
|
|
|
+ const CString INC_NITR_NAMES[INC_NITR_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("TiN"),_T("VN"),_T("NbN"),_T("AlN"),_T("Nitride"),_T("Nitride"),_T("Nitride"),_T("Nitride")
|
|
|
+ };
|
|
|
+ const double INC_NITR_MAPPING_RATIO[INC_NITR_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0
|
|
|
+ };
|
|
|
+ const CString STR_NITR = _T("N");
|
|
|
+ const CString STR_Nb = _T("Nb");
|
|
|
+ const double MIN_NITR_MOLAR = ELEMENT_MAPPING_100MOLAR;
|
|
|
+ const double MIN_NITR_SUB_MOLAR = ELEMENT_MAPPING_100MOLAR;
|
|
|
+ const double NITRIDE_MOLAR_CUTOFF = 5.0;
|
|
|
+ const CString NITRIDE_STR = _T("Nitride");
|
|
|
+
|
|
|
+#pragma region ÐÂÌí¼ÓµÄ̼ÄÚÈÝ
|
|
|
+ // carbon classification
|
|
|
+ const long INC_CAR_SUB_ELEMENT_MAX = 1;
|
|
|
+ const CString INC_CAR_SUB_ELEMENT_NAMES[INC_CAR_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("Nb")
|
|
|
+ };
|
|
|
+ const CString INC_CAR_NAMES[INC_CAR_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ _T("NbC")
|
|
|
+ };
|
|
|
+ const double INC_CAR_MAPPING_RATIO[INC_CAR_SUB_ELEMENT_MAX] =
|
|
|
+ {
|
|
|
+ 1.0
|
|
|
+ };
|
|
|
+ const CString STR_CAR = _T("C");
|
|
|
+ const double MIN_CAR_MOLAR = ELEMENT_MAPPING_100MOLAR;
|
|
|
+ const double MIN_CAR_SUB_MOLAR = ELEMENT_MAPPING_100MOLAR;
|
|
|
+ const double CARBON_MOLAR_CUTOFF = 5.0;
|
|
|
+ const CString CARBON_STR = _T("Carbon");
|
|
|
+#pragma endregion
|
|
|
+
|
|
|
|
|
|
COTSClassifyEng::COTSClassifyEng(CInclutionSTDDataPtr a_pPartSTDData) // constructor
|
|
|
{
|
|
@@ -42,40 +198,27 @@ namespace OTSClassifyEngine
|
|
|
// something wrong
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("CClassifyEng::NitrideClassify: failed to call GetClassifySTDItem method."));
|
|
|
}
|
|
|
- // get user STD items
|
|
|
|
|
|
- //if (!GetClassifySTDItem(a_pPartSTDData, INC_CLASSIFY_TYPE::USER, listUserSTD))
|
|
|
- //{
|
|
|
- // // something wrong
|
|
|
- // LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::OxideClassify: failed to call GetClassifySTDItem method."));
|
|
|
- //
|
|
|
- //}
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
COTSClassifyEng::~COTSClassifyEng() // detractor
|
|
|
{
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//Dispose ClassifyXray
|
|
|
BOOL COTSClassifyEng::ClassifyXray( STEEL_TECHNOLOGY steelTech, CElementChemistriesList& a_listElementChemistries, int& a_nIncId, int& a_GrpId)
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
// the element chemistries list is an inclusion
|
|
|
- CElementChemistriesList listElChemsInc;
|
|
|
CElementChemistriesList listElChemsIncNoFe;
|
|
|
-
|
|
|
- double dMolarSum = 0.0f;
|
|
|
+
|
|
|
double dMolarSumNoFe = 0.0f;
|
|
|
OTS_PARTICLE_TYPE incId;
|
|
|
NOT_INCLUTION_ID notAIncId;// is not an inc but we can identify
|
|
|
- if (!IsAnValidIncXRay(a_listElementChemistries, listElChemsInc, listElChemsIncNoFe, dMolarSum, dMolarSumNoFe, incId, notAIncId))
|
|
|
+ if (!FilterInvalidIncXRay(a_listElementChemistries, listElChemsIncNoFe,dMolarSumNoFe, incId, notAIncId))
|
|
|
{
|
|
|
-
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::failed to call IsAnValidIncXRay"));
|
|
|
-
|
|
|
return FALSE;
|
|
|
}
|
|
|
if (incId == OTS_PARTCLE_TYPE::ISNOT_INCLUTION)// this is not an inclution particle,but we can identify.
|
|
@@ -113,14 +256,6 @@ namespace OTSClassifyEngine
|
|
|
return TRUE;
|
|
|
}
|
|
|
|
|
|
- // user STD classification
|
|
|
- /*if (!UserClassify(a_pPartSTDData, listElChemsInc, dMolarSum, nIncId))
|
|
|
- {
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call UserClassify method."));
|
|
|
- a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
|
|
|
- return FALSE;
|
|
|
- }*/
|
|
|
-
|
|
|
// identified?
|
|
|
if (nIncId > (int)OTS_PARTICLE_TYPE::IDENTIFIED)
|
|
|
{
|
|
@@ -142,22 +277,14 @@ namespace OTSClassifyEngine
|
|
|
|
|
|
// public
|
|
|
// check if the x-ray is an inc x-ray,
|
|
|
- BOOL COTSClassifyEng::IsAnValidIncXRay(
|
|
|
- CElementChemistriesList& a_listElementChemistries,
|
|
|
- CElementChemistriesList& a_listElChemsInc,
|
|
|
- CElementChemistriesList& a_listElChemsIncNoFe,
|
|
|
- double& a_dMolarSum,
|
|
|
+ BOOL COTSClassifyEng::FilterInvalidIncXRay(CElementChemistriesList a_listElementChemistries,
|
|
|
+ CElementChemistriesList& a_listElChemsIncNoFe,
|
|
|
double& a_dMolarSumNoFe,
|
|
|
OTS_PARTICLE_TYPE& a_nIncId,
|
|
|
NOT_INCLUTION_ID& notIncId)
|
|
|
{
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
// go through all elementS
|
|
|
- a_listElChemsInc.clear();
|
|
|
a_listElChemsIncNoFe.clear();
|
|
|
- a_dMolarSum = 0;
|
|
|
a_dMolarSumNoFe = 0;
|
|
|
double dSumKeyElements = 0;
|
|
|
double dSumSubElements = 0;
|
|
@@ -179,14 +306,14 @@ namespace OTSClassifyEngine
|
|
|
double dMolarPercentage = pElChem->GetMolarPercentage();
|
|
|
|
|
|
// cal molar percentage sum (both lists)
|
|
|
- a_dMolarSum += dMolarPercentage;
|
|
|
+
|
|
|
a_dMolarSumNoFe += dMolarPercentage;
|
|
|
|
|
|
// cal key element molar percentage sum
|
|
|
dSumKeyElements += dMolarPercentage;
|
|
|
|
|
|
// add the element into the two lists
|
|
|
- a_listElChemsInc.push_back(pElChemNew);
|
|
|
+
|
|
|
a_listElChemsIncNoFe.push_back(pElChemNew);
|
|
|
|
|
|
if (pElChem->GetName().CompareNoCase(STR_O) == 0)
|
|
@@ -206,23 +333,17 @@ namespace OTSClassifyEngine
|
|
|
// get molar percentage of this element
|
|
|
double dMolarPercentage = pElChem->GetMolarPercentage();
|
|
|
|
|
|
- // cal molar percentage sum list
|
|
|
- a_dMolarSum += dMolarPercentage;
|
|
|
-
|
|
|
- // cal key element molar percentage sum
|
|
|
- dSumSubElements += dMolarPercentage;
|
|
|
-
|
|
|
- // add the element into the list
|
|
|
- a_listElChemsInc.push_back(pElChemNew);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
// cal molar percentage sum list (no Fe)
|
|
|
a_dMolarSumNoFe += pElChem->GetMolarPercentage();
|
|
|
+ // cal key element molar percentage sum
|
|
|
+ dSumSubElements += dMolarPercentage;
|
|
|
|
|
|
+
|
|
|
// add the element into the list (no Fe)
|
|
|
a_listElChemsIncNoFe.push_back(pElChemNew);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// Si
|
|
|
if (pElChem->GetName().CompareNoCase(STR_SI) == 0)
|
|
@@ -262,7 +383,7 @@ namespace OTSClassifyEngine
|
|
|
if (dOMolar > MIN_DOUBLE_VALUE)
|
|
|
{
|
|
|
// calculate molar % of Fe + O
|
|
|
- double dMolarFe_O = Cal100NorValue(dOMolar + dFeMolar, a_dMolarSum + dCarbonMolar);
|
|
|
+ double dMolarFe_O = Cal100NorValue(dOMolar + dFeMolar, a_dMolarSumNoFe + dCarbonMolar);
|
|
|
if (dMolarFe_O > FEO_MOLAR_CUTOFF)
|
|
|
{
|
|
|
if (a_listElementChemistries.size() == 2)//there is only Fe and O
|
|
@@ -386,12 +507,6 @@ namespace OTSClassifyEngine
|
|
|
double dOWeight = 0;
|
|
|
double dSWeight = 0;
|
|
|
double dNWeight = 0;
|
|
|
- /*double weightsum=0;
|
|
|
- for (auto ele : a_listElChemsIncNoFe)
|
|
|
- {
|
|
|
- weightsum += ele->GetPercentage();
|
|
|
-
|
|
|
- }*/
|
|
|
|
|
|
auto stdItm =pPartSTDData->GetSTDItemById( incId);
|
|
|
if (incId == (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED)
|
|
@@ -587,7 +702,6 @@ namespace OTSClassifyEngine
|
|
|
int& a_nIncId)
|
|
|
{
|
|
|
|
|
|
-
|
|
|
// check if element chemistries list contain any sulfur
|
|
|
CElementChemistryPtr pSulElChem = GetNamedElementChemistry(a_listElChemsIncNoFe, STR_SUL);
|
|
|
if (!pSulElChem)
|
|
@@ -608,203 +722,38 @@ namespace OTSClassifyEngine
|
|
|
|
|
|
// this is a sulfide
|
|
|
|
|
|
- // any sulfides STD items
|
|
|
- if (listSulfideSTD.empty())
|
|
|
+ if (listSulfideSTD.empty())// any sulfides STD items
|
|
|
{
|
|
|
// no sulfides std items. can't identify sulfide
|
|
|
-
|
|
|
// can't identify this inclusion
|
|
|
a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
|
|
|
return TRUE;
|
|
|
}
|
|
|
|
|
|
// mapping Mn first
|
|
|
+ double dSulRemain;
|
|
|
BOOL bMnMapped = FALSE;
|
|
|
{
|
|
|
- CElementChemistryPtr pElChemMn = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[0]);
|
|
|
+ CString strMn = INC_SUL_SUB_ELEMENT_NAMES[0];
|
|
|
double dMappingRatio = INC_SULFILSES_MAPPING_RATIO[0];
|
|
|
- if (pElChemMn)
|
|
|
- {
|
|
|
- // there Mn in the element list, map S & Mn
|
|
|
- if (!ElementsMapping(a_dMolarSumNoFe, dMappingRatio, pElChemMn, pSulElChem, bMnMapped))
|
|
|
- {
|
|
|
- // something is wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: failed to call ElementsMapping method."));
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // need to re-calculate sulfur 100% molar value if Mn mapped
|
|
|
- if(bMnMapped)
|
|
|
- {
|
|
|
- dSulMolar100 = Cal100NorValue(pSulElChem->GetMolarPercentage(), a_dMolarSumNoFe);
|
|
|
+ bMnMapped = ElementMatching(a_dMolarSumNoFe, a_listElChemsIncNoFe, pSulElChem, strMn, dMappingRatio, dSulRemain);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// process mapping if sulfur amount enough
|
|
|
- CElementChemistriesList listChemistriesToAnalysis;
|
|
|
+
|
|
|
CString strProMappingSulName = _T("");
|
|
|
- BOOL bProMapped = FALSE;
|
|
|
- if (dSulMolar100 > MIN_SUL_MOLAR)
|
|
|
+ BOOL bSteelTechMapped = FALSE;
|
|
|
+ if (dSulRemain > MIN_SUL_MOLAR)// still have enough sulfur, mapping Ca, Mg or Ce, La
|
|
|
{
|
|
|
- // still have enough sulfur, mapping Ca, Mg or Ce, La
|
|
|
- double dMappingRadio;
|
|
|
- switch ( steelTech)
|
|
|
- {
|
|
|
- // Ca process
|
|
|
- case STEEL_TECHNOLOGY::CaProcessMode:
|
|
|
- {
|
|
|
- //remove the Mg element first
|
|
|
- CElementChemistryPtr pElChemMg = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[2]);
|
|
|
-
|
|
|
- if (pElChemMg)
|
|
|
- {
|
|
|
- for (auto el : a_listElChemsIncNoFe)
|
|
|
- {
|
|
|
- if (!el->GetName().CompareNoCase(INC_SUL_SUB_ELEMENT_NAMES[2]))
|
|
|
- {
|
|
|
- listChemistriesToAnalysis.push_back(el);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
- }
|
|
|
- // try to get Ca element chemistry
|
|
|
- CElementChemistryPtr pElChemCa = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[1]);
|
|
|
- if (pElChemCa)
|
|
|
- {
|
|
|
- // there Ca in the element list, map Ca & S
|
|
|
- dMappingRadio = INC_SULFILSES_MAPPING_RATIO[1];
|
|
|
- if (!ElementsMapping(a_dMolarSumNoFe, dMappingRadio, pElChemCa, pSulElChem, bProMapped))
|
|
|
- {
|
|
|
- // something is wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: failed to call ElementsMapping method."));
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
+ FilterOnSteelTech(steelTech, a_listElChemsIncNoFe);
|
|
|
|
|
|
- // mapping successful?
|
|
|
- if (bProMapped)
|
|
|
- {
|
|
|
- strProMappingSulName = INC_SULFILSES_NAMES[1];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- // Mg process
|
|
|
- case STEEL_TECHNOLOGY::MgProcessMode:
|
|
|
- {
|
|
|
- //remove the Ca element first
|
|
|
- CElementChemistryPtr pElChemCa = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[1]);
|
|
|
-
|
|
|
- if (pElChemCa)
|
|
|
- {
|
|
|
- for (auto el : a_listElChemsIncNoFe)
|
|
|
- {
|
|
|
- if (!el->GetName().CompareNoCase(INC_SUL_SUB_ELEMENT_NAMES[1]))
|
|
|
- {
|
|
|
- listChemistriesToAnalysis.push_back(el);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
- }
|
|
|
- // try to get Mg element chemistry
|
|
|
- CElementChemistryPtr pElChemMg = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[2]);
|
|
|
- if (pElChemMg)
|
|
|
- {
|
|
|
- // there Mg in the element list, map Mg & S
|
|
|
- dMappingRadio = INC_SULFILSES_MAPPING_RATIO[2];
|
|
|
- if (!ElementsMapping(a_dMolarSumNoFe, dMappingRadio, pElChemMg, pSulElChem, bProMapped))
|
|
|
- {
|
|
|
- // something is wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: failed to call ElementsMapping method."));
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
-
|
|
|
- // mapping successful?
|
|
|
- if (bProMapped)
|
|
|
- {
|
|
|
- strProMappingSulName = INC_SULFILSES_NAMES[2];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- // real earth elements process
|
|
|
- case STEEL_TECHNOLOGY::RareEarthMode:
|
|
|
- {
|
|
|
- listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
- // try to get Ce element chemistry
|
|
|
- CElementChemistryPtr pElChemCe = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[3]);
|
|
|
- BOOL bCeMapped = FALSE;
|
|
|
- if (pElChemCe)
|
|
|
- {
|
|
|
- // there Ce in the element list, map S with Ce
|
|
|
- dMappingRadio = INC_SULFILSES_MAPPING_RATIO[3];
|
|
|
- if (!ElementsMapping(a_dMolarSumNoFe, dMappingRadio, pElChemCe, pSulElChem, bCeMapped))
|
|
|
- {
|
|
|
- // something is wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: failed to call ElementsMapping method."));
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // try to get La element chemistry
|
|
|
- CElementChemistryPtr pElChemLa = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[4]);
|
|
|
- BOOL bLaMapped = FALSE;
|
|
|
- if (pElChemLa)
|
|
|
- {
|
|
|
- // there La in the element list, map S with La
|
|
|
- dMappingRadio = INC_SULFILSES_MAPPING_RATIO[4];
|
|
|
- if (!ElementsMapping(a_dMolarSumNoFe, dMappingRadio, pElChemLa, pSulElChem, bLaMapped))
|
|
|
- {
|
|
|
- // something is wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: failed to call ElementsMapping method."));
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // mapped both
|
|
|
- if (bCeMapped && bLaMapped)
|
|
|
- {
|
|
|
- strProMappingSulName = INC_SULFILSES_NAMES[3] + STR_CONNECT + INC_SULFILSES_NAMES[4];
|
|
|
- bProMapped = TRUE;
|
|
|
- }
|
|
|
- else if (bCeMapped)
|
|
|
- {
|
|
|
- strProMappingSulName = INC_SULFILSES_NAMES[3];
|
|
|
- bProMapped = TRUE;
|
|
|
- }
|
|
|
- else if (bLaMapped)
|
|
|
- {
|
|
|
- strProMappingSulName = INC_SULFILSES_NAMES[4];
|
|
|
- bProMapped = TRUE;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
- break;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
+ bSteelTechMapped = ElementMatchingOnSteelTech(a_dMolarSumNoFe, steelTech, a_listElChemsIncNoFe, pSulElChem, strProMappingSulName);
|
|
|
}
|
|
|
+
|
|
|
|
|
|
// set sulfide base name
|
|
|
CString strSulfideBaseName = _T("");
|
|
|
- if (bMnMapped && bProMapped)
|
|
|
+ if (bMnMapped && bSteelTechMapped)
|
|
|
{
|
|
|
// both Mn and process mapped
|
|
|
strSulfideBaseName = INC_SULFILSES_NAMES[0] + strProMappingSulName;
|
|
@@ -814,7 +763,7 @@ namespace OTSClassifyEngine
|
|
|
// Mn mapped only
|
|
|
strSulfideBaseName = INC_SULFILSES_NAMES[0];
|
|
|
}
|
|
|
- else if (bProMapped)
|
|
|
+ else if (bSteelTechMapped)
|
|
|
{
|
|
|
// process mapped only
|
|
|
strSulfideBaseName = strProMappingSulName;
|
|
@@ -837,7 +786,7 @@ namespace OTSClassifyEngine
|
|
|
|
|
|
// check if the rest element chemistries map an oxide
|
|
|
int nIncId = (int)OTS_PARTICLE_TYPE::INVALID;
|
|
|
- if (!OxideClassify(listChemistriesToAnalysis, a_dMolarSumNoFe, nIncId))
|
|
|
+ if (!OxideClassify(a_listElChemsIncNoFe, a_dMolarSumNoFe, nIncId))
|
|
|
{
|
|
|
// something wrong
|
|
|
LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: failed to call OxideClassify method."));
|
|
@@ -923,6 +872,86 @@ namespace OTSClassifyEngine
|
|
|
a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
|
|
|
return TRUE;
|
|
|
}
|
|
|
+ nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
|
|
|
+ if (!NitrideClassify(a_listElChemsIncNoFe, a_dMolarSumNoFe, nIncId))
|
|
|
+ {
|
|
|
+ // something wrong
|
|
|
+ LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call NitrideClassify method."));
|
|
|
+ a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+ if (nIncId >= (int)OTS_PARTICLE_TYPE::IDENTIFIED)
|
|
|
+ {
|
|
|
+ CSTDItemPtr pNitrideTDItem = pPartSTDData->GetSTDItemById(nIncId);
|
|
|
+ if (pNitrideTDItem)
|
|
|
+ {// get mapped oxide name
|
|
|
+ CString strNitrideName = pNitrideTDItem->GetName();
|
|
|
+
|
|
|
+ // oxide sulfide name: oxide + "-" + sulfide base string
|
|
|
+ CString strNitride_SulName = strNitrideName + STR_CONNECT + strSulfideBaseName;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ CSTDItemPtr pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ a_nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // rename the oxide sulfide name as "Oxide" + "-" + sulfide base string
|
|
|
+ strNitride_SulName = NITRIDE_STR + STR_CONNECT + strSulfideBaseName;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ a_nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // rename the oxide sulfide name as strOxideName + "-" + "Sulfide"
|
|
|
+ strNitride_SulName = strNitrideName + STR_CONNECT + SULFIDE_STR;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ a_nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // rename the oxide sulfide name as "Oxide" + "-" + "Sulfide"
|
|
|
+ strNitride_SulName = NITRIDE_STR + STR_CONNECT + SULFIDE_STR;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ a_nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // rename the oxide sulfide name as "Sulfide"
|
|
|
+ strNitride_SulName = SULFIDE_STR;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ a_nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// this is a general sulfide
|
|
|
|
|
@@ -1534,31 +1563,6 @@ namespace OTSClassifyEngine
|
|
|
}
|
|
|
|
|
|
|
|
|
- //// user STD items classification
|
|
|
- //BOOL COTSClassifyEng::UserClassify(
|
|
|
- // CElementChemistriesList& a_listEltChemsInc,
|
|
|
- // double dSum,
|
|
|
- // int& a_nIncId)
|
|
|
- //{
|
|
|
- //
|
|
|
- //
|
|
|
-
|
|
|
- // // try to identify the oxide
|
|
|
- // for (auto pUserSTD : listUserSTD)
|
|
|
- // {
|
|
|
- // // matching STD?
|
|
|
- // if (MatchingSTD(a_listEltChemsInc, pUserSTD, dSum))
|
|
|
- // {
|
|
|
- // // found matching STD
|
|
|
- // a_nIncId = pUserSTD->GetSTDId();
|
|
|
- // return TRUE;
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // // can't identify this inclusion
|
|
|
- // a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
|
|
|
- // return TRUE;
|
|
|
- //}
|
|
|
|
|
|
// nominate element chemistries list
|
|
|
BOOL COTSClassifyEng::NomiNateElChemsList( CElementChemistriesList& a_listElChemsInc,
|
|
@@ -1799,6 +1803,271 @@ namespace OTSClassifyEngine
|
|
|
return TRUE;
|
|
|
}
|
|
|
|
|
|
+ BOOL COTSClassifyEng::GetNitrideItemString(CElementChemistriesList& listChemistriesToAnalysis, double a_dMolarSumNoFe, CString strSulfideBaseName, CString& a_STDItemStr)
|
|
|
+ {
|
|
|
+ int nIncId;
|
|
|
+ if (!NitrideClassify(listChemistriesToAnalysis, a_dMolarSumNoFe, nIncId))
|
|
|
+ {
|
|
|
+ // something wrong
|
|
|
+ LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call NitrideClassify method."));
|
|
|
+ nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // mapped?
|
|
|
+ if (nIncId >= (int)OTS_PARTICLE_TYPE::IDENTIFIED)
|
|
|
+ {
|
|
|
+ // this is an oxide sulfide
|
|
|
+
|
|
|
+ // confirm the oxide sulfide id
|
|
|
+
|
|
|
+ // get the STD item of the mapped oxide
|
|
|
+ CSTDItemPtr pNitrideSTDItem = pPartSTDData->GetSTDItemById(nIncId);
|
|
|
+ if (pNitrideSTDItem)
|
|
|
+ {
|
|
|
+ // get mapped oxide name
|
|
|
+ CString strNitrideName = pNitrideSTDItem->GetName();
|
|
|
+
|
|
|
+ // oxide sulfide name: oxide + "-" + sulfide base string
|
|
|
+ CString strNitride_SulName = strNitrideName + STR_CONNECT + strSulfideBaseName;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ CSTDItemPtr pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // rename the oxide sulfide name as "Oxide" + "-" + sulfide base string
|
|
|
+ strNitride_SulName = NITRIDE_STR + STR_CONNECT + strSulfideBaseName;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // rename the oxide sulfide name as strOxideName + "-" + "Sulfide"
|
|
|
+ strNitride_SulName = strNitrideName + STR_CONNECT + SULFIDE_STR;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // rename the oxide sulfide name as "Oxide" + "-" + "Sulfide"
|
|
|
+ strNitride_SulName = OXIDE_STR + STR_CONNECT + SULFIDE_STR;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ // rename the oxide sulfide name as "Sulfide"
|
|
|
+ strNitride_SulName = SULFIDE_STR;
|
|
|
+
|
|
|
+ // try to find the STD item
|
|
|
+ pNitrideSulSTDItem = GetSTDItemByName(listSulfideSTD, strNitride_SulName);
|
|
|
+ if (pNitrideSulSTDItem)
|
|
|
+ {
|
|
|
+ // found the STD item
|
|
|
+ nIncId = pNitrideSulSTDItem->GetSTDId();
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // can't identify this inclusion
|
|
|
+ nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ void COTSClassifyEng::FilterOnSteelTech(STEEL_TECHNOLOGY steelTech, CElementChemistriesList& a_listElChemsIncNoFe)
|
|
|
+ {
|
|
|
+ CElementChemistriesList listChemistriesToAnalysis;
|
|
|
+ switch (steelTech)
|
|
|
+ {
|
|
|
+ // Ca process
|
|
|
+ case STEEL_TECHNOLOGY::CaProcessMode:
|
|
|
+ {
|
|
|
+ //remove the Mg element first
|
|
|
+ CElementChemistryPtr pElChemMg = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[2]);
|
|
|
+
|
|
|
+ if (pElChemMg)
|
|
|
+ {
|
|
|
+ for (auto el : a_listElChemsIncNoFe)
|
|
|
+ {
|
|
|
+ if (!el->GetName().CompareNoCase(INC_SUL_SUB_ELEMENT_NAMES[2]))
|
|
|
+ {
|
|
|
+ listChemistriesToAnalysis.push_back(el);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ // Mg process
|
|
|
+ case STEEL_TECHNOLOGY::MgProcessMode:
|
|
|
+ {
|
|
|
+ //remove the Ca element first
|
|
|
+ CElementChemistryPtr pElChemCa = GetNamedElementChemistry(a_listElChemsIncNoFe, INC_SUL_SUB_ELEMENT_NAMES[1]);
|
|
|
+
|
|
|
+ if (pElChemCa)
|
|
|
+ {
|
|
|
+ for (auto el : a_listElChemsIncNoFe)
|
|
|
+ {
|
|
|
+ if (!el->GetName().CompareNoCase(INC_SUL_SUB_ELEMENT_NAMES[1]))
|
|
|
+ {
|
|
|
+ listChemistriesToAnalysis.push_back(el);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ // real earth elements process
|
|
|
+ case STEEL_TECHNOLOGY::RareEarthMode:
|
|
|
+ {
|
|
|
+ listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ listChemistriesToAnalysis = a_listElChemsIncNoFe;
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ a_listElChemsIncNoFe = listChemistriesToAnalysis;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ BOOL COTSClassifyEng::ElementMatching(double a_dMolarSum,CElementChemistriesList a_listElChemsInc, CElementChemistryPtr KeyEleChemistry,CString subEleName,double mappingRatio, double& dKeyEleRemainMolar100)
|
|
|
+ {
|
|
|
+ BOOL bMapped = FALSE;
|
|
|
+ {
|
|
|
+ CElementChemistryPtr psubChem = GetNamedElementChemistry(a_listElChemsInc, subEleName);
|
|
|
+ double dMappingRatio = INC_SULFILSES_MAPPING_RATIO[0];
|
|
|
+ if (psubChem)
|
|
|
+ {
|
|
|
+ if (!ElementsMapping(a_dMolarSum, mappingRatio, psubChem, KeyEleChemistry, bMapped))
|
|
|
+ {
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // need to re-calculate 100% molar value if mapped
|
|
|
+ if (bMapped)
|
|
|
+ {
|
|
|
+ dKeyEleRemainMolar100 = Cal100NorValue(KeyEleChemistry->GetMolarPercentage(), a_dMolarSum);
|
|
|
+ }
|
|
|
+ return bMapped;
|
|
|
+ }
|
|
|
+
|
|
|
+ BOOL COTSClassifyEng::ElementMatchingOnSteelTech(double a_dMolarSumNoFe,STEEL_TECHNOLOGY steelTech, CElementChemistriesList a_listElChemsIncNoFe, CElementChemistryPtr pSulElChem,CString& strProMappingSulName)
|
|
|
+ {
|
|
|
+ BOOL bProMapped=false;
|
|
|
+ double dSulResidual;
|
|
|
+ switch (steelTech)
|
|
|
+ {
|
|
|
+ case STEEL_TECHNOLOGY::CaProcessMode:
|
|
|
+ {
|
|
|
+ BOOL bCaMapped = FALSE;
|
|
|
+ {
|
|
|
+ CString strEle = INC_SUL_SUB_ELEMENT_NAMES[1];
|
|
|
+ double dMappingRatio = INC_SULFILSES_MAPPING_RATIO[1];
|
|
|
+ bCaMapped = ElementMatching(a_dMolarSumNoFe, a_listElChemsIncNoFe, pSulElChem, strEle, dMappingRatio, dSulResidual);
|
|
|
+ }
|
|
|
+ bProMapped = bCaMapped;
|
|
|
+ if (bProMapped)
|
|
|
+ {
|
|
|
+ strProMappingSulName = INC_SULFILSES_NAMES[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case STEEL_TECHNOLOGY::MgProcessMode:
|
|
|
+ {
|
|
|
+ BOOL bMgMapped = FALSE;
|
|
|
+ {
|
|
|
+ CString strEle = INC_SUL_SUB_ELEMENT_NAMES[2];
|
|
|
+ double dMappingRatio = INC_SULFILSES_MAPPING_RATIO[2];
|
|
|
+ bMgMapped = ElementMatching(a_dMolarSumNoFe, a_listElChemsIncNoFe, pSulElChem, strEle, dMappingRatio, dSulResidual);
|
|
|
+ }
|
|
|
+ bProMapped = bMgMapped;
|
|
|
+ if (bProMapped)
|
|
|
+ {
|
|
|
+ strProMappingSulName = INC_SULFILSES_NAMES[2];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case STEEL_TECHNOLOGY::RareEarthMode:
|
|
|
+ {
|
|
|
+
|
|
|
+ BOOL bCeMapped = FALSE;
|
|
|
+ {
|
|
|
+ CString strEle = INC_SUL_SUB_ELEMENT_NAMES[3];
|
|
|
+ double dMappingRatio = INC_SULFILSES_MAPPING_RATIO[3];
|
|
|
+ bCeMapped = ElementMatching(a_dMolarSumNoFe, a_listElChemsIncNoFe, pSulElChem, strEle, dMappingRatio, dSulResidual);
|
|
|
+ }
|
|
|
+
|
|
|
+ BOOL bLaMapped = FALSE;
|
|
|
+ {
|
|
|
+ CString strEle = INC_SUL_SUB_ELEMENT_NAMES[4];
|
|
|
+ double dMappingRatio = INC_SULFILSES_MAPPING_RATIO[4];
|
|
|
+ bLaMapped = ElementMatching(a_dMolarSumNoFe, a_listElChemsIncNoFe, pSulElChem, strEle, dMappingRatio, dSulResidual);
|
|
|
+ }
|
|
|
+ if (bCeMapped && bLaMapped)
|
|
|
+ {
|
|
|
+ strProMappingSulName = INC_SULFILSES_NAMES[3] + STR_CONNECT + INC_SULFILSES_NAMES[4];
|
|
|
+ bProMapped = TRUE;
|
|
|
+ }
|
|
|
+ else if (bCeMapped)
|
|
|
+ {
|
|
|
+ strProMappingSulName = INC_SULFILSES_NAMES[3];
|
|
|
+ bProMapped = TRUE;
|
|
|
+ }
|
|
|
+ else if (bLaMapped)
|
|
|
+ {
|
|
|
+ strProMappingSulName = INC_SULFILSES_NAMES[4];
|
|
|
+ bProMapped = TRUE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ return bProMapped;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// get STD item by name
|
|
|
CSTDItemPtr COTSClassifyEng::GetSTDItemByName(CSTDItemsList& a_listSTDItems, CString a_strName)
|
|
@@ -1841,29 +2110,15 @@ namespace OTSClassifyEngine
|
|
|
{
|
|
|
// safety check
|
|
|
ASSERT(a_pFirstElChem);
|
|
|
- if (!a_pFirstElChem)
|
|
|
- {
|
|
|
- // something wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ElementsMapping: invalid a_pFirstElChem."));
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
+
|
|
|
ASSERT(a_pSecondElChem);
|
|
|
- if (!a_pSecondElChem)
|
|
|
- {
|
|
|
- // something wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ElementsMapping: invalid a_pSecondElChem."));
|
|
|
- return FALSE;
|
|
|
- }
|
|
|
+
|
|
|
if (a_dMolarSumNoFe < MIN_ELEMENT_SUM)
|
|
|
{
|
|
|
- // something wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ElementsMapping: invalid molar sum value."));
|
|
|
return FALSE;
|
|
|
}
|
|
|
if (a_dMappingRatio < MIN_DOUBLE_VALUE)
|
|
|
{
|
|
|
- // something wrong
|
|
|
- LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ElementsMapping: invalid mapping radio value."));
|
|
|
return FALSE;
|
|
|
}
|
|
|
|