MeasureParam.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. //时间:20200618
  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 MeasureParam : ISlo
  15. {
  16. #region 内容
  17. //工作条件,一次测量的全部切孔都是一类的
  18. // 样品类型
  19. private string m_SampleName;
  20. public string SampleName
  21. {
  22. get { return this.m_SampleName; }
  23. set { this.m_SampleName = value; }
  24. }
  25. //是否仅拍照
  26. private Boolean is_Photograph;
  27. public Boolean Is_Photograph
  28. {
  29. get { return this.is_Photograph; }
  30. set { this.is_Photograph = value; }
  31. }
  32. //是否有pt工序
  33. private Boolean m_pt;
  34. public Boolean PT
  35. {
  36. get { return this.m_pt; }
  37. set { this.m_pt = value; }
  38. }
  39. //FIB使用的ELY文件
  40. private string m_fibTemp;
  41. public string FIBTemp
  42. {
  43. get { return this.m_fibTemp; }
  44. set { this.m_fibTemp = value; }
  45. }
  46. //PT使用的ELY文件
  47. private string m_ptTemp;
  48. public string PTTemp
  49. {
  50. get { return this.m_ptTemp; }
  51. set { this.m_ptTemp = value; }
  52. }
  53. //对焦方式,自动对焦还是手动对焦,手动对焦是1,自有自动对焦2,客户自动对焦3
  54. private int m_fMode;
  55. public int FocusMode
  56. {
  57. get { return m_fMode; }
  58. set { m_fMode = value; }
  59. }
  60. //拉直操作需要的放大位数
  61. private float stretch_Magnification;
  62. public float Stretch_Magnification
  63. {
  64. get { return this.stretch_Magnification; }
  65. set { this.stretch_Magnification = value; }
  66. }
  67. //定位切割位置的放大倍数
  68. private float location_Magnification;
  69. public float Location_Magnification
  70. {
  71. get { return this.location_Magnification; }
  72. set { this.location_Magnification = value; }
  73. }
  74. //定位切割位置的工作电压
  75. private float location_Voltage;
  76. public float Location_Voltage
  77. {
  78. get { return this.location_Voltage; }
  79. set { this.location_Voltage = value; }
  80. }
  81. //拍照的放大倍数
  82. private float photograph_Magnification;
  83. public float Photograph_Magnification
  84. {
  85. get { return this.photograph_Magnification; }
  86. set { this.photograph_Magnification = value; }
  87. }
  88. //拍照的工作电压
  89. private float photograph_Voltage;
  90. public float Photograph_Voltage
  91. {
  92. get { return this.photograph_Voltage; }
  93. set { this.photograph_Voltage = value; }
  94. }
  95. //FIB拍照时的放大倍数
  96. private float fib_Magnification;
  97. public float FIB_Magnification
  98. {
  99. get { return this.fib_Magnification; }
  100. set { this.fib_Magnification = value; }
  101. }
  102. //校正角度选择
  103. private float correction_Angle;
  104. public float Correction_Angle
  105. {
  106. get { return this.correction_Angle; }
  107. set { this.correction_Angle = value; }
  108. }
  109. //厂商
  110. private String firm;
  111. public String Firm
  112. {
  113. get { return this.firm; }
  114. set { this.firm = value; }
  115. }
  116. //对焦参数, SEM
  117. private FocusParam focusP;
  118. public FocusParam AutoFocus
  119. {
  120. get { return this.focusP; }
  121. set { this.focusP = value; }
  122. }
  123. //对焦参数, FIB
  124. private FocusParam focusF;
  125. public FocusParam FIBFocus
  126. {
  127. get { return this.focusF; }
  128. set { this.focusF = value; }
  129. }
  130. //消像散x参数
  131. private FocusParam StigX;
  132. public FocusParam AutoStigX
  133. {
  134. get { return this.StigX; }
  135. set { this.StigX = value; }
  136. }
  137. //消像散Y参数
  138. private FocusParam StigY;
  139. public FocusParam AutoStigY
  140. {
  141. get { return this.StigY; }
  142. set { this.StigY = value; }
  143. }
  144. //能谱参数
  145. #endregion
  146. //构造函数
  147. public MeasureParam()
  148. {
  149. Init();
  150. }
  151. public void Init()
  152. {
  153. this.SampleName = @"";
  154. this.PT = false;
  155. this.FIBTemp = @"";
  156. this.PTTemp = @"";
  157. this.FocusMode = 2;
  158. this.AutoFocus = new FocusParam();
  159. this.AutoFocus.TYPE = 1;
  160. this.AutoStigX = new FocusParam();
  161. this.AutoStigX.TYPE = 2;
  162. this.AutoStigY = new FocusParam();
  163. this.AutoStigY.TYPE = 3;
  164. this.FIBFocus = new FocusParam();
  165. this.FIBFocus.TYPE = 4;
  166. }
  167. //XML文件保存测量参数
  168. public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
  169. {
  170. Slo sFile = new Slo();
  171. //是否拍照和PT
  172. xBool isPhotograph = new xBool();
  173. xBool ptDepostion = new xBool();
  174. isPhotograph.AssignValue(this.is_Photograph);
  175. ptDepostion.AssignValue(this.m_pt);
  176. sFile.Register("Is_Photograph", isPhotograph);
  177. sFile.Register("PT_Depostion", ptDepostion);
  178. //ELY文件
  179. xString ptELYFile = new xString();
  180. xString fibELYFile = new xString();
  181. ptELYFile.AssignValue(this.m_ptTemp);
  182. fibELYFile.AssignValue(this.m_fibTemp);
  183. sFile.Register("PT_ELYFile", ptELYFile);
  184. sFile.Register("FIB_ELYFile", fibELYFile);
  185. //对焦方式
  186. xInt focusmode = new xInt();
  187. focusmode.AssignValue(this.m_fMode);
  188. sFile.Register("FocusMode", focusmode);
  189. //放大倍数和电压参数
  190. xDouble stretchMagnification = new xDouble();
  191. xDouble locationMagnification = new xDouble();
  192. xDouble locationVoltage = new xDouble();
  193. xDouble photographMagnification = new xDouble();
  194. xDouble photographVoltage = new xDouble();
  195. xDouble fibMagnification = new xDouble();
  196. stretchMagnification.AssignValue(this.stretch_Magnification);
  197. locationMagnification.AssignValue(this.location_Magnification);
  198. locationVoltage.AssignValue(this.location_Voltage);
  199. photographMagnification.AssignValue(this.photograph_Magnification);
  200. photographVoltage.AssignValue(this.photograph_Voltage);
  201. fibMagnification.AssignValue(this.fib_Magnification);
  202. sFile.Register("Strectch_Magnification", stretchMagnification);
  203. sFile.Register("Locatio_Magnification", locationMagnification);
  204. sFile.Register("Location_Voltage", locationVoltage);
  205. sFile.Register("Photograph_Magnification", photographMagnification);
  206. sFile.Register("Photograph_Voltage", photographVoltage);
  207. sFile.Register("FIB_Magnification", fibMagnification);
  208. //校正角度
  209. xDouble correctionAngle = new xDouble();
  210. correctionAngle.AssignValue(this.correction_Angle);
  211. sFile.Register("Correction_Angle", correctionAngle);
  212. //样品名称和厂商
  213. xString sampleType = new xString();
  214. xString _firm = new xString();
  215. sampleType.AssignValue(this.m_SampleName);
  216. _firm.AssignValue(this.firm);
  217. sFile.Register("Sample_Type", sampleType);
  218. sFile.Register("Firm", _firm);
  219. //对焦参数
  220. sFile.Register("Focus_Param", this.focusP);
  221. sFile.Register("FIBFocus_Param", this.FIBFocus);
  222. sFile.Register("StigX_Param", this.AutoStigX);
  223. sFile.Register("StigY_Param", this.AutoStigY);
  224. if (isStoring)
  225. {
  226. sFile.Serialize(true, xml, rootNode);
  227. }
  228. else
  229. {
  230. sFile.Serialize(false, xml, rootNode);
  231. this.is_Photograph = isPhotograph.value();
  232. this.m_pt = ptDepostion.value();
  233. this.m_ptTemp = ptELYFile.value();
  234. this.m_fibTemp = fibELYFile.value();
  235. this.m_fMode = focusmode.value();
  236. this.stretch_Magnification = Convert.ToSingle(stretchMagnification.value());
  237. this.location_Magnification = Convert.ToSingle(locationMagnification.value());
  238. this.location_Voltage = Convert.ToSingle(locationVoltage.value());
  239. this.photograph_Magnification = Convert.ToSingle(photographMagnification.value());
  240. this.photograph_Voltage = Convert.ToSingle(photographVoltage.value());
  241. this.correction_Angle = Convert.ToSingle(correctionAngle.value());
  242. this.m_SampleName = sampleType.value();
  243. this.firm = _firm.value();
  244. }
  245. }
  246. }
  247. }