HardwareInterface.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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 GetCycleTime();
  92. //读取图像冻结状态
  93. float GetImageFrozen();
  94. //冻结
  95. Boolean ImageFrozen();
  96. //解冻
  97. Boolean ImageLive();
  98. //获取分辨率
  99. int[] GetImageStore();
  100. //设置分辨率
  101. Boolean SetImageStore(float set);
  102. //样品台
  103. float[] GetStagePosition();
  104. float GetStageAtX();
  105. float GetStageAtY();
  106. float GetStageAtZ();
  107. float GetStageAtT();
  108. float GetStageAtR();
  109. float GetStageAtM();
  110. Boolean SetStageGotoX(float set);
  111. Boolean SetStageGotoY(float set);
  112. Boolean SetStageGotoZ(float set);
  113. Boolean SetStageGotoT(float set);
  114. Boolean SetStageGotoR(float set);
  115. Boolean SetStageGotoM(float set);
  116. Boolean MoveStageXY(float x, float y);
  117. Boolean CmdStageAbort(); //样品台急停
  118. //Scan Rotate角度接口
  119. float GetScanRotation();
  120. Boolean SetScanRotationOn();
  121. Boolean SetScanRotationOff();
  122. Boolean SetScanRotation(float set);
  123. //像素读取PixelSize
  124. float GetPixelSize();
  125. //电子束移动接口
  126. float GetBeamShiftX();
  127. float GetBeamShiftY();
  128. Boolean SetBeamShiftX(float set);
  129. Boolean SetBeamShiftY(float set);
  130. //电子束移动距离接口
  131. float GetBeamOffsetX();
  132. float GetBeamOffsetY();
  133. Boolean SetBeamOffsetX(float set);
  134. Boolean SetBeamOffsetY(float set);
  135. //FIB电子束移动接口
  136. float GetFIBBeamShiftX();
  137. float GetFIBBeamShiftY();
  138. Boolean SetFIBBeamShiftX(float set);
  139. Boolean SetFIBBeamShiftY(float set);
  140. //电子束校正设置
  141. float GetTiltCorrection();
  142. Boolean SetTiltCorrectionOff();
  143. Boolean SetTiltCorrectionOn();
  144. //读取FIB模式
  145. float GetFIBMode();
  146. //工作状态读取
  147. float GetFIBIMAGING();
  148. //工作状态选择
  149. Boolean CmdFIBModeSEM(); //SEM模式
  150. Boolean CmdFIBModeFIB(); //FIB模式
  151. Boolean CmdFIBModeMILL(); //MILL模式
  152. //开启电压
  153. Boolean CmdOpenVoltage();
  154. //关闭电压
  155. Boolean CmdCloseVoltage();
  156. //图像类型切换
  157. Boolean DetectorType(float set);
  158. //执行宏文件
  159. Boolean CMDMCFFilename(String _MLFFullFileName);
  160. //样品台状态
  161. float GetStageIs();
  162. //自动函数状态
  163. float GetAutoFunction();
  164. //连接状态
  165. Boolean ConnectStatus();
  166. //FIB API工作状态
  167. float GetFIBApiStatus();
  168. //加载执行.ely文件
  169. Boolean CmdFIBLoadELY(String _ELYFullFileName);
  170. //FIB确认.ely文件
  171. Boolean CmdFIBEXPOSUREELY();
  172. //FIB执行.ely文件
  173. Boolean CmdFIBSTARTELY();
  174. Boolean CmdFocusRate();
  175. Boolean CmdSaveRate();
  176. Boolean SetStageDeltaR(float set);
  177. //清除控件
  178. Boolean Dispose();
  179. }
  180. }