MeasureParam.cs 9.9 KB

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