CoxmEDSController.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using FEIApiControl;
  2. using OTSCLRINTERFACE;
  3. using OTSModelSharp.ServiceCenter;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using NSDLL_CLR;
  10. namespace OTSMeasureApp.ServiceCenter.Coxm
  11. {
  12. class CoxmEDSController : IEDSController
  13. {
  14. public static int imgwidth=800;
  15. public static int imgheight = 600;
  16. private IEDSController m_eds;
  17. static string eds_deviceType = "Bruker";//"Oxford" "FEI"
  18. NSRestClient m_coxm_api;
  19. public CoxmEDSController(string deviceType, int imgwidth, int imgheight ,int expectcount, bool ifautoid, string knownelements)
  20. //(string deviceType, int expectcount, bool ifautoid, string knownelements)
  21. {
  22. CoxmEDSController.imgwidth = imgwidth;
  23. CoxmEDSController.imgheight = imgheight;
  24. m_eds = EDSController.GetEDSController(eds_deviceType, imgwidth, imgheight, expectcount, ifautoid, knownelements);
  25. m_coxm_api = CoxmSemController.GetApiClassInstance();
  26. }
  27. public bool CollectSpectrum(uint a_nXRayAQTime, ref uint[] a_XrayData)
  28. {
  29. return m_eds.CollectSpectrum( a_nXRayAQTime, ref a_XrayData);
  30. }
  31. public bool Connect()
  32. {
  33. m_coxm_api.ServerConnect();
  34. if(m_coxm_api.IsServerConnectStatus())
  35. {
  36. return false;
  37. }
  38. return m_eds.Connect();
  39. }
  40. public EDSTYPE GetEDSType()
  41. {
  42. return EDSTYPE.COXM;
  43. }
  44. public int GetExpectCount()
  45. {
  46. return m_eds.GetExpectCount();
  47. }
  48. public bool GetIfDelayQuantify()
  49. {
  50. return m_eds.GetIfDelayQuantify();
  51. }
  52. public bool GetXRayByFeatures(List<COTSParticleClr> a_listParticles, double a_nXRayAQTime, bool a_bElementInfo)
  53. {
  54. return m_eds.GetXRayByFeatures( a_listParticles, a_nXRayAQTime, a_bElementInfo);
  55. }
  56. public bool GetXRayByParts(List<COTSParticleClr> a_listParticles, uint a_nXRayAQTime, bool a_bElementInfo)
  57. {
  58. return m_eds.GetXRayByParts( a_listParticles, a_nXRayAQTime, a_bElementInfo);
  59. }
  60. public bool QuantifyXrayByPart(COTSParticleClr part)
  61. {
  62. return m_eds.QuantifyXrayByPart( part);
  63. }
  64. public void SetFilterKeyEleNames(List<string> KeyNameList)
  65. {
  66. m_eds.SetFilterKeyEleNames(KeyNameList);
  67. }
  68. public void SetResolution(int resolutionWidth, int resolutionHeight)
  69. {
  70. imgwidth= resolutionWidth;
  71. imgheight= resolutionHeight;
  72. m_eds.SetResolution(resolutionWidth, resolutionHeight);
  73. }
  74. bool IEDSController.GetXRayByExpandFeatures(List<COTSParticleClr> a_listParticles, double a_nXRayAQTime, bool a_bElementInfo)
  75. {
  76. return m_eds.GetXRayByExpandFeatures( a_listParticles, a_nXRayAQTime, a_bElementInfo);
  77. }
  78. void IEDSController.SetQuantifiCationParam(bool IfAutoId, string knownElements)
  79. {
  80. m_eds.SetQuantifiCationParam(IfAutoId, knownElements);
  81. }
  82. }
  83. }