IpcSEMController.cs 2.5 KB

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