HardwareInterface.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 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 SetTiltAngle(float set);
  83. //抓图
  84. Boolean GrabImage(String filename, short xoff, short yoff, short width, short height, short type);
  85. //读取图像冻结状态
  86. float GetImageFrozen();
  87. //冻结
  88. Boolean ImageFrozen();
  89. //解冻
  90. Boolean ImageLive();
  91. //获取分辨率
  92. int[] GetImageStore();
  93. //设置分辨率
  94. Boolean SetImageStore(float set);
  95. //样品台
  96. float[] GetStagePosition();
  97. float GetStageAtX();
  98. float GetStageAtY();
  99. float GetStageAtZ();
  100. float GetStageAtT();
  101. float GetStageAtR();
  102. float GetStageAtM();
  103. Boolean SetStageGotoX(float set);
  104. Boolean SetStageGotoY(float set);
  105. Boolean SetStageGotoZ(float set);
  106. Boolean SetStageGotoT(float set);
  107. Boolean SetStageGotoR(float set);
  108. Boolean SetStageGotoM(float set);
  109. Boolean MoveStageXY(float x, float y);
  110. Boolean CmdStageAbort(); //样品台急停
  111. //Scan Rotate角度接口
  112. float GetScanRotation();
  113. Boolean SetScanRotation(float set);
  114. //像素读取PixelSize
  115. float GetPixelSize();
  116. //电子束移动接口
  117. float GetBeamShiftX();
  118. float GetBeamShiftY();
  119. Boolean SetBeamShiftX(float set);
  120. Boolean SetBeamShiftY(float set);
  121. //FIB电子束移动接口
  122. float GetFIBBeamShiftX();
  123. float GetFIBBeamShiftY();
  124. Boolean SetFIBBeamShiftX(float set);
  125. Boolean SetFIBBeamShiftY(float set);
  126. //电子束校正设置
  127. float GetTiltCorrection();
  128. Boolean SetTiltCorrectionOff();
  129. Boolean SetTiltCorrectionOn();
  130. //读取FIB模式
  131. float GetFIBMode();
  132. //工作状态读取
  133. float GetFIBIMAGING();
  134. //工作状态选择
  135. Boolean CmdFIBModeSEM(); //SEM模式
  136. Boolean CmdFIBModeFIB(); //FIB模式
  137. Boolean CmdFIBModeMILL(); //MILL模式
  138. //开启电压
  139. Boolean CmdOpenVoltage();
  140. //关闭电压
  141. Boolean CmdCloseVoltage();
  142. //图像类型切换
  143. Boolean DetectorType(float set);
  144. //执行宏文件
  145. Boolean CMDMCFFilename(String filename);
  146. //样品台状态
  147. float GetStageIs();
  148. //自动函数状态
  149. float GetAutoFunction();
  150. //连接状态
  151. Boolean ConnectStatus();
  152. //FIB API工作状态
  153. float GetFIBApiStatus();
  154. //加载执行.ely文件
  155. Boolean CmdFIBLoadELY(String _ELYFullFileName);
  156. //清除控件
  157. Boolean Dispose();
  158. //Pt的控制
  159. //PT针插入
  160. Boolean InsertPT();
  161. //PT针退出
  162. Boolean OutputPT();
  163. }
  164. interface FIBControl
  165. {
  166. //FIB的控制
  167. }
  168. interface IPtControl
  169. {
  170. }
  171. interface StageControl
  172. {
  173. //样品台控制
  174. }
  175. interface CommonMsg
  176. {
  177. //通用的信息
  178. }
  179. }