HardwareInterface.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. //Scan Rotate角度接口
  95. float GetScanRotation();
  96. Boolean SetScanRotation(float set);
  97. //像素读取PixelSize
  98. float GetPixelSize();
  99. //电子束校正设置
  100. float GetTiltCorrection();
  101. Boolean SetTiltCorrectionOff();
  102. Boolean SetTiltCorrectionOn();
  103. //开启电压
  104. Boolean CmdOpenVoltage();
  105. //关闭电压
  106. Boolean CmdCloseVoltage();
  107. //图像类型切换
  108. Boolean DetectorType(float set);
  109. //执行宏文件
  110. Boolean CMDMCFFilename(String filename);
  111. //清除控件
  112. Boolean Dispose();
  113. }
  114. interface FIBControl
  115. {
  116. //FIB的控制
  117. }
  118. interface PtControl
  119. {
  120. //Pt的控制
  121. //PT针插入
  122. void InsertPT();
  123. //PT针退出
  124. void OutputPT();
  125. }
  126. interface StageControl
  127. {
  128. //样品台控制
  129. }
  130. interface CommonMsg
  131. {
  132. //通用的信息
  133. }
  134. }