HardwareInterface.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. Boolean CmdLineScan();
  42. Boolean CmdPixelScan();
  43. //缩放
  44. float GetMagnification();
  45. Boolean SetMagnification(float set);
  46. //FIB缩放
  47. float GetFIBMagnification();
  48. Boolean SetFIBMagnification(float set);
  49. //焦距
  50. float GetWorkingDistance();
  51. Boolean SetWorkingDistance(float set);
  52. //FIB焦距
  53. float GetFIBObjectivePotential();
  54. Boolean SetFIBObjectivePotential(float set);
  55. //自动对焦
  56. Boolean CmdAutoFocusCoarse();
  57. Boolean CmdAutoFocusFine();
  58. //亮度
  59. float GetBrightness();
  60. Boolean SetBrightness(float set);
  61. //对比度
  62. float GetContrast();
  63. Boolean SetContrast(float set);
  64. //自动亮度
  65. float GetAutoVideo();
  66. Boolean SetAutoVideoOff();
  67. Boolean SetAutoVideoBrightness();
  68. Boolean SetAutoVideoContrast();
  69. Boolean SetAutoVideoBrightnessAndContrast();
  70. Boolean SetAutoBright(float set);
  71. Boolean SetAutoContrast(float set);
  72. //SEM电压
  73. float GetSEMVoltage();
  74. Boolean SetSEMVoltage(float set);
  75. //SEM电流
  76. float GetSEMIPROBE();
  77. Boolean SetSEMIPROBE(float set);
  78. //消像散
  79. float GetAstigmatismX();
  80. float GetAstigmatismY();
  81. Boolean SetAstigmatismX(float set);
  82. Boolean SetAstigmatismY(float set);
  83. //FIB消像散
  84. float GetFIBAstigmatismX();
  85. float GetFIBAstigmatismY();
  86. Boolean SetFIBAstigmatismX(float set);
  87. Boolean SetFIBAstigmatismY(float set);
  88. //自动消像散
  89. Boolean CmdAutoStig();
  90. //角度补偿
  91. float GetTiltAngle();
  92. Boolean SetTiltAngleOn();
  93. Boolean SetTiltAngleOff();
  94. Boolean SetTiltAngle(float set);
  95. //抓图
  96. Boolean GrabImage(String filename, short xoff, short yoff, short width, short height, short type);
  97. //扫描周期
  98. float GetCycleTime();
  99. //读取图像冻结状态
  100. float GetImageFrozen();
  101. //冻结
  102. Boolean ImageFrozen();
  103. //解冻
  104. Boolean ImageLive();
  105. //获取分辨率
  106. int[] GetImageStore();
  107. //设置分辨率
  108. Boolean SetImageStore(float set);
  109. //样品台
  110. float[] GetStagePosition();
  111. float GetStageAtX();
  112. float GetStageAtY();
  113. float GetStageAtZ();
  114. float GetStageAtT();
  115. float GetStageAtR();
  116. float GetStageAtM();
  117. Boolean SetStageGotoX(float set);
  118. Boolean SetStageGotoY(float set);
  119. Boolean SetStageGotoZ(float set);
  120. Boolean SetStageGotoT(float set);
  121. Boolean SetStageGotoR(float set);
  122. Boolean SetStageGotoM(float set);
  123. Boolean MoveStageXY(float x, float y);
  124. Boolean CmdStageAbort(); //样品台急停
  125. //Scan Rotate角度接口
  126. float GetScanRotation();
  127. Boolean SetScanRotationOn();
  128. Boolean SetScanRotationOff();
  129. Boolean SetScanRotation(float set);
  130. //像素读取PixelSize
  131. float GetPixelSize();
  132. //电子束移动接口
  133. float GetBeamShiftX();
  134. float GetBeamShiftY();
  135. Boolean SetBeamShiftX(float set);
  136. Boolean SetBeamShiftY(float set);
  137. //电子束移动距离接口
  138. float GetBeamOffsetX();
  139. float GetBeamOffsetY();
  140. Boolean SetBeamOffsetX(float set);
  141. Boolean SetBeamOffsetY(float set);
  142. //FIB电子束移动接口
  143. float GetFIBBeamShiftX();
  144. float GetFIBBeamShiftY();
  145. Boolean SetFIBBeamShiftX(float set);
  146. Boolean SetFIBBeamShiftY(float set);
  147. //电子束校正设置
  148. float GetTiltCorrection();
  149. Boolean SetTiltCorrectionOff();
  150. Boolean SetTiltCorrectionOn();
  151. //读取FIB模式
  152. float GetFIBMode();
  153. //工作状态读取
  154. float GetFIBIMAGING();
  155. //工作状态选择
  156. Boolean CmdFIBModeSEM(); //SEM模式
  157. Boolean CmdFIBModeFIB(); //FIB模式
  158. Boolean CmdFIBModeMILL(); //MILL模式
  159. //开启电压
  160. Boolean CmdOpenVoltage();
  161. //关闭电压
  162. Boolean CmdCloseVoltage();
  163. //图像类型切换
  164. Boolean DetectorType(float set);
  165. //执行宏文件
  166. Boolean CMDMCFFilename(String _MLFFullFileName);
  167. //样品台状态
  168. float GetStageIs();
  169. //自动函数状态
  170. float GetAutoFunction();
  171. //连接状态
  172. Boolean ConnectStatus();
  173. //FIB API工作状态
  174. float GetFIBApiStatus();
  175. //加载执行.ely文件
  176. Boolean CmdFIBLoadELY(String _ELYFullFileName);
  177. //FIB确认.ely文件
  178. Boolean CmdFIBEXPOSUREELY();
  179. //FIB执行.ely文件
  180. Boolean CmdFIBSTARTELY();
  181. //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭
  182. Boolean CmdFocusRate(int mFocusSpeed);
  183. Boolean CmdFocusScanSpeed(String mFocusSpeed);
  184. //add by sun 2020-12-15 拍截面图调用蔡司接口时,要保证扫描速度5以上,自动亮度对比度功能关闭 end
  185. Boolean CmdSaveRate();
  186. Boolean CmdSaveBestRate();
  187. Boolean SetStageDeltaR(float set);
  188. void SetRemoteDesELYPath(String path);
  189. void SetRemoteDesMLFPath(String path);
  190. void SetReduced(int x, int y, int W, int H);
  191. void CloseReduced();
  192. void SetReduced1(int x, int y, int W, int H);
  193. Boolean GrabZoneImage(String filename, short xoff, short yoff, short width, short height, short type);
  194. //清除控件
  195. Boolean Dispose();
  196. }
  197. }