IpcSEMController.cs 2.2 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 MoveSEMToPoint(Point poi)
  15. {
  16. if (!sem.IsConnected())
  17. {
  18. return false;
  19. }
  20. return sem.MoveSEMToPoint(poi.X, poi.Y);
  21. }
  22. public bool GetSemPositionXY(ref double a_dPositionX, ref double a_dPositionY, ref double a_dPositionR)
  23. {
  24. if (!sem.IsConnected())
  25. {
  26. return false;
  27. }
  28. return sem.GetSemPositionXY(ref a_dPositionX, ref a_dPositionY, ref a_dPositionR);
  29. }
  30. public bool SetMagnification(double a_dMagnification)
  31. {
  32. if (!sem.IsConnected())
  33. {
  34. return false;
  35. }
  36. return sem.SetMagnification(a_dMagnification);
  37. }
  38. public bool AcquireBSEImage(int width, int height, int dwellTime, ref byte[] ImageByte)
  39. {
  40. scan.SetDwellTime(dwellTime);
  41. scan.SetImageSize(width, height);
  42. ImageByte = measureReMeasure.SetReFldInfo("sample1", scan.AcquireBSEImage(0, 0, dwellTime));
  43. return true;
  44. }
  45. //public bool FindNewPartInfo(Particle particle)
  46. //{
  47. // measureReMeasure.FindNewPartInfo(particle);
  48. // return true;
  49. //}
  50. public bool ReMeasure(string samplePath, int width, int height, Dictionary<int, List<Particle>> keyValues, int IMGSCANSPEED_INDEX, int XRAYSCANMODE_INDEX, int NUD_SCANTIME_COUNT)
  51. {
  52. SmplMeasureReMeasure smplMeasure = new SmplMeasureReMeasure();
  53. bool isSuccess = smplMeasure.ReMeasure(samplePath, width, height, keyValues, IMGSCANSPEED_INDEX, XRAYSCANMODE_INDEX, NUD_SCANTIME_COUNT);
  54. return isSuccess;
  55. }
  56. }
  57. }