PlasmaController.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Aitex.Core.Common.DeviceData;
  7. using Aitex.Core.RT.Device;
  8. using MECF.Framework.Common.Device.Bases;
  9. using MECF.Framework.Common.Equipment;
  10. namespace JetVirgoPM.Devices
  11. {
  12. interface IPlasmaControl
  13. {
  14. // Generator
  15. float ReflectPower { get; }
  16. //void SetRfMode(RfMode mode);
  17. void SetPower(ushort val);
  18. bool SetPowerOnOff(bool on, out string str);
  19. //void SetPulsingFrequency(float val);
  20. //void SetDuty(float val);
  21. // Match
  22. void SetMatchWorkMode(EnumRfMatchTuneMode mode);
  23. void SetPosition(byte c1, byte c2);
  24. }
  25. interface IGenerator
  26. {
  27. bool IsRfOn { get; }
  28. float PowerSetPoint { get; }
  29. float RFForwardPower { get; }
  30. float RFReflectPower { get; }
  31. bool SetPowerOnOff(bool on, out string str);
  32. void SetRfMode(RfMode mode);
  33. void SetPower(ushort val);
  34. //void TurnOn(bool on);
  35. }
  36. interface IMatch
  37. {
  38. EnumRfMatchTuneMode WorkMode { get; set; }
  39. void SetPosition(byte c1, byte c2);
  40. }
  41. public enum GeneratorStatus
  42. {
  43. Unknown,
  44. OFF,
  45. ON,
  46. ERROR
  47. }
  48. public enum GeneratorControlMode
  49. {
  50. Manual = 0,
  51. Analog = 1,
  52. RS232 = 2
  53. }
  54. /// <summary>
  55. ///
  56. /// </summary>
  57. class PlasmaController : BaseDevice, IDevice, IPlasmaControl
  58. {
  59. private readonly RfPowerBase _Generator;
  60. private readonly RfMatchBase _Match;
  61. // --------------------------Properties------------------------
  62. //
  63. public float ReflectPower => _Generator.ReflectPower;
  64. // --------------------------Constructor-----------------------
  65. //
  66. public PlasmaController(ModuleName mod)
  67. {
  68. _Generator = new AdTecGenerator(mod,Name);
  69. _Match = new AdTecMatch(mod, Name);
  70. }
  71. public bool Initialize()
  72. {
  73. throw new System.NotImplementedException();
  74. }
  75. public void Monitor()
  76. {
  77. throw new System.NotImplementedException();
  78. }
  79. public void Reset()
  80. {
  81. throw new System.NotImplementedException();
  82. }
  83. public void SetMatchWorkMode(EnumRfMatchTuneMode mode)
  84. {
  85. _Match.TuneMode1 = mode;
  86. _Match.TuneMode2 = mode;
  87. }
  88. public void SetPosition(byte c1, byte c2)
  89. {
  90. _Match.TunePosition1 = c1;
  91. }
  92. public void SetPower(ushort val)
  93. {
  94. _Generator.SetPower(val);
  95. }
  96. //public void SetRfMode(EnumRfPowerWorkMode mode)
  97. //{
  98. // _Generator.SetRfMode(mode);
  99. //}
  100. public void Terminate()
  101. {
  102. throw new System.NotImplementedException();
  103. }
  104. public bool SetPowerOnOff(bool on, out string str)
  105. {
  106. str = "";
  107. _Generator.SetPowerOnOff(on, out str);
  108. return true;
  109. }
  110. }
  111. }