CClassifyEngine.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using OTSDataType;
  2. using OTSModelSharp.ServiceInterface;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace OTSModelSharp.ServiceCenter
  9. {
  10. //using OTSClassifyEngine;
  11. using OTSCLRINTERFACE;
  12. class CClassifyEngine : IClassifyEngine
  13. {
  14. COTSClassifyEngineClr myEng;
  15. public bool Classify(COTSParticleClr particle)
  16. {
  17. bool r= myEng.Classify(particle);//the classify engine will
  18. return true;
  19. }
  20. public bool ClassifyIncA(COTSParticleClr particle, int steelTech)
  21. {
  22. bool r = myEng.Classify(particle,steelTech);//the classify engine will
  23. return true;
  24. }
  25. public IClassifyEngine GetCurveCompareEngine(string libName)
  26. {
  27. if (!libName.Contains(".db"))
  28. {
  29. libName = libName + ".db";
  30. }
  31. myEng = new COTSClassifyEngineClr(EngineType.CurveCompare, libName);
  32. return this;
  33. }
  34. public IClassifyEngine GetIncClassifyEngine()
  35. {
  36. myEng = new COTSClassifyEngineClr(EngineType.InclutionEng, "");
  37. return this;
  38. }
  39. public IClassifyEngine GetParticleEngine(string libName)
  40. {
  41. if (!libName.Contains(".db"))
  42. {
  43. libName = libName + ".db";
  44. }
  45. myEng = new COTSClassifyEngineClr(EngineType.ParticleClassifyEng, libName);
  46. return this;
  47. }
  48. public double IfNeedMaxEDS(COTSParticleClr particle)
  49. {
  50. return myEng.IfNeedMaxEDS(particle);
  51. }
  52. }
  53. }