HardwareInterface.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. //SEM电压
  69. float GetSEMVoltage();
  70. Boolean SetSEMVoltage(float set);
  71. //消像散
  72. float GetAstigmatismX();
  73. float GetAstigmatismY();
  74. Boolean SetAstigmatismX(float set);
  75. Boolean SetAstigmatismY(float set);
  76. //FIB消像散
  77. float GetFIBAstigmatismX();
  78. float GetFIBAstigmatismY();
  79. Boolean SetFIBAstigmatismX(float set);
  80. Boolean SetFIBAstigmatismY(float set);
  81. //自动消像散
  82. Boolean CmdAutoStig();
  83. //角度补偿
  84. float GetTiltAngle();
  85. Boolean SetTiltAngleOn();
  86. Boolean SetTiltAngleOff();
  87. Boolean SetTiltAngle(float set);
  88. //抓图
  89. Boolean GrabImage(String filename, short xoff, short yoff, short width, short height, short type);
  90. //读取图像冻结状态
  91. float GetImageFrozen();
  92. //冻结
  93. Boolean ImageFrozen();
  94. //解冻
  95. Boolean ImageLive();
  96. //获取分辨率
  97. int[] GetImageStore();
  98. //设置分辨率
  99. Boolean SetImageStore(float set);
  100. //样品台
  101. float[] GetStagePosition();
  102. float GetStageAtX();
  103. float GetStageAtY();
  104. float GetStageAtZ();
  105. float GetStageAtT();
  106. float GetStageAtR();
  107. float GetStageAtM();
  108. Boolean SetStageGotoX(float set);
  109. Boolean SetStageGotoY(float set);
  110. Boolean SetStageGotoZ(float set);
  111. Boolean SetStageGotoT(float set);
  112. Boolean SetStageGotoR(float set);
  113. Boolean SetStageGotoM(float set);
  114. Boolean MoveStageXY(float x, float y);
  115. Boolean CmdStageAbort(); //样品台急停
  116. //Scan Rotate角度接口
  117. float GetScanRotation();
  118. Boolean SetScanRotationOn();
  119. Boolean SetScanRotationOff();
  120. Boolean SetScanRotation(float set);
  121. //像素读取PixelSize
  122. float GetPixelSize();
  123. //电子束移动接口
  124. float GetBeamShiftX();
  125. float GetBeamShiftY();
  126. Boolean SetBeamShiftX(float set);
  127. Boolean SetBeamShiftY(float set);
  128. //FIB电子束移动接口
  129. float GetFIBBeamShiftX();
  130. float GetFIBBeamShiftY();
  131. Boolean SetFIBBeamShiftX(float set);
  132. Boolean SetFIBBeamShiftY(float set);
  133. //电子束校正设置
  134. float GetTiltCorrection();
  135. Boolean SetTiltCorrectionOff();
  136. Boolean SetTiltCorrectionOn();
  137. //读取FIB模式
  138. float GetFIBMode();
  139. //工作状态读取
  140. float GetFIBIMAGING();
  141. //工作状态选择
  142. Boolean CmdFIBModeSEM(); //SEM模式
  143. Boolean CmdFIBModeFIB(); //FIB模式
  144. Boolean CmdFIBModeMILL(); //MILL模式
  145. //开启电压
  146. Boolean CmdOpenVoltage();
  147. //关闭电压
  148. Boolean CmdCloseVoltage();
  149. //图像类型切换
  150. Boolean DetectorType(float set);
  151. //执行宏文件
  152. Boolean CMDMCFFilename(String _MLFFullFileName);
  153. //样品台状态
  154. float GetStageIs();
  155. //自动函数状态
  156. float GetAutoFunction();
  157. //连接状态
  158. Boolean ConnectStatus();
  159. //FIB API工作状态
  160. float GetFIBApiStatus();
  161. //加载执行.ely文件
  162. Boolean CmdFIBLoadELY(String _ELYFullFileName);
  163. //FIB确认.ely文件
  164. Boolean CmdFIBEXPOSUREELY();
  165. //FIB执行.ely文件
  166. Boolean CmdFIBSTARTELY();
  167. //清除控件
  168. Boolean Dispose();
  169. }
  170. }