HardwareInterface.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace SmartSEMControl
  7. {
  8. //sealed, 避免继承出新类造成重构
  9. public sealed class FactoryHardware
  10. {
  11. //只读的静态成员
  12. private static readonly FactoryHardware instance = new FactoryHardware();
  13. // Explicit static constructor to tell C# compiler
  14. // not to mark type as beforefieldinit
  15. //C#的静态构造函数只有在当其类的实例被创建或者有静态成员被引用时执行,
  16. //在整个应用程序域中只会被执行一次。
  17. static FactoryHardware()
  18. {
  19. }
  20. private FactoryHardware()
  21. {
  22. }
  23. //使用这个实例
  24. public static FactoryHardware Instance
  25. {
  26. get
  27. {
  28. return instance;
  29. }
  30. }
  31. //其他使用的成员变量
  32. private readonly ISEMControl m_iSEM = new SmartSEM(); //成员变量
  33. public ISEMControl ISEM
  34. {
  35. get { return m_iSEM; }
  36. } //属性,只能当前类创建
  37. }
  38. //SEM控制
  39. public interface ISEMControl
  40. {
  41. //缩放
  42. float GetMagnification();
  43. Boolean SetMagnification(float set);
  44. //FIB缩放
  45. float GetFIBMagnification();
  46. Boolean SetFIBMagnification(float set);
  47. //焦距
  48. float GetWorkingDistance();
  49. Boolean SetWorkingDistance(float set);
  50. //FIB焦距
  51. float GetFIBObjectivePotential();
  52. Boolean SetFIBObjectivePotential(float set);
  53. //自动对焦
  54. Boolean CmdAutoFocusCoarse();
  55. Boolean CmdAutoFocusFine();
  56. //亮度
  57. float GetBrightness();
  58. Boolean SetBrightness(float set);
  59. //对比度
  60. float GetContrast();
  61. Boolean SetContrast(float set);
  62. //自动亮度
  63. float GetAutoVideo();
  64. Boolean SetAutoVideoOff();
  65. Boolean SetAutoVideoBrightness();
  66. Boolean SetAutoVideoContrast();
  67. Boolean SetAutoVideoBrightnessAndContrast();
  68. //消像散
  69. float GetAstigmatismX();
  70. float GetAstigmatismY();
  71. Boolean SetAstigmatismX(float set);
  72. Boolean SetAstigmatismY(float set);
  73. //FIB消像散
  74. float GetFIBAstigmatismX();
  75. float GetFIBAstigmatismY();
  76. Boolean SetFIBAstigmatismX(float set);
  77. Boolean SetFIBAstigmatismY(float set);
  78. //自动消像散
  79. Boolean CmdAutoStig();
  80. //角度补偿
  81. float GetTiltAngle();
  82. Boolean SetTiltAngleOn();
  83. Boolean SetTiltAngleOff();
  84. Boolean SetTiltAngle(float set);
  85. //抓图
  86. Boolean GrabImage(String filename, short xoff, short yoff, short width, short height, short type);
  87. //读取图像冻结状态
  88. float GetImageFrozen();
  89. //冻结
  90. Boolean ImageFrozen();
  91. //解冻
  92. Boolean ImageLive();
  93. //获取分辨率
  94. int[] GetImageStore();
  95. //设置分辨率
  96. Boolean SetImageStore(float set);
  97. //样品台
  98. float[] GetStagePosition();
  99. float GetStageAtX();
  100. float GetStageAtY();
  101. float GetStageAtZ();
  102. float GetStageAtT();
  103. float GetStageAtR();
  104. float GetStageAtM();
  105. Boolean SetStageGotoX(float set);
  106. Boolean SetStageGotoY(float set);
  107. Boolean SetStageGotoZ(float set);
  108. Boolean SetStageGotoT(float set);
  109. Boolean SetStageGotoR(float set);
  110. Boolean SetStageGotoM(float set);
  111. Boolean MoveStageXY(float x, float y);
  112. Boolean CmdStageAbort(); //样品台急停
  113. //Scan Rotate角度接口
  114. float GetScanRotation();
  115. Boolean SetScanRotationOn();
  116. Boolean SetScanRotationOff();
  117. Boolean SetScanRotation(float set);
  118. //像素读取PixelSize
  119. float GetPixelSize();
  120. //电子束移动接口
  121. float GetBeamShiftX();
  122. float GetBeamShiftY();
  123. Boolean SetBeamShiftX(float set);
  124. Boolean SetBeamShiftY(float set);
  125. //FIB电子束移动接口
  126. float GetFIBBeamShiftX();
  127. float GetFIBBeamShiftY();
  128. Boolean SetFIBBeamShiftX(float set);
  129. Boolean SetFIBBeamShiftY(float set);
  130. //电子束校正设置
  131. float GetTiltCorrection();
  132. Boolean SetTiltCorrectionOff();
  133. Boolean SetTiltCorrectionOn();
  134. //读取FIB模式
  135. float GetFIBMode();
  136. //工作状态读取
  137. float GetFIBIMAGING();
  138. //工作状态选择
  139. Boolean CmdFIBModeSEM(); //SEM模式
  140. Boolean CmdFIBModeFIB(); //FIB模式
  141. Boolean CmdFIBModeMILL(); //MILL模式
  142. //开启电压
  143. Boolean CmdOpenVoltage();
  144. //关闭电压
  145. Boolean CmdCloseVoltage();
  146. //图像类型切换
  147. Boolean DetectorType(float set);
  148. //执行宏文件
  149. Boolean CMDMCFFilename(String _MLFFullFileName);
  150. //样品台状态
  151. float GetStageIs();
  152. //自动函数状态
  153. float GetAutoFunction();
  154. //连接状态
  155. Boolean ConnectStatus();
  156. //FIB API工作状态
  157. float GetFIBApiStatus();
  158. //加载执行.ely文件
  159. Boolean CmdFIBLoadELY(String _ELYFullFileName);
  160. //FIB确认.ely文件
  161. Boolean CmdFIBEXPOSUREELY();
  162. //FIB执行.ely文件
  163. Boolean CmdFIBSTARTELY();
  164. //清除控件
  165. Boolean Dispose();
  166. }
  167. }