EDSParam.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. //20201112 EDS参数相关类
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using FileManager;
  8. using System.Xml;
  9. using System.IO;
  10. namespace MeasureData
  11. {
  12. public class EDSParam : ISlo
  13. {
  14. #region 内容
  15. //Image参数
  16. //图像存储路径
  17. private string m_sPath;
  18. public string Path
  19. {
  20. get { return this.m_sPath; }
  21. set { this.m_sPath = value; }
  22. }
  23. //图像分辨率
  24. private double m_fScanSize;
  25. public double ScanSize
  26. {
  27. get { return this.m_fScanSize; }
  28. set { this.m_fScanSize = value; }
  29. }
  30. //采集时间
  31. private double m_fDwellTime;
  32. public double DwellTime
  33. {
  34. get { return this.m_fDwellTime; }
  35. set { this.m_fDwellTime = value; }
  36. }
  37. //图像类型
  38. private int m_nImageType;
  39. public int ImageType
  40. {
  41. get { return this.m_nImageType; }
  42. set { this.m_nImageType = value; }
  43. }
  44. //Xray参数
  45. //分析方式:点扫描1,面扫描2
  46. private bool m_PointMode;
  47. public bool PointMode
  48. {
  49. get { return this.m_PointMode; }
  50. set { this.m_PointMode = value; }
  51. }
  52. private bool m_AreaMode;
  53. public bool AreaMode
  54. {
  55. get { return this.m_AreaMode; }
  56. set { this.m_AreaMode = value; }
  57. }
  58. //分析时间
  59. private double m_nPointTime;
  60. public double PointTime
  61. {
  62. get { return this.m_nPointTime; }
  63. set { this.m_nPointTime = value; }
  64. }
  65. private double m_nAreaTime;
  66. public double AreaTime
  67. {
  68. get { return this.m_nAreaTime; }
  69. set { this.m_nAreaTime = value; }
  70. }
  71. #endregion
  72. public EDSParam()
  73. {
  74. Init();
  75. }
  76. public void Init()
  77. {
  78. this.Path = "";
  79. this.ScanSize = 1024;
  80. this.DwellTime = 1;
  81. this.ImageType = 1;
  82. this.PointMode = true;
  83. this.AreaMode = true;
  84. this.PointTime = 100;
  85. this.AreaTime = 200;
  86. }
  87. //XML文件保存测量参数
  88. public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
  89. {
  90. Slo slo_edsparam = new Slo();
  91. //xString ImagePath = new xString();
  92. xDouble ScanSize = new xDouble();
  93. xDouble DwellTime = new xDouble();
  94. xInt ImageType = new xInt();
  95. xInt XrayType = new xInt();
  96. xDouble XrayPointTime = new xDouble();
  97. xDouble XrayAreaTime = new xDouble();
  98. xBool PointMode = new xBool();
  99. xBool AreaMode = new xBool();
  100. //ImagePath.AssignValue(this.Path);
  101. ScanSize.AssignValue(this.ScanSize);
  102. DwellTime.AssignValue(this.DwellTime);
  103. ImageType.AssignValue(this.ImageType);
  104. //XrayType.AssignValue(this.Mode);
  105. XrayPointTime.AssignValue(this.PointTime);
  106. XrayAreaTime.AssignValue(this.AreaTime);
  107. PointMode.AssignValue(this.PointMode);
  108. AreaMode.AssignValue(this.AreaMode);
  109. //slo_edsparam.Register("ImagePath", ImagePath);
  110. slo_edsparam.Register("ScanSizes", ScanSize);
  111. slo_edsparam.Register("DwellTime", DwellTime);
  112. slo_edsparam.Register("ImageType", ImageType);
  113. //slo_edsparam.Register("XrayMode", XrayType);
  114. slo_edsparam.Register("XrayPointTime", XrayPointTime);
  115. slo_edsparam.Register("XrayAreaTime", XrayAreaTime);
  116. slo_edsparam.Register("PointMode", PointMode);
  117. slo_edsparam.Register("AreaMode", AreaMode);
  118. if (isStoring)
  119. {
  120. slo_edsparam.Serialize(true, xml, rootNode);
  121. }
  122. else
  123. {
  124. slo_edsparam.Serialize(false, xml, rootNode);
  125. //this.Path = ImagePath.value();
  126. this.ScanSize = ScanSize.value();
  127. this.DwellTime = DwellTime.value();
  128. this.ImageType = ImageType.value();
  129. //this.Mode = XrayType.value();
  130. this.PointTime = XrayPointTime.value();
  131. this.AreaTime = XrayAreaTime.value();
  132. this.PointMode = PointMode.value();
  133. this.AreaMode = AreaMode.value();
  134. }
  135. }
  136. }
  137. }