Pārlūkot izejas kodu

add missing file

gsp 1 gadu atpakaļ
vecāks
revīzija
bdb8b1af87

+ 69 - 0
OTSIncAReportApp/3-ServiceCenter/COffLineClassifyLogic.cs

@@ -0,0 +1,69 @@
+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")
+            {
+                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;
+
+        }
+
+    }
+}