MeasureParam.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. //是否有pt工序
  26. private Boolean m_pt;
  27. public Boolean PT
  28. {
  29. get { return this.m_pt; }
  30. set { this.m_pt = value; }
  31. }
  32. //FIB工作模板
  33. private string m_fibTemp;
  34. public string FIBTemp
  35. {
  36. get { return this.m_fibTemp; }
  37. set { this.m_fibTemp = value; }
  38. }
  39. //PT工作模板,这个暂时不使用,FIB和PT是一个模板
  40. private string m_ptTemp;
  41. public string PTTemp
  42. {
  43. get { return this.m_ptTemp; }
  44. set { this.m_ptTemp = value; }
  45. }
  46. //对焦方式,自动对焦还是手动对焦,手动对焦是1,自动对焦0
  47. private bool m_fMode;
  48. public bool FocusMode
  49. {
  50. get { return m_fMode; }
  51. set { m_fMode = value; }
  52. }
  53. #endregion
  54. //构造函数
  55. public MeasureParam()
  56. {
  57. Init();
  58. }
  59. public void Init()
  60. {
  61. this.SampleName = @"";
  62. this.PT = false;
  63. this.FIBTemp = @"";
  64. this.PTTemp = @"";
  65. }
  66. //XML文件保存测量参数
  67. public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
  68. {
  69. Slo slo_msparam = new Slo();
  70. xString sampleName = new xString();
  71. xBool pt = new xBool();
  72. xString FIBtemp = new xString();
  73. xString PTtemp = new xString();
  74. xBool FocMode = new xBool();
  75. sampleName.AssignValue(this.SampleName);
  76. pt.AssignValue(this.PT);
  77. FIBtemp.AssignValue(this.FIBTemp);
  78. PTtemp.AssignValue(this.PTTemp);
  79. FocMode.AssignValue(this.FocusMode);
  80. slo_msparam.Register("SampleName", sampleName);
  81. slo_msparam.Register("PT", pt);
  82. slo_msparam.Register("FIBTemp", FIBtemp);
  83. slo_msparam.Register("PTTemp", PTtemp);
  84. slo_msparam.Register("FocusMode", FocMode);
  85. if (isStoring)
  86. {
  87. slo_msparam.Serialize(true, xml, rootNode);
  88. }
  89. else
  90. {
  91. slo_msparam.Serialize(false, xml, rootNode);
  92. this.SampleName = sampleName.value();
  93. this.PT = pt.value();
  94. this.FIBTemp = FIBtemp.value();
  95. this.PTTemp = PTtemp.value();
  96. this.FocusMode = FocMode.value();
  97. }
  98. }
  99. }
  100. }