PlasmaController.cs 2.9 KB

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