123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using OTSCLRINTERFACE;
- using OTSModelSharp.ServiceCenter;
- using System.Collections.Generic;
- using static OTSDataType.otsdataconst;
- namespace OTSCommon
- {
- public static class COffLineClassifyLogic
- {
- //we have a complicate online classify logic(considering the xray counts and using the spectrum compare and may do not quantify)
- //when we do classification offline we cann't use that mechanism so we use a surrogate mechanism which is simpler and general .
- private static CClassifyEngine m_classifyEngine = new CClassifyEngine();
- public static bool ClassifyIncA(List<COTSParticleClr> parts, string stdname, int steelTech)
- {
- bool r = true;
- if (stdname != "NoSTDDB"&& stdname != "NoSTDDB.db")
- {
- foreach (var part in parts)
- {
- part.SetType((int)OTS_PARTICLE_TYPE.NOT_IDENTIFIED);
- IClassifyEngine engine = m_classifyEngine.GetExpressionClassifyEngine(stdname);
- r = engine.ClassifyByExpression(part);
- if (part.GetType() == (int)OTS_PARTICLE_TYPE.NOT_IDENTIFIED)
- {
- engine = m_classifyEngine.GetIncClassifyEngine();
- r = engine.ClassifyIncA(part, steelTech);
- }
- }
- }
- else
- {
- foreach (var part in parts)
- {
- IClassifyEngine engine;
- engine = m_classifyEngine.GetIncClassifyEngine();
- r = engine.ClassifyIncA(part, steelTech);
- }
- }
- return r;
- }
- public static bool ClassifyCleannessA(List<COTSParticleClr> parts, string stdname)
- {
- bool r = true;
- IClassifyEngine engine;
- engine = m_classifyEngine.GetExpressionClassifyEngine(stdname);
- if (stdname != "NoSTDDB")
- {
- foreach (var p in parts)
- {
- r = engine.ClassifyByExpression(p);
- }
- }
- return true;
- }
- }
- }
|