IoGasStick2.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using System;
  2. using System.Xml;
  3. using Aitex.Core.RT.Log;
  4. using Aitex.Core.RT.OperationCenter;
  5. using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.MFCs;
  6. namespace Aitex.Core.RT.Device.Unit
  7. {
  8. //public class IoGasStick2 : BaseDevice, IDevice, IGasStick
  9. //{
  10. // private IValve _frontValve;
  11. // private IValve _behindValve;
  12. // private IoFlowMeter _flowMeter;
  13. // private IMfc _mfc;
  14. // private IValve _purgeValve;
  15. // private IValve _ventValve;
  16. // private IValve _pumpValve;
  17. // public IMfc MFC
  18. // {
  19. // set
  20. // {
  21. // _mfc = value;
  22. // }
  23. // get
  24. // {
  25. // return _mfc;
  26. // }
  27. // }
  28. // public IoGasStick2(string module, XmlElement node, string ioModule = "")
  29. // {
  30. // var attrModule = node.GetAttribute("module");
  31. // base.Module = string.IsNullOrEmpty(attrModule) ? module : attrModule;
  32. // base.Name = node.GetAttribute("id");
  33. // base.Display = node.GetAttribute("display");
  34. // base.DeviceID = node.GetAttribute("schematicId");
  35. // _frontValve = DEVICE.GetDevice($"{Module}.{node.GetAttribute("frontValve")}") as IValve;
  36. // _behindValve = DEVICE.GetDevice($"{Module}.{node.GetAttribute("behindValve")}") as IValve;
  37. // _purgeValve = DEVICE.GetDevice($"{Module}.{node.GetAttribute("purgeValve")}") as IValve;
  38. // _ventValve = DEVICE.GetDevice($"{Module}.{node.GetAttribute("ventValve")}") as IValve;
  39. // _pumpValve = DEVICE.GetDevice($"{Module}.{node.GetAttribute("pumpValve")}") as IValve;
  40. // _flowMeter = DEVICE.GetDevice($"{Module}.{node.GetAttribute("flowMeter")}") as IoFlowMeter;
  41. // _mfc = DEVICE.GetDevice($"{Module}.{node.GetAttribute("mfc")}") as IMfc;
  42. // }
  43. // public bool Initialize()
  44. // {
  45. // OP.Subscribe($"{Module}.{Name}.Flow", SetFlow);
  46. // return true;
  47. // }
  48. // private bool SetFlow(out string reason, int time, object[] param)
  49. // {
  50. // return SetFlow(out reason, time, Convert.ToSingle(param[0].ToString()));
  51. // }
  52. // public bool SetFlow(out string reason, int time, float flow)
  53. // {
  54. // bool isOn = flow > 0.1;
  55. // if (_frontValve != null && !_frontValve.TurnValve(isOn, out reason))
  56. // return false;
  57. // if (_behindValve != null && !_behindValve.TurnValve(isOn, out reason))
  58. // return false;
  59. // if(_purgeValve!=null && _purgeValve.TurnValve(false, out reason))
  60. // return false;
  61. // if (_ventValve != null && _ventValve.TurnValve(false, out reason))
  62. // return false;
  63. // if (_pumpValve != null && _pumpValve.TurnValve(false, out reason))
  64. // return false;
  65. // if (!_mfc.Ramp(flow, time, out reason))
  66. // return false;
  67. // return true;
  68. // }
  69. // public void Terminate()
  70. // {
  71. // }
  72. // public void Monitor()
  73. // {
  74. // try
  75. // {
  76. // }
  77. // catch (Exception ex)
  78. // {
  79. // LOG.Write(ex);
  80. // }
  81. // }
  82. // public void Reset()
  83. // {
  84. // }
  85. //}
  86. }