| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using OTSCLRINTERFACE;
- using OTSDataType;
- using OTSMeasureApp._0_OTSModel.Measure.ParamData;
- using OTSModelSharp.Measure.OTSInclution;
- using OTSModelSharp.ServiceCenter;
- using OTSModelSharp.ServiceInterface;
- using static OTSDataType.otsdataconst;
- namespace OTSModelSharp
- {
- class CSmplMeasureInclution : CSmplMeasure
- {
-
-
- public CSmplMeasureInclution(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
- {
-
- var anylysisparts = curFldData.GetListAnalysisParticles();
- int nSize = anylysisparts.Count();
- // go through all analysis particles
- for (int i = 0; i < nSize; ++i)
- {
- string libname = m_Sample.GetMsrParams().GetSTDName();
- ClassifyIncAParticle(anylysisparts[i], libname);
- }
- }
- catch (Exception e)
- {
- log.Info(" classify failed. " + e.Message);
- }
- }
- public override void ClassifyMergedParticles(List<COTSParticleClr> mergedParts)
- {
- try
- {
-
- var quantifyparts = mergedParts;
- int nSize = quantifyparts.Count();
- // go through all analysis particles
- for (int i = 0; i < nSize; ++i)
- {
- string libname = m_Sample.GetMsrParams().GetSTDName();
- ClassifyIncAParticle(quantifyparts[i], libname);
- }
- }
- catch (Exception e)
- {
- log.Info("merged parts classify failed. " + e.Message);
- }
- }
- public bool ClassifyIncAParticle(COTSParticleClr particle, string libname)// classify particles
- {
- int steelTech = (int)m_Sample.GetMsrParams().GetSteelTechnology();
- particle.SetType((int)OTS_PARTCLE_TYPE.NOT_IDENTIFIED);
- if (m_Sample.GetMsrParams().GetSysSTDSwitch())
- {
- if (libname != "NoSTDDB")
- {
- //var m_classifyEngine = new CClassifyEngine();
- IClassifyEngine engine = m_classifyEngine.GetParticleEngine(libname);
- engine.Classify(particle);
- }
- if (particle.GetType() ==(int) OTS_PARTCLE_TYPE.NOT_IDENTIFIED)
- {
- IClassifyEngine engine;
- engine = m_classifyEngine.GetIncClassifyEngine();
- engine.ClassifyIncA(particle, steelTech);
- }
- }
- else
- {
- if (libname != "NoSTDDB")
- {
- //var m_classifyEngine = new CClassifyEngine();
- IClassifyEngine engine = m_classifyEngine.GetParticleEngine(libname);
- engine.Classify(particle);
- }
- }
-
- return true;
- }
-
-
-
- }
- }
|