HardwareInterface.cs 4.2 KB

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