MeasureParam.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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,自动对焦0
  54. private bool m_fMode;
  55. public bool FocusMode
  56. {
  57. get { return m_fMode; }
  58. set { m_fMode = value; }
  59. }
  60. //拉直操作需要的放大位数
  61. private double stretch_Magnification;
  62. public double Stretch_Magnification
  63. {
  64. get { return this.stretch_Magnification; }
  65. set { this.stretch_Magnification = value; }
  66. }
  67. //定位切割位置的放大倍数
  68. private double location_Magnification;
  69. public double Location_Magnification
  70. {
  71. get { return this.location_Magnification; }
  72. set { this.location_Magnification = value; }
  73. }
  74. //定位切割位置的工作电压
  75. private double location_Voltage;
  76. public double Location_Voltage
  77. {
  78. get { return this.location_Voltage; }
  79. set { this.location_Voltage = value; }
  80. }
  81. //拍照的放大倍数
  82. private double photograph_Magnification;
  83. public double Photograph_Magnification
  84. {
  85. get { return this.photograph_Magnification; }
  86. set { this.photograph_Magnification = value; }
  87. }
  88. //拍照的工作电压
  89. private double photograph_Voltage;
  90. public double Photograph_Voltage
  91. {
  92. get { return this.photograph_Voltage; }
  93. set { this.photograph_Voltage = value; }
  94. }
  95. //校正角度选择
  96. private double correction_Angle;
  97. public double Correction_Angle
  98. {
  99. get { return this.correction_Angle; }
  100. set { this.correction_Angle = value; }
  101. }
  102. //厂商
  103. private String firm;
  104. public String Firm
  105. {
  106. get { return this.firm; }
  107. set { this.firm = value; }
  108. }
  109. //对焦参数
  110. //能谱参数
  111. #endregion
  112. //构造函数
  113. public MeasureParam()
  114. {
  115. Init();
  116. }
  117. public void Init()
  118. {
  119. this.SampleName = @"";
  120. this.PT = false;
  121. this.FIBTemp = @"";
  122. this.PTTemp = @"";
  123. }
  124. //XML文件保存测量参数
  125. public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
  126. {
  127. Slo slo_msparam = new Slo();
  128. xString sampleName = new xString();
  129. xBool pt = new xBool();
  130. xString FIBtemp = new xString();
  131. xString PTtemp = new xString();
  132. xBool FocMode = new xBool();
  133. sampleName.AssignValue(this.SampleName);
  134. pt.AssignValue(this.PT);
  135. FIBtemp.AssignValue(this.FIBTemp);
  136. PTtemp.AssignValue(this.PTTemp);
  137. FocMode.AssignValue(this.FocusMode);
  138. slo_msparam.Register("SampleName", sampleName);
  139. slo_msparam.Register("PT", pt);
  140. slo_msparam.Register("FIBTemp", FIBtemp);
  141. slo_msparam.Register("PTTemp", PTtemp);
  142. slo_msparam.Register("FocusMode", FocMode);
  143. if (isStoring)
  144. {
  145. slo_msparam.Serialize(true, xml, rootNode);
  146. }
  147. else
  148. {
  149. slo_msparam.Serialize(false, xml, rootNode);
  150. this.SampleName = sampleName.value();
  151. this.PT = pt.value();
  152. this.FIBTemp = FIBtemp.value();
  153. this.PTTemp = PTtemp.value();
  154. this.FocusMode = FocMode.value();
  155. }
  156. }
  157. }
  158. }