IpcSEMController.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using OTSCommon.Model;
  2. using OTSMeasureApp._0_OTSModel.Measure._4_ReMeasure;
  3. using OTSModelSharp.ServiceInterface;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Drawing;
  7. namespace OTSMeasureApp.ServiceCenter
  8. {
  9. public class IpcSEMController: MarshalByRefObject
  10. {
  11. private SemController sem = SemController.GetSEMController();
  12. private ScanController scan = ScanController.GetScanController();
  13. SmplMeasureReMeasure measureReMeasure = new SmplMeasureReMeasure();
  14. public bool TestConn()
  15. {
  16. if (!sem.IsConnected())
  17. {
  18. return false;
  19. }
  20. return true;
  21. }
  22. public bool MoveSEMToPoint(Point poi)
  23. {
  24. if (!sem.IsConnected())
  25. {
  26. return false;
  27. }
  28. return sem.MoveSEMToPoint(poi.X, poi.Y);
  29. }
  30. public bool GetSemPositionXY(ref double a_dPositionX, ref double a_dPositionY, ref double a_dPositionR)
  31. {
  32. if (!sem.IsConnected())
  33. {
  34. return false;
  35. }
  36. return sem.GetSemPositionXY(ref a_dPositionX, ref a_dPositionY, ref a_dPositionR);
  37. }
  38. public bool SetMagnification(double a_dMagnification)
  39. {
  40. if (!sem.IsConnected())
  41. {
  42. return false;
  43. }
  44. return sem.SetMagnification(a_dMagnification);
  45. }
  46. public bool AcquireBSEImage(string sampleName, int width, int height, int dwellTime, ref byte[] ImageByte)
  47. {
  48. scan.Init();
  49. scan.SetDwellTime(dwellTime);
  50. scan.SetImageSize(width, height);
  51. ImageByte = measureReMeasure.SetReFldInfo(sampleName, scan.AcquireBSEImage(0, 0, dwellTime));
  52. return true;
  53. }
  54. public bool AcquisitionSpectrum(string samplePath, int xrayMode, double new_PixelSize, ref Particle particle, uint a_nXRayAQTime)
  55. {
  56. return measureReMeasure.AcquisitionSpectrum(samplePath, xrayMode, new_PixelSize, ref particle, a_nXRayAQTime);
  57. }
  58. }
  59. }