HardwareInterface.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. //焦距
  45. float GetWorkingDistance();
  46. Boolean SetWorkingDistance(float set);
  47. //自动对焦
  48. Boolean CmdAutoFocusCoarse();
  49. Boolean CmdAutoFocusFine();
  50. //亮度
  51. float GetBrightness();
  52. Boolean SetBrightness(float set);
  53. //对比度
  54. float GetContrast();
  55. Boolean SetContrast(float set);
  56. //自动亮度
  57. float GetAutoVideo();
  58. Boolean SetAutoVideoOff();
  59. Boolean SetAutoVideoBrightness();
  60. Boolean SetAutoVideoContrast();
  61. Boolean SetAutoVideoBrightnessAndContrast();
  62. //消像散
  63. float GetAstigmatismX();
  64. float GetAstigmatismY();
  65. Boolean SetAstigmatismX(float set);
  66. Boolean SetAstigmatismY(float set);
  67. //自动消像散
  68. Boolean CmdAutoStig();
  69. //角度补偿
  70. float GetTiltAngle();
  71. Boolean SetTiltAngle(float set);
  72. //抓图
  73. Boolean GrabImage(String filename, short xoff, short yoff, short width, short height, short type);
  74. //解冻
  75. Boolean ImageFrozen();
  76. //冻结
  77. Boolean ImageLive();
  78. //获取分辨率
  79. int[] GetImageStore();
  80. //设置分辨率
  81. Boolean SetImageStore(float set);
  82. //样品台
  83. float[] GetStagePosition();
  84. float GetStageAtX();
  85. float GetStageAtY();
  86. float GetStageAtZ();
  87. float GetStageAtT();
  88. float GetStageAtR();
  89. float GetStageAtM();
  90. Boolean SetStageGotoX(float set);
  91. Boolean SetStageGotoY(float set);
  92. Boolean SetStageGotoZ(float set);
  93. Boolean SetStageGotoT(float set);
  94. Boolean SetStageGotoR(float set);
  95. Boolean SetStageGotoM(float set);
  96. Boolean MoveStageXY(float x, float y);
  97. Boolean CmdStageAbort(); //样品台急停
  98. //Scan Rotate角度接口
  99. float GetScanRotation();
  100. Boolean SetScanRotation(float set);
  101. //像素读取PixelSize
  102. float GetPixelSize();
  103. //电子束校正设置
  104. float GetTiltCorrection();
  105. Boolean SetTiltCorrectionOff();
  106. Boolean SetTiltCorrectionOn();
  107. //开启电压
  108. Boolean CmdOpenVoltage();
  109. //关闭电压
  110. Boolean CmdCloseVoltage();
  111. //图像类型切换
  112. Boolean DetectorType(float set);
  113. //执行宏文件
  114. Boolean CMDMCFFilename(String filename);
  115. //样品台状态
  116. float GetStageIs();
  117. //自动函数状态
  118. float GetAutoFunction();
  119. //连接状态
  120. Boolean ConnectStatus();
  121. //清除控件
  122. Boolean Dispose();
  123. //Pt的控制
  124. //PT针插入
  125. void InsertPT();
  126. //PT针退出
  127. void OutputPT();
  128. }
  129. interface FIBControl
  130. {
  131. //FIB的控制
  132. }
  133. interface IPtControl
  134. {
  135. }
  136. interface StageControl
  137. {
  138. //样品台控制
  139. }
  140. interface CommonMsg
  141. {
  142. //通用的信息
  143. }
  144. }