|
|
@@ -476,86 +476,86 @@ namespace OTSModelSharp.MeasureControl
|
|
|
}
|
|
|
|
|
|
// classify particles
|
|
|
- public bool ClassifyParticles(List<COTSParticle> a_listAnalysisParticles, List<CPosXray> a_listAnalysisXRay)
|
|
|
- {
|
|
|
- // make sure the two lists are same size
|
|
|
- int nSize = (int)a_listAnalysisParticles.Count;
|
|
|
- if (nSize != (int)a_listAnalysisXRay.Count)
|
|
|
- {
|
|
|
- // particles list size is different with x-ray size
|
|
|
- loger.Error("ClassifyParticles: particles list size is different with x-ray size.");
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // go through all analysis particles
|
|
|
- for (int i = 0; i < nSize; ++i)
|
|
|
- {
|
|
|
- COTSParticle pParticle = a_listAnalysisParticles[i];
|
|
|
- CPosXray pXray = a_listAnalysisXRay[i];
|
|
|
-
|
|
|
- if (!ClassifyParticle(pParticle, pXray))
|
|
|
- {
|
|
|
- // failed to call ClassifyParticle method
|
|
|
- loger.Error("ClassifyParticles: failed to call ClassifyParticle method.");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // ok, return TRUE
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- public bool ClassifyParticle(COTSParticle a_pParticle, CPosXray a_pXRay)
|
|
|
- {
|
|
|
- //set the particle type to NOT_IDENTIFIED
|
|
|
- int nInclusionID = (int)OTS_PARTCLE_TYPE.NOT_IDENTIFIED;
|
|
|
-
|
|
|
- //// 1.get elementChemistries
|
|
|
- List< CElementChemistry> listElementChemistriesOld = a_pXRay.GetElementQuantifyData();
|
|
|
-
|
|
|
-
|
|
|
- //get the parameter MsrParam object
|
|
|
- CMsrParams pMsrParam = m_pSample.GetMsrParams();
|
|
|
- //get the steel technology parameter
|
|
|
- STEEL_TECHNOLOGY steelTech = pMsrParam.GetSteelTechnology();
|
|
|
- //get standard database item which will be used when classify.
|
|
|
- //CPartSTDDataPtr pPartSTDData = pMsrParam->GetPartSTDData();
|
|
|
- //int listSize = pPartSTDData->GetSTDItemsList().size();
|
|
|
- if (m_pSample.IfUsingSysSTD())
|
|
|
- {
|
|
|
-
|
|
|
- var IncAen = OTSClassifyEngine.GetInclutionEngine();
|
|
|
- if (!IncAen->Classify(a_pParticle, (int)steelTech, a_pXRay))
|
|
|
- {
|
|
|
- loger.Error("ClassifyParticle: can't identify the particle as any inclusion.");
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (a_pParticle.GetType() == (int)OTS_PARTCLE_TYPE.NOT_IDENTIFIED)
|
|
|
- {
|
|
|
- var ExpEn = OTSClassifyEngine.GetParticleEngine(m_pSample.GetMsrParams().GetSTDName());
|
|
|
- if (!ExpEn->Classify(a_pParticle, a_pXRay))
|
|
|
- {
|
|
|
- loger.Error("ClassifyParticle: can't identify the particle as any inclusion.");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var ExpEn = OTSClassifyEngine.GetParticleEngine(m_pSample.GetMsrParams().GetSTDName());
|
|
|
- if (!ExpEn->Classify(a_pParticle, a_pXRay))
|
|
|
- {
|
|
|
- loger.Error("ClassifyParticle: can't identify the particle as any inclusion.");
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- nInclusionID = a_pParticle.GetType();
|
|
|
-
|
|
|
-
|
|
|
- return true;
|
|
|
-
|
|
|
- }
|
|
|
+ //public bool ClassifyParticles(List<COTSParticle> a_listAnalysisParticles, List<CPosXray> a_listAnalysisXRay)
|
|
|
+ // {
|
|
|
+ // // make sure the two lists are same size
|
|
|
+ // int nSize = (int)a_listAnalysisParticles.Count;
|
|
|
+ // if (nSize != (int)a_listAnalysisXRay.Count)
|
|
|
+ // {
|
|
|
+ // // particles list size is different with x-ray size
|
|
|
+ // loger.Error("ClassifyParticles: particles list size is different with x-ray size.");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // // go through all analysis particles
|
|
|
+ // for (int i = 0; i < nSize; ++i)
|
|
|
+ // {
|
|
|
+ // COTSParticle pParticle = a_listAnalysisParticles[i];
|
|
|
+ // CPosXray pXray = a_listAnalysisXRay[i];
|
|
|
+
|
|
|
+ // if (!ClassifyParticle(pParticle, pXray))
|
|
|
+ // {
|
|
|
+ // // failed to call ClassifyParticle method
|
|
|
+ // loger.Error("ClassifyParticles: failed to call ClassifyParticle method.");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // // ok, return TRUE
|
|
|
+ // return true;
|
|
|
+ // }
|
|
|
+
|
|
|
+ //public bool ClassifyParticle(COTSParticle a_pParticle, CPosXray a_pXRay)
|
|
|
+ // {
|
|
|
+ // //set the particle type to NOT_IDENTIFIED
|
|
|
+ // int nInclusionID = (int)OTS_PARTCLE_TYPE.NOT_IDENTIFIED;
|
|
|
+
|
|
|
+ // //// 1.get elementChemistries
|
|
|
+ // List< CElementChemistry> listElementChemistriesOld = a_pXRay.GetElementQuantifyData();
|
|
|
+
|
|
|
+
|
|
|
+ // //get the parameter MsrParam object
|
|
|
+ // CMsrParams pMsrParam = m_pSample.GetMsrParams();
|
|
|
+ // //get the steel technology parameter
|
|
|
+ // STEEL_TECHNOLOGY steelTech = pMsrParam.GetSteelTechnology();
|
|
|
+ // //get standard database item which will be used when classify.
|
|
|
+ // //CPartSTDDataPtr pPartSTDData = pMsrParam->GetPartSTDData();
|
|
|
+ // //int listSize = pPartSTDData->GetSTDItemsList().size();
|
|
|
+ // if (m_pSample.IfUsingSysSTD())
|
|
|
+ // {
|
|
|
+
|
|
|
+ // var IncAen = OTSClassifyEngine.GetInclutionEngine();
|
|
|
+ // if (!IncAen->Classify(a_pParticle, (int)steelTech, a_pXRay))
|
|
|
+ // {
|
|
|
+ // loger.Error("ClassifyParticle: can't identify the particle as any inclusion.");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // if (a_pParticle.GetType() == (int)OTS_PARTCLE_TYPE.NOT_IDENTIFIED)
|
|
|
+ // {
|
|
|
+ // var ExpEn = OTSClassifyEngine.GetParticleEngine(m_pSample.GetMsrParams().GetSTDName());
|
|
|
+ // if (!ExpEn->Classify(a_pParticle, a_pXRay))
|
|
|
+ // {
|
|
|
+ // loger.Error("ClassifyParticle: can't identify the particle as any inclusion.");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // var ExpEn = OTSClassifyEngine.GetParticleEngine(m_pSample.GetMsrParams().GetSTDName());
|
|
|
+ // if (!ExpEn->Classify(a_pParticle, a_pXRay))
|
|
|
+ // {
|
|
|
+ // loger.Error("ClassifyParticle: can't identify the particle as any inclusion.");
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // nInclusionID = a_pParticle.GetType();
|
|
|
+
|
|
|
+
|
|
|
+ // return true;
|
|
|
+
|
|
|
+ // }
|
|
|
|
|
|
// system STD
|
|
|
bool IfUsingSysSTD() { return m_bSysSTD; }
|