FocusParam.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //时间:20200911
  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 FocusParam : ISlo
  15. {
  16. #region 内容
  17. //图像存储路径
  18. private string m_sPath;
  19. public string Path
  20. {
  21. get { return this.m_sPath; }
  22. set { this.m_sPath = value; }
  23. }
  24. //调节上限
  25. private float m_fUp;
  26. public float UP
  27. {
  28. get { return this.m_fUp; }
  29. set { this.m_fUp = value; }
  30. }
  31. //调节下限
  32. private float m_fDown;
  33. public float Down
  34. {
  35. get { return this.m_fDown; }
  36. set { this.m_fDown = value; }
  37. }
  38. //调节步长
  39. private float m_fStep;
  40. public float Step
  41. {
  42. get { return this.m_fStep; }
  43. set { this.m_fStep = value; }
  44. }
  45. //精调范围
  46. private float m_ffRange;
  47. public float Range
  48. {
  49. get { return this.m_ffRange; }
  50. set { this.m_ffRange = value; }
  51. }
  52. //精调步长
  53. private float m_ffStep;
  54. public float fStep
  55. {
  56. get { return this.m_ffStep; }
  57. set { this.m_ffStep = value; }
  58. }
  59. #endregion
  60. public FocusParam()
  61. {
  62. Init();
  63. }
  64. public void Init()
  65. {
  66. this.UP = 0;
  67. this.Down = 0;
  68. this.Step = 0;
  69. this.Range = 0;
  70. this.fStep = 0;
  71. }
  72. //XML文件保存测量参数
  73. public override void Serialize(bool isStoring, XmlDocument xml, XmlNode rootNode)
  74. {
  75. Slo slo_fcsparam = new Slo();
  76. xDouble dUp = new xDouble();
  77. xDouble dDown = new xDouble();
  78. xDouble dStep = new xDouble();
  79. xDouble dRange = new xDouble();
  80. xDouble dfStep = new xDouble();
  81. if (isStoring)
  82. {
  83. slo_fcsparam.Serialize(true, xml, rootNode);
  84. }
  85. else
  86. {
  87. slo_fcsparam.Serialize(false, xml, rootNode);
  88. this.UP = (float)dUp.value();
  89. this.Down = (float)dDown.value();
  90. this.Step = (float)dStep.value();
  91. this.Range = (float)dRange.value();
  92. this.fStep = (float)dfStep.value();
  93. }
  94. }
  95. }
  96. }