EDSController.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. 
  2. using OTSDataType;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using OTSCLRINTERFACE;
  9. namespace OTSModelSharp.ServiceInterface
  10. {
  11. using OTSCLRINTERFACE;
  12. using System.Drawing;
  13. public class EDSController : IEDSController
  14. {
  15. private COTSControlFunExport eds;
  16. static EDSController edsctrl=null;
  17. public static EDSController GetEDSController()
  18. {
  19. if (edsctrl == null)
  20. {
  21. edsctrl = new EDSController();
  22. }
  23. return edsctrl;
  24. }
  25. private EDSController()
  26. {
  27. eds = SemController.hw;
  28. }
  29. public bool GetXRayByFeatures(List<COTSParticleClr> a_listParticles, double a_nXRayAQTime, bool a_bElementInfo)
  30. {
  31. if (!eds.IsConnected())
  32. {
  33. return false;
  34. }
  35. COTSParticleClr[] parts = a_listParticles.ToArray();
  36. return eds.GetXRayByFeatures((uint)a_nXRayAQTime, parts, a_bElementInfo);
  37. }
  38. public bool GetXRayByPoints(List<COTSParticleClr> a_listParticles, uint a_nXRayAQTime, bool a_bElementInfo)
  39. {
  40. if (!eds.IsConnected())
  41. {
  42. return false;
  43. }
  44. int xrayNum = a_listParticles.Count;
  45. Point[] Ps = new Point[xrayNum];
  46. for (int i = 0; i < xrayNum; i++)
  47. {
  48. Point p = (Point)a_listParticles[i].GetXRayPos();
  49. Ps[i].X = p.X;
  50. Ps[i].Y = p.Y;
  51. }
  52. COTSParticleClr[] parts = a_listParticles.ToArray();
  53. string[] a_strEleResult = new string[xrayNum];
  54. return eds.GetXRayByPoints(a_nXRayAQTime, Ps,parts, a_bElementInfo);
  55. }
  56. public bool Init()
  57. {
  58. bool m_init= eds.EDSInit();
  59. return m_init;
  60. }
  61. }
  62. }