HardwareInterface.cs 5.3 KB

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