MeasureParam.cs 3.1 KB

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