//using OTSDataType; using OTSModelSharp.ServiceCenter; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OTSModelSharp.ServiceCenter { using OTSCLRINTERFACE; public class CClassifyEngine : IClassifyEngine { COTSClassifyEngineClr myEng; public bool ClassifyIncA(COTSParticleClr particle, int steelTech) { bool r = myEng.ClassifyIncA(particle,steelTech);//the classify engine will return true; } public IClassifyEngine GetSpectrumCompareEngine(string libName) { if (!libName.Contains(".db")) { libName = libName + ".db"; } myEng = new COTSClassifyEngineClr(EngineType.SpectrumCompare, libName); return this; } public IClassifyEngine GetIncClassifyEngine() { myEng = new COTSClassifyEngineClr(EngineType.InclutionEng, ""); return this; } public IClassifyEngine GetExpressionClassifyEngine(string libName) { if (!libName.Contains(".db")) { libName = libName + ".db"; } myEng = new COTSClassifyEngineClr(EngineType.ExpressionClassifyEng, libName); return this; } public double IfNeedMaxEDS(COTSParticleClr particle) { return myEng.IfNeedMaxEDS(particle); } public bool ClassifyBySpectrum(COTSParticleClr particle) { return myEng.ClassifyBySpectrum(particle); } public bool ClassifyByExpressionTemporarySpectrum(COTSParticleClr particle) { return myEng.ClassifyByExpressionTemporarySpectrum(particle); } public bool ClassifyByExpression(COTSParticleClr particle) { return myEng.ClassifyByExpression(particle); } } }