FocusParam.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. //时间:20200911
  2. //作者:郝爽
  3. //功能:测量参数
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using FileManager;
  10. using System.Xml;
  11. using System.IO;
  12. namespace MeasureData
  13. {
  14. public class FocusParamold : ISlo
  15. {
  16. #region 内容
  17. //图像存储路径
  18. private string m_sPath;
  19. public string Path
  20. {
  21. get { return this.m_sPath; }
  22. set { this.m_sPath = value; }
  23. }
  24. //调节上限
  25. private float m_fUp;
  26. public float UP
  27. {
  28. get { return this.m_fUp; }
  29. set { this.m_fUp = value; }
  30. }
  31. //调节下限
  32. private float m_fDown;
  33. public float Down
  34. {
  35. get { return this.m_fDown; }
  36. set { this.m_fDown = value; }
  37. }
  38. //调节步长
  39. private float m_fStep;
  40. public float Step
  41. {
  42. get { return this.m_fStep; }
  43. set { this.m_fStep = value; }
  44. }
  45. //精调范围
  46. private float m_ffRange;
  47. public float Range
  48. {
  49. get { return this.m_ffRange; }
  50. set { this.m_ffRange = value; }
  51. }
  52. //精调步长
  53. private float m_ffStep;
  54. public float fStep
  55. {
  56. get { return this.m_ffStep; }
  57. set { this.m_ffStep = value; }
  58. }
  59. //调试控制量
  60. //enum WorkType
  61. //{
  62. // AutoFocus = 1, //SEM自动对焦
  63. // AutoStigx = 2, //SEM自动消像散x
  64. // AutoStigy = 3, //SEM自动消像散y
  65. // AutoFIBFocus = 4, //FIB自动对焦
  66. // AllThing = 5
  67. //};
  68. private int m_nType;
  69. public int TYPE
  70. {
  71. get { return this.m_nType; }
  72. set { this.m_nType = value; }
  73. }
  74. #endregion
  75. public FocusParamold()
  76. {
  77. Init();
  78. }
  79. public void Init()
  80. {
  81. this.UP = 0;
  82. this.Down = 0;
  83. this.Step = 0;
  84. this.Range = 0;
  85. this.fStep = 0;
  86. this.TYPE = 1;
  87. }
  88. //XML文件保存测量参数
  89. public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
  90. {
  91. Slo slo_fcsparam = new Slo();
  92. xDouble dUp = new xDouble();
  93. xDouble dDown = new xDouble();
  94. xDouble dStep = new xDouble();
  95. xDouble dRange = new xDouble();
  96. xDouble dfStep = new xDouble();
  97. xInt nType = new xInt();
  98. dUp.AssignValue(this.UP);
  99. dDown.AssignValue(this.Down);
  100. dStep.AssignValue(this.Step);
  101. dRange.AssignValue(this.Range);
  102. dfStep.AssignValue(this.fStep);
  103. nType.AssignValue(this.TYPE);
  104. slo_fcsparam.Register("UP", dUp);
  105. slo_fcsparam.Register("Down", dDown);
  106. slo_fcsparam.Register("Step", dStep);
  107. slo_fcsparam.Register("Range", dRange);
  108. slo_fcsparam.Register("fStep", dfStep);
  109. slo_fcsparam.Register("Type", nType);
  110. dUp.AssignValue(this.UP);
  111. dDown.AssignValue(this.Down);
  112. dStep.AssignValue(this.Step);
  113. dRange.AssignValue(this.Range);
  114. dfStep.AssignValue(this.fStep);
  115. slo_fcsparam.Register("UP", dUp);
  116. slo_fcsparam.Register("DOWN", dDown);
  117. slo_fcsparam.Register("STEP", dStep);
  118. slo_fcsparam.Register("RANGE", dRange);
  119. slo_fcsparam.Register("FSTEP", dfStep);
  120. if (isStoring)
  121. {
  122. slo_fcsparam.Serialize(true, xml, rootNode);
  123. }
  124. else
  125. {
  126. slo_fcsparam.Serialize(false, xml, rootNode);
  127. this.UP = (float)dUp.value();
  128. this.Down = (float)dDown.value();
  129. this.Step = (float)dStep.value();
  130. this.Range = (float)dRange.value();
  131. this.fStep = (float)dfStep.value();
  132. this.TYPE = (int)nType.value();
  133. }
  134. }
  135. }
  136. }