|
@@ -14,7 +14,7 @@ namespace OTSModelSharp.ServiceCenter
|
|
|
public class CClassifyEngine : IClassifyEngine
|
|
|
{
|
|
|
COTSClassifyEngineClr myEng;
|
|
|
-
|
|
|
+ bool ifWeightPercentageToAtomicPercentage;
|
|
|
|
|
|
public bool ClassifyIncA(COTSParticleClr particle, int steelTech)
|
|
|
{
|
|
@@ -48,6 +48,9 @@ namespace OTSModelSharp.ServiceCenter
|
|
|
libName = libName + ".db";
|
|
|
}
|
|
|
myEng = new COTSClassifyEngineClr(EngineType.ExpressionClassifyEng, libName);
|
|
|
+ ifWeightPercentageToAtomicPercentage = FileHelper.GetIfTranslateWeightPercentageToAtomicPercentage();
|
|
|
+
|
|
|
+
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -68,6 +71,24 @@ namespace OTSModelSharp.ServiceCenter
|
|
|
|
|
|
public bool ClassifyByExpression(COTSParticleClr particle)
|
|
|
{
|
|
|
+ if (ifWeightPercentageToAtomicPercentage==true)
|
|
|
+ {
|
|
|
+ double sumMolar=0;
|
|
|
+
|
|
|
+ foreach (var ele in particle.GetXray().GetElementQuantifyData())
|
|
|
+ {
|
|
|
+ sumMolar += ele.GetMolarPercentage();
|
|
|
+
|
|
|
+ }
|
|
|
+ foreach (var ele in particle.GetXray().GetElementQuantifyData())
|
|
|
+ {
|
|
|
+ ele.SetPercentage(ele.GetMolarPercentage() / sumMolar);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
return myEng.ClassifyByExpression(particle);
|
|
|
}
|
|
|
}
|