123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- using System;
- using System.Collections.Generic;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.SCCore;
- using Aitex.RT.Properties;
- using Aitex.Triton160.RT.Module;
- using Aitex.Core.Util;
- using Aitex.Platform;
- using Aitex.Core.Equipment.SusceptorDefine;
- using Aitex.Core.RT.Routine;
- using Aitex.Triton160.RT.Device;
- namespace Aitex.Triton160.RT.Routine.Process
- {
- public class PostProcess : CommonRoutine
- {
- private enum RoutineStep
- {
- DelayForTest,
- RFPowerOff,
- StopGasFlow,
- CloseAllValves,
- ClosePumpValve,
- DelayWaitValve,
- Loop,
- Pump,
- PumpDelay,
- Vent,
- VentDelay,
- EndLoop,
- ClosePurgeValve,
- VentEndToPrecision,
- VentEndDelay,
- VentEndCloseVentValve,
- End,
- };
- private RecipeHead head;
- public string RecipeName
- {
- get;
- private set;
- }
- public string RecipeContex
- {
- get;
- private set;
- }
- private bool PurgeActive
- {
- get
- {
- if (head != null)
- {
- if (!string.IsNullOrEmpty(head.PurgeActive))
- {
- return Convert.ToBoolean(head.PurgeActive);
- }
- }
- return true;
- }
- }
- private int _purgeCycleCount;
- private int _purgeVentPressure;
- private int _purgePumpPressure;
- private int _purgeVentTimeLimit;
- private int _purgePumpTimeLimit;
- private int _purgeVentStableTime;
- private int _purgePumpStableTime;
- private int _ventTime;
- //private int _ventTimeLimit;
- public PostProcess(string module, string name)
- {
- Module = module;
- Name = name;
- Display = Resources.PostProcess_PostProcess_PostProcess;
- }
- public bool Initialize()
- {
- InitCommon();
- return true;
- }
- public void Terminate()
- {
- }
- public Result Start(params object[] objs)
- {
- try
- {
- Reset();
- this.UpdateSCValue();
- RecipeName = (string)objs[0];
- RecipeContex = (string)objs[1];
- List<RecipeStep> recipeSteps;
- if (!Recipe.Parse(RecipeContex, out head, out recipeSteps))
- {
- return Result.FAIL;
- }
- _purgeCycleCount = (int)SC.GetValue<double>(SCName.ProcessConfig_PurgeCycleCount);
- _purgeVentPressure = (int)SC.GetValue<double>(SCName.ProcessConfig_PurgeVentPressure);
- _purgePumpPressure = (int)SC.GetValue<double>(SCName.ProcessConfig_PurgePumpPressure);
- _purgeVentTimeLimit = (int)SC.GetValue<double>(SCName.ProcessConfig_PurgeVentTimeLimit);
- _purgePumpTimeLimit = (int)SC.GetValue<double>(SCName.ProcessConfig_PurgePumpTimeLimit);
- _purgeVentStableTime = (int)SC.GetValue<double>(SCName.ProcessConfig_PurgeVentStableTime);
- _purgePumpStableTime = (int)SC.GetValue<double>(SCName.ProcessConfig_PurgePumpStableTime);
- _ventTime = (int)SC.GetSC<double>(SCName.System_VentTime).Value;
- //_ventTimeLimit = (int)SC.GetSC<double>(SCName.System_VentTimeLimit).Value;
- }
- catch (Exception ex)
- {
- LOG.Write(ex, String.Format("Postprocess Start has exception"));
- return Result.FAIL;
- }
- return Result.RUN;
- }
- public Result Monitor()
- {
- try
- {
- if (SC.GetValue<bool>(SCName.System_IsSimulatorMode))
- {
- Delay((int) RoutineStep.DelayForTest, Resources.PostProcess_Monitor_WaitFor10Seconds, 10, Notify, Stop);
- }
- RFPowerOff((int)RoutineStep.RFPowerOff, Resources.PostProcess_Monitor_RFPowerOff, Notify, Stop);
- StopAllGasFlow((int)RoutineStep.StopGasFlow, Resources.PostProcess_Monitor_StopAllTheGasFlow, 10, Notify, Stop);
- CloseAllValve((int)RoutineStep.CloseAllValves, Resources.PumpDownRoutine_Monitor_CloseAllTheValves, 10, Notify, Stop);
- if (PurgeActive)
- {
- Loop((int)RoutineStep.Loop, Resources.CyclePurgeRoutine_Monitor_StartCyclePurge, _purgeCycleCount, Notify, Stop);
- CyclePump((int)RoutineStep.Pump, Resources.CyclePurgeRoutine_Monitor_Pumping, _purgePumpPressure, _purgePumpTimeLimit, true, Notify, Stop);
- Delay((int)RoutineStep.PumpDelay, string.Format(Resources.PostProcess_Monitor_PumpDelay0Seconds, _purgePumpStableTime), _purgePumpStableTime, Notify, Stop);
- CycleVent((int)RoutineStep.Vent, Resources.CyclePurgeRoutine_Monitor_Venting, _purgeVentPressure, _purgeVentTimeLimit, true, Notify, Stop);
- Delay((int)RoutineStep.VentDelay, string.Format(Resources.PostProcess_Monitor_VentDelay0Seconds, _purgeVentStableTime), _purgeVentStableTime, Notify, Stop);
- EndLoop((int)RoutineStep.EndLoop, Notify, Stop);
- }
- else
- {
- ClosePumpValve((int)RoutineStep.ClosePumpValve, Resources.StopPumpRoutine_Monitor_ClosePumpValve, valveOpenCloseTimeout, Notify, Stop);
- Delay((int)RoutineStep.DelayWaitValve, string.Format("delay 3 seconds" ), 3, Notify, Stop);
- }
- VentToPrecision((int)RoutineStep.VentEndToPrecision, string.Format(Resources.VentRountine_Monitor_Vent0Seconds, _ventTime), _ventTime, Notify, Stop);
-
- CloseValve((int)RoutineStep.VentEndCloseVentValve, Resources.VentRountine_Monitor_VentValve, DeviceModel.ValveChamberVent, valveOpenCloseTimeout, Notify, Stop);
- End((int)RoutineStep.End, Resources.PostProcess_Monitor_PostProcessFinished, Notify, Stop);
- }
- catch (RoutineBreakException)
- {
- return Result.RUN;
- }
- catch (RoutineFaildException)
- {
- return Result.FAIL;
- }
- return Result.DONE;
- }
- public void Exit()
- {
- if (DeviceModel.SignalTower != null)
- {
- DeviceModel.SignalTower.BuzzerBlinking(SC.GetValue<double>(SCName.System_BuzzerBlinkingTime));
- DeviceModel.SignalTower.SetLight(LightType.YELLOW, LightStatus.ON);
- }
- //update processing end time
- Singleton<ProcessRecorder>.Instance.EndRecipeProcess(Singleton<PMEntity>.Instance.CurrentRunningJob.RecipeRunId, SusceptorStatus.Processed);
- }
- private new void Notify(string message)
- {
- Singleton<ProcessRecorder>.Instance.AddRecord(Singleton<PMEntity>.Instance.CurrentRunningJob.RecipeRunId, CarrierDataType.PreProcessStep, "", "Post process:" + message);
- EV.PostMessage(Module, EventEnum.PostProcessInfo, Module, message);
- }
-
- private new void Stop(string message)
- {
- Singleton<ProcessRecorder>.Instance.AddRecord(Singleton<PMEntity>.Instance.CurrentRunningJob.RecipeRunId, CarrierDataType.PostProcessErrorEnd, "", "post process, exception," + message);
- EV.PostMessage(Module, EventEnum.PostProcessErr, Module, message);
- EV.PostPopDialogMessage(EventLevel.Alarm, string.Format(Resources.PostProcess_Stop_0FailedAfterRunningRecipe, Module),
- string.Format(Resources.PreProcess_Stop_Recipe0RNFailedReason1, RecipeName, message));
- }
-
- }
- }
|