using System.Diagnostics; using Venus_RT.Devices; using Aitex.Core.RT.Log; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.Routine; namespace Venus_RT.Modules.PMs { class PMRoutineBase { public ModuleName Module { get; set; } public string Name { get; set; } protected readonly JetPM _chamber; protected Stopwatch _timer = new Stopwatch(); protected RoutineRunner Runner = new RoutineRunner(); public PMRoutineBase(JetPM chamber) { Module = chamber.Module; _chamber = chamber; Runner.Reset(); } protected void Notify(string message) { LOG.Write(eEvent.RoutineNotify, Module, Name, message); } protected void Stop(string failReason) { LOG.Write(eEvent.RoutineFailed, Module, Name, failReason); } public bool CheckLid() { if (!_chamber.IsLidClosed) { this.Stop("Chamber 盖子必须关"); return false; } return true; } public bool CheckLidLoadLock() { if (!_chamber.IsLidLoadlockClosed) { this.Stop("LoadLock 盖子必须关"); return false; } return true; } protected bool CheckSlitDoor() { if (!_chamber.IsSlitDoorClosed) { Stop("传送门必须关"); return false; } return true; } protected bool CheckDryPump() { if (!_chamber.IsPumpRunning) { Stop("泵没有启动"); return false; } if (_chamber.HasPumpError) { Stop("泵状态有错误"); return false; } return true; } protected bool CheckCDA() { if (!_chamber.IsCDA_OK) { Stop("CDA 压力信号不正确"); return false; } return true; } protected bool CloseAllValve() { Notify("关闭所有的阀门"); _chamber.CloseValves(); return true; } protected bool TurnValve(ValveType vlv, bool bOpen) { _chamber.OpenValve(vlv, bOpen); Notify($"{(bOpen ? "打开" : "关闭")} {vlv} 阀"); return true; } protected bool CheckValve(ValveType vlv, bool bOpen) { return true; } } }