using System; using System.Xml; using Aitex.Core.Common.DeviceData; using Aitex.Core.RT.Device; using Aitex.Core.RT.Event; using Aitex.Core.RT.IOCore; using Aitex.Core.RT.OperationCenter; using Aitex.Core.RT.SCCore; using Aitex.Core.RT.Tolerance; using Aitex.Core.Util; using Venus_RT.Devices.IODevices; using Aitex.Core.RT.Log; using Aitex.Core.RT.DataCenter; namespace Venus_RT.Devices { class IoTMPressureCtrl : BaseDevice, IDevice { public readonly IoPressureMeter TMPressureGauge; public readonly IoPressureMeter LLAPressureGauge; public readonly IoPressureMeter LLBPressureGauge; public readonly IoPressureMeter MFForelineGauge; public readonly IoPressureMeter LLAForelineGauge; public readonly IoPressureMeter LLBForelineGauge; private readonly ToleranceChecker _tolerance = new ToleranceChecker(); private readonly R_TRIG _trigTMPressureGauge = new R_TRIG(); private readonly R_TRIG _trigLLAPressureGauge = new R_TRIG(); private readonly R_TRIG _trigLLBPressureGauge = new R_TRIG(); private readonly R_TRIG _trigMFForelineGauge = new R_TRIG(); private readonly R_TRIG _trigLLAForelineGauge = new R_TRIG(); private readonly R_TRIG _trigLLBForelineGauge = new R_TRIG(); private readonly AOAccessor _aoMFPressureSP; private readonly AOAccessor _aoLLAPressureSP; private readonly AOAccessor _aoLLBPressureSP; // Properties // public double TargetPressure { get; set; } // Constructor // public IoTMPressureCtrl(string module, XmlElement node, string ioModule = "") { base.Module = module; base.Name = node.GetAttribute("id"); base.Display = node.GetAttribute("display"); base.DeviceID = node.GetAttribute("schematicId"); TMPressureGauge = ParseDeviceNode(Module, "MFPressureMeter", node); LLAPressureGauge = ParseDeviceNode(Module, "LLAPressureMeter", node); LLBPressureGauge = ParseDeviceNode(Module, "LLBPressureMeter", node); MFForelineGauge = ParseDeviceNode(Module, "MFForelineMeter", node); LLAForelineGauge = ParseDeviceNode(Module, "LLAForelineMeter", node); LLBForelineGauge = ParseDeviceNode(Module, "LLBForelineMeter", node); _aoMFPressureSP = ParseAoNode("aoMFPressure", node, ioModule); _aoLLAPressureSP = ParseAoNode("aoLLAPressure", node, ioModule); _aoLLBPressureSP = ParseAoNode("aoLLBPressure", node, ioModule); } public bool Initialize() { DATA.Subscribe($"{Module}.{Name}.TMChamberSetPoint", () => _GetRealFloat(_aoMFPressureSP)); DATA.Subscribe($"{Module}.{Name}.LLAChamberSetPoint", () => _GetRealFloat(_aoLLAPressureSP)); DATA.Subscribe($"{Module}.{Name}.LLBChamberSetPoint", () => _GetRealFloat(_aoLLBPressureSP)); return true; } public void SetTMPressure(float pressure) { _SetRealFloat(_aoMFPressureSP, pressure); } public void SetLLAPressure(float pressure) { _SetRealFloat(_aoLLAPressureSP, pressure); } public void SetLLBPressure(float pressure) { _SetRealFloat(_aoLLBPressureSP, pressure); } public void Terminate() { } public void Monitor() { //_trigTMPressureGauge.CLK = TMPressureGauge.GaugeAlarm; //if (_trigTMPressureGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "MF pressure gauge Alarm"); //_trigLLAPressureGauge.CLK = LLAPressureGauge.GaugeAlarm; //if (_trigLLAPressureGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Chamber pressure gauge Alarm"); //_trigLLBPressureGauge.CLK = LLBPressureGauge.GaugeAlarm; //if (_trigLLBPressureGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Foreline pressure gauge Alarm"); //_trigMFForelineGauge.CLK = MFForelineGauge.GaugeAlarm; //if (_trigMFForelineGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Process High Gauge Alarm"); //_trigLLAForelineGauge.CLK = LLAForelineGauge.GaugeAlarm; //if (_trigLLAForelineGauge.Q) LOG.Write(eEvent.ERR_DEVICE_INFO, Module, "Process Low Gauge Alarm"); } public void Reset() { _trigTMPressureGauge.RST = true; _trigLLAPressureGauge.RST = true; _trigLLBPressureGauge.RST = true; _trigMFForelineGauge.RST = true; _trigLLAForelineGauge.RST = true; _trigLLBForelineGauge.RST = true; } } }