123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using OTSCLRINTERFACE;
- using OTSModelSharp.ServiceCenter;
- namespace OTSModelSharp
- {
- using OTSDataType;
- using static OTSDataType.otsdataconst;
- class CSmplMeasureCleanliness : CSmplMeasure
- {
- public CSmplMeasureCleanliness(string a_strWorkingFolder, COTSSample a_pSample):base(a_strWorkingFolder,a_pSample)
- {
- SetWorkingFolder(a_strWorkingFolder);
- SetSample(a_pSample);
- m_classifyEngine = new CClassifyEngine();
- }
-
-
-
- public override void ClassifyFieldParticles(COTSFieldData curFldData)
- {
-
- try
- {
-
- string libname = m_Sample.GetMsrParams().GetSTDName();
- if (libname != "NoSTDDB")
- {
- log.Info("Begin to classify big particles!Using " + libname);
- var parts = curFldData.GetListAnalysisParticles();
- ClassifyParticles(parts,libname);
- //var smallParts = curFldData.ListSmallParticles;
- //ClassifyQuantifyParticles(smallParts, libname);
-
- }
- }
- catch (Exception e)
- {
- log.Info("calcu the particle image property or classify failed. "+e.Message);
- }
- }
- public override void ClassifyMergedParticles(List<COTSParticleClr> mergedParts)
- {
-
- try
- {
-
- string libname = m_Sample.GetMsrParams().GetSTDName();
- if (libname != "NoSTDDB")
- {
- log.Info("Begin to classify big particles!Using " + libname);
-
- ClassifyParticles(mergedParts, libname);
-
-
- }
- }
- catch (Exception e)
- {
- log.Info("calcu the particle image property or classify failed. " + e.Message);
- }
-
- }
-
-
- public bool ClassifyParticles(List<COTSParticleClr> a_listAnalysisParticles, string libname)// classify particles
- {
- int nSize = (int)a_listAnalysisParticles.Count();
- // go through all analysis particles
- for (int i = 0; i < nSize; ++i)
- {
- COTSParticleClr pParticle = a_listAnalysisParticles[i];
-
- IClassifyEngine engine = m_classifyEngine.GetExpressionClassifyEngine(libname);
-
- if (!IsLowCounts(pParticle))
- {
- if (engine.ClassifyByExpressionTemporarySpectrum(pParticle))
- {
- if (pParticle.GetType() == (int)OTS_PARTICLE_TYPE.UNCLASSIFY)
- {
- m_EDSController.QuantifyXrayByPart(pParticle);
- engine.ClassifyByExpression(pParticle);
- }
-
- }
- }
-
- }
-
- return true;
- }
-
-
- }
- }
|