MeasureParam.cs 11 KB

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