Browse Source

1。设置log最大500M,超出分文件(解决文件太大,log打不开)
2.优化Recipe save/save as 功能,文件名重读报警
3.恢复 Helium min/max

lixiang 1 year ago
parent
commit
4634f3f91a

+ 4 - 1
Venus/Framework/Common/RecipeCenter/IRecipeService.cs

@@ -34,12 +34,15 @@ namespace MECF.Framework.Common.RecipeCenter
         [OperationContract]
         bool SaveAsRecipe(ModuleName chamId, string recipeName, string recipeContent);
         [OperationContract]
-        bool SaveAsRecipe2(ModuleName chamId,string type, string recipeName, string recipeContent);
+        bool SaveAsRecipeWithType(ModuleName chamId,string type, string recipeName, string recipeContent);
 
         [OperationContract]
         bool SaveRecipe(ModuleName chamId, string recipeName, string recipeContent);
 
         [OperationContract]
+        bool SaveRecipeWithType(ModuleName chamId, string type, string recipeName, string recipeContent);
+
+        [OperationContract]
         bool CreateFolder(ModuleName chamId, string folderName);
 
         [OperationContract]

+ 13 - 12
Venus/Framework/Common/RecipeCenter/RecipeFileManager.cs

@@ -360,7 +360,7 @@ namespace Aitex.Core.RT.RecipeCenter
             string rcp = string.Empty;
             try
             {
-                using (StreamReader fs = new StreamReader(GenerateRecipeFilePath2(chamberId,type, recipeName)))
+                using (StreamReader fs = new StreamReader(GenerateRecipeFilePath(chamberId,type, recipeName)))
                 {
                     rcp = fs.ReadToEnd();
                     fs.Close();
@@ -571,7 +571,7 @@ namespace Aitex.Core.RT.RecipeCenter
         {
             return getRecipeDirPath(chamId) + recipeName + ".rcp";
         }
-        private string GenerateRecipeFilePath2(string chamId,  string type,string recipeName)
+        public string GenerateRecipeFilePath(string chamId,  string type,string recipeName)
         {
             return getRecipeDirPath(chamId) +type+"\\"+ recipeName + ".rcp";
         }
@@ -634,15 +634,16 @@ namespace Aitex.Core.RT.RecipeCenter
             return SaveRecipe(chamId, recipeName, recipeContent, true, true);
         }
 
-        public bool SaveAsRecipe2(string chamId,string type, string recipeName, string recipeContent)
+        public bool SaveAsRecipe(string chamId,string type, string recipeName, string recipeContent)
         {
-            var path = GenerateRecipeFilePath(chamId, recipeName);
-            //if (File.Exists(path))
-            //{
-            //    WarningDialog(string.Format(Resources.RecipeFileManager_SaveAsRecipe_RecipeFile0savefailed, recipeName));
-            //    return false;
-            //}
-            return SaveRecipe2(chamId,type, recipeName, recipeContent, true, true);
+            var path = GenerateRecipeFilePath(chamId, type, recipeName);
+            if (File.Exists(path))
+            {
+                LOG.Write(eEvent.WARN_SYSTEM_CONFIG, ModuleName.System, $"{recipeName}文件已存在,创建recipe {recipeName}失败");
+                //WarningDialog(string.Format(Resources.RecipeFileManager_SaveAsRecipe_RecipeFile0savefailed, recipeName));
+                return false;
+            }
+            return SaveRecipe(chamId,type, recipeName, recipeContent, true, true);
         }
 
         /// <summary>
@@ -688,12 +689,12 @@ namespace Aitex.Core.RT.RecipeCenter
         /// <param name="recipeName"></param>
         /// <param name="recipeContent"></param>
         /// <returns></returns>
-        public bool SaveRecipe2(string chamId,string type, string recipeName, string recipeContent, bool clearBarcode, bool notifyUI)
+        public bool SaveRecipe(string chamId,string type, string recipeName, string recipeContent, bool clearBarcode, bool notifyUI)
         {
             bool ret = true;
             try
             {
-                var path = GenerateRecipeFilePath2(chamId, type, recipeName);
+                var path = GenerateRecipeFilePath(chamId, type, recipeName);
 
                 if (!_rcpContext.EnableEdit(path))
                     return false;

+ 9 - 3
Venus/Framework/Common/RecipeCenter/RecipeService.cs

@@ -109,7 +109,13 @@ namespace MECF.Framework.Common.RecipeCenter
             LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Modify and save {0} Recipe: {1}", chamId, recipeName));
             return RecipeFileManager.Instance.SaveRecipe(chamId.ToString(), recipeName, recipeContent, false, false);
         }
-       
+        public bool SaveRecipeWithType(ModuleName chamId, string type, string recipeName, string recipeContent)
+        {
+            if (CheckSoftwareExpired())
+                return false;
+            LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Modify and save {0} Recipe: {1}", chamId, recipeName));
+            return RecipeFileManager.Instance.SaveRecipe(chamId.ToString(),type, recipeName, recipeContent, false, false);
+        }
 
         /// <summary>
         /// move recipe content
@@ -146,12 +152,12 @@ namespace MECF.Framework.Common.RecipeCenter
         /// <param name="recipeName"></param>
         /// <param name="recipeContent"></param>
         /// <returns></returns>
-        public bool SaveAsRecipe2(ModuleName chamId,string type, string recipeName, string recipeContent)
+        public bool SaveAsRecipeWithType(ModuleName chamId,string type, string recipeName, string recipeContent)
         {
             if (CheckSoftwareExpired())
                 return false;
             LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Modify and save as {0} recipe {1}", chamId, recipeName));
-            return RecipeFileManager.Instance.SaveAsRecipe2(chamId.ToString(),type, recipeName, recipeContent);
+            return RecipeFileManager.Instance.SaveAsRecipe(chamId.ToString(),type, recipeName, recipeContent);
         }
         /// <summary>
         /// create a new recipe folder

+ 8 - 2
Venus/Framework/Common/RecipeCenter/RecipeServiceClient.cs

@@ -82,10 +82,10 @@ namespace MECF.Framework.Common.RecipeCenter
             Invoke(svc => { result = svc.SaveAsRecipe(chamId, recipeName, recipeContent); });
             return result;   
         }
-        public bool SaveAsRecipe2(ModuleName chamId,string type, string recipeName, string recipeContent)
+        public bool SaveAsRecipeWithType(ModuleName chamId,string type, string recipeName, string recipeContent)
         {
             bool result = false;
-            Invoke(svc => { result = svc.SaveAsRecipe2(chamId,type, recipeName, recipeContent); });
+            Invoke(svc => { result = svc.SaveAsRecipeWithType(chamId,type, recipeName, recipeContent); });
             return result;
         }
         public bool SaveRecipe(ModuleName chamId, string recipeName, string recipeContent)
@@ -94,6 +94,12 @@ namespace MECF.Framework.Common.RecipeCenter
             Invoke(svc => { result = svc.SaveRecipe(chamId, recipeName, recipeContent); });
             return result;   
         }
+        public bool SaveRecipeWithType(ModuleName chamId, string type, string recipeName, string recipeContent)
+        {
+            bool result = false;
+            Invoke(svc => { result = svc.SaveRecipeWithType(chamId,type, recipeName, recipeContent); });
+            return result;
+        }
 
         public bool CreateFolder(ModuleName chamId, string folderName)
         {

+ 8 - 8
Venus/Venus_Core/ProcessUnitDefine.cs

@@ -413,14 +413,14 @@ namespace Venus_Core
         [CustomName("ToleranceDelayTime(ms)")]
         public int ToleranceDelayTime { get; set; }
         public int BacksideHelium { get; set; }
-        [IsTolerance]
-        public float HeliumWarningRange { get; set; }
-        [IsTolerance]
-        public float HeliumAlarmRange { get; set; }
-        //public int MinHeFlow { get; set; } 
-        //public int MaxHeFlow { get; set; }
-        //[CustomName("CheckDelay(ms)")]
-        //public int CheckDelay { get; set; }
+        //[IsTolerance]
+        //public float HeliumWarningRange { get; set; }
+        //[IsTolerance]
+        //public float HeliumAlarmRange { get; set; }
+        public int MinHeFlow { get; set; }
+        public int MaxHeFlow { get; set; }
+        [CustomName("CheckDelay(ms)")]
+        public int CheckDelay { get; set; }
         public int ESCClampValtage { get; set; }
         public int Temperature { get; set; }
     }

+ 6 - 3
Venus/Venus_MainPages/PMS/UiRecipeManager.cs

@@ -35,16 +35,19 @@ namespace Venus_MainPages.PMs
         {
             return RecipeClient.Instance.Service.SaveAsRecipe(ModuleNameString.ToEnum(chamId), recipeName, recipeContent);
         }
-        public bool SaveAsRecipe2(string chamId,string type, string recipeName, string recipeContent)
+        public bool SaveAsRecipeWithType(string chamId,string type, string recipeName, string recipeContent)
         {
-            return RecipeClient.Instance.Service.SaveAsRecipe2(ModuleNameString.ToEnum(chamId),type, recipeName, recipeContent);
+            return RecipeClient.Instance.Service.SaveAsRecipeWithType(ModuleNameString.ToEnum(chamId),type, recipeName, recipeContent);
         }
 
         public bool SaveRecipe(string chamId, string recipeName, string recipeContent)
         {
             return RecipeClient.Instance.Service.SaveRecipe(ModuleNameString.ToEnum(chamId), recipeName, recipeContent);
         }
-
+        public bool SaveRecipeWithType(string chamId, string type, string recipeName, string recipeContent)
+        {
+            return RecipeClient.Instance.Service.SaveRecipeWithType(ModuleNameString.ToEnum(chamId),type, recipeName, recipeContent);
+        }
         public bool RenameRecipe(string chamId, string oldName, string newName)
         {
             return RecipeClient.Instance.Service.RenameRecipe(ModuleNameString.ToEnum(chamId), oldName, newName);

+ 40 - 36
Venus/Venus_MainPages/ViewModels/RecipeViewModel.cs

@@ -220,16 +220,7 @@ namespace Venus_MainPages.ViewModels
             }
         }
         private void OnSaveRecipe()
-        {
-           //var PMCurrentState = (PMState)Enum.Parse(typeof(PMState), QueryDataClient.Instance.Service.GetData($"{ModuleName}.FsmState").ToString());
-           //var SystemCurrentState = Convert.ToBoolean( QueryDataClient.Instance.Service.GetData($"System.IsAutoMode"));
-            //if (PMCurrentState == PMState.Clean || PMCurrentState == PMState.Processing)
-            //{
-            //    WPFMessageBox.ShowError($"{ModuleName} is Processing,can not edit recipe {CurrentRecipeName}");
-            //    return;
-            //}
-            //QueryDataClient.Instance.Service.GetData($"Scheduler.InUsingRecipe");
-
+        {        
             var inUseRecipe= QueryDataClient.Instance.Service.GetData($"Scheduler.InUsingRecipe");
             if (inUseRecipe != null)
             {
@@ -243,6 +234,7 @@ namespace Venus_MainPages.ViewModels
 
             CurrentRecipe.Header.EditTime = DateTime.Now.ToString();
             //SaveRecipe(CurrentRecipeName, RecipeUnity.RecipeToString(CurrentRecipe));
+            
             var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, CurrentRecipeName + ".rcp");
             FileInfo fi = new FileInfo(newrecipePath);
             var di = fi.Directory;
@@ -251,7 +243,7 @@ namespace Venus_MainPages.ViewModels
                 di.Create();
             }
             //File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(CurrentRecipe),Encoding.UTF8);
-            SaveAsRecipe2(CurrentRecipe.Header.Name, CurrentRecipe.Header.Type.ToString(), RecipeUnity.RecipeToString(CurrentRecipe));
+            SaveRecipe(CurrentRecipe.Header.Name, CurrentRecipe.Header.Type.ToString(), RecipeUnity.RecipeToString(CurrentRecipe));
             LoadHeadWrapPanel(headWrapPanel, CurrentRecipe);
         }
         private void OnSaveToRecipe(object obj)
@@ -287,12 +279,12 @@ namespace Venus_MainPages.ViewModels
             if (moduleName == "ALL")
             {
                 var newName = Interaction.InputBox(" ", $"Save Recipe To All", CurrentRecipeName, -1, -1);
+                OnSaveRecipe();
 
                 foreach (var x in moduleList)
                 {
                     if (newName != "")
                     {
-                        OnSaveRecipe();
 
                         var targetChamber = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{x}.ChamberType").ToString());
                         if (currentChamber != targetChamber || x == ModuleName)
@@ -309,7 +301,11 @@ namespace Venus_MainPages.ViewModels
                         {
                             di.Create();
                         }
-                        File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
+                        //File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
+                        if (m_uiRecipeManager.SaveAsRecipeWithType(x, CurrentRecipe.Header.Type.ToString(), newName, RecipeUnity.RecipeToString(newRecipe)))
+                        {
+                            UpdateRecipeFileList();
+                        }
                         UpdateRecipeFileList();
                     }
                 }
@@ -338,8 +334,14 @@ namespace Venus_MainPages.ViewModels
                     {
                         di.Create();
                     }
-                    File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
-                    UpdateRecipeFileList();
+                    //File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
+                    if (m_uiRecipeManager.SaveAsRecipeWithType(moduleName, CurrentRecipe.Header.Type.ToString(), newName, RecipeUnity.RecipeToString(newRecipe)))
+                    { 
+                        UpdateRecipeFileList();
+                    }
+                    //if (SaveAsRecipeWithType(newName, CurrentRecipe.Header.Type.ToString(), RecipeUnity.RecipeToString(newRecipe)))
+                    //{ 
+                    //}
                 }
             }
 
@@ -457,6 +459,10 @@ namespace Venus_MainPages.ViewModels
         {
             return m_uiRecipeManager.SaveRecipe(ModuleName, recipeName, recipeContent);
         }
+        public bool SaveRecipe(string recipeName,string type, string recipeContent)
+        {
+            return m_uiRecipeManager.SaveRecipeWithType(ModuleName,type, recipeName, recipeContent);
+        }
         private void OnMouseRightButtonDown(Object treeView)
         {
             //treeViewRcpList = treeView as TreeView;
@@ -512,24 +518,18 @@ namespace Venus_MainPages.ViewModels
                 };
                 if (dlg.ShowDialog() == true)
                 {
-                    var recipeName = folderName + "\\" + dlg.InputText;
-                    RecipeType type = (RecipeType)Enum.Parse(typeof(RecipeType), dlg.SelectedType);
-                    string newRecipe = RecipeUnity.CreateRecipe(currentChamber, type, dlg.InputText);
+                    var recipeName = dlg.InputText;
+                    //var recipeName = folderName + dlg.InputText;
 
-                    //string recipeContent = m_uiRecipeManager.GetRecipeTemplate(ModuleName);
+                    //var recipeName = folderName + "\\" + dlg.InputText;
 
-                    //m_uiRecipeManager.SaveAsRecipe(ModuleName, recipeName, m_uiRecipeManager.LoadRecipe("system",folderName));
-                    if (SaveAsRecipe2(recipeName, type.ToString(), newRecipe))
+                    RecipeType type = (RecipeType)Enum.Parse(typeof(RecipeType), dlg.SelectedType);
+                    string newRecipe = RecipeUnity.CreateRecipe(currentChamber, type, dlg.InputText);
+         
+                    if (SaveAsRecipeWithType(recipeName, type.ToString(), newRecipe))
                     {
                         UpdateRecipeFileList();
-                        //SelectRecipe(recipeName);
-                        //treeViewRcpList.Items.Add(new TreeViewFileItem(dlg.InputText));
                     }
-                    else
-                    {
-                        WPFMessageBox.ShowError("Error");
-                    }
-
                 }
             }
             catch (Exception ex)
@@ -568,12 +568,16 @@ namespace Venus_MainPages.ViewModels
                 var newRecipe = CurrentRecipe;
                 newRecipe.Header.Name = newName;
                 newRecipe.Header.CreateTime = DateTime.Now.ToString();
-                var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, newName + ".rcp");
-                File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
-                UpdateRecipeFileList();
-                CurrentRecipeName = newName;
-                LoadHeadWrapPanel(headWrapPanel, CurrentRecipe);
-                LoadRecipe(CurrentRecipe);
+                //var newrecipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, typeFolder, newName + ".rcp");
+                //File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(newRecipe));
+                if (SaveAsRecipeWithType(newName, CurrentRecipe.Header.Type.ToString(), RecipeUnity.RecipeToString(newRecipe)))
+                {
+                    UpdateRecipeFileList();
+                    CurrentRecipeName = newName;
+                    LoadHeadWrapPanel(headWrapPanel, CurrentRecipe);
+                    LoadRecipe(CurrentRecipe);
+                }
+                
             }
         }
         private void menuItem_MouseClick_RenameRecipe(object sender, RoutedEventArgs e)
@@ -599,9 +603,9 @@ namespace Venus_MainPages.ViewModels
         {
             return m_uiRecipeManager.SaveAsRecipe(ModuleName, recipeName, recipeContent);
         }
-        public bool SaveAsRecipe2(string recipeName, string type, string recipeContent)
+        public bool SaveAsRecipeWithType(string recipeName, string type, string recipeContent)
         {
-            return m_uiRecipeManager.SaveAsRecipe2(ModuleName, type, recipeName, recipeContent);
+            return m_uiRecipeManager.SaveAsRecipeWithType(ModuleName, type, recipeName, recipeContent);
         }
         public string GetXmlRecipeList()
         {

+ 4 - 4
Venus/Venus_RT/App.config

@@ -12,12 +12,12 @@
 			<param name= "MaxSizeRollBackups" value= "-1"/>
 			<param name= "MaximumFileSize" value= "500M"/>
 			<param name="StaticLogFileName" value="false" />
-			<!--<datePattern value="yyyyMMdd'.txt'" />-->
-			<param name= "DatePattern" value= "&quot;Logs_&quot;yyyyMMdd&quot;.txt&quot;"/>
+			<datePattern value="yyyyMMdd'.txt'" />
+			<!--<param name= "DatePattern" value= "&quot;Logs_&quot;yyyyMMdd&quot;.txt&quot;"/>-->
 			<param name= " RollingStyle " value= "Composite" />
 			<layout type="log4net.Layout.PatternLayout,log4net">
 				<param name="ConversionPattern" value="%d%8p %m%n" />
-				<param name="Header" value="&#xA;----------------------开启RT--------------------------&#xA;" />
+				<param name="Header" value="&#xA;----------------------开启--------------------------&#xA;" />
 			</layout>
 		</appender>
 		<root>
@@ -32,7 +32,7 @@
 	<connectionStrings>
 		<add name="PostgreSQL"   connectionString="Server=localhost;Port=5432;User Id=postgres;Password=123456;Database=postgres;Enlist=true;Preload Reader=true;" />
 		<!--0是other,1是kepler2300,2是Kepler2200,3是VenusSE,4是VenusDE-->
-		<add name="ConfigType"   connectionString="2"/>
+		<add name="ConfigType"   connectionString="3"/>
 	</connectionStrings>
 	<system.serviceModel>
 		<!--<diagnostics>

+ 0 - 90
Venus/Venus_RT/Modules/PMs/PMControlPressureRoutine.cs

@@ -1,90 +0,0 @@
-//using Aitex.Core.RT.Routine;
-//using Aitex.Core.RT.SCCore;
-//using MECF.Framework.Common.Equipment;
-//using System;
-//using System.Collections.Generic;
-//using System.Linq;
-//using System.Text;
-//using System.Threading.Tasks;
-//using Venus_Core;
-//using Venus_RT.Devices;
-//using Venus_RT.Modules.PMs;
-
-//namespace Venus_RT.Modules.PMs
-//{
-   
-//    class PMControlPressureRoutine :  PMRoutineBase, IRoutine
-//    {
-//        private enum ControlPressureStep
-//        {
-//            Delay1s,
-//            StartControlPressure,
-//            End
-//        }
-
-//        private readonly JetPMBase _chamber;
-
-//        private int _controlPressureSetPoint = 90;
-//        private int  _controlFlowSetPoint = 90;
-
-//        public PMControlPressureRoutine(JetPMBase chamber) : base(chamber)
-//        {
-//            _chamber = chamber;
-//        }
-//        public RState Start(params object[] objs)
-//        {
-//            if (!CheckTurboPump())
-//            {
-//                return RState.Failed;
-//            }
-
-//            if (_chamber.GetPVPosition() == 0)
-//            {
-//                Stop("钟摆阀没有打开");
-//                return RState.Failed;
-//            }
-
-//            Reset();
-
-
-//            // open process final valve and flow
-//            Notify("Open valve and flow mfc");
-//            _chamber.OpenValve(ValveType.GasFinal, true);
-
-//            _controlPressureSetPoint = SC.GetValue<int>($"{Module}.ControlPressureSetPoint");
-//            _controlFlowSetPoint= SC.GetValue<int>($"{Module}.ControlPressureN2FlowSetPoint");
-//            return Runner.Start(Module, Name);
-//        }
-
-//        public RState Monitor()
-//        {
-
-//            Runner.Delay(ControlPressureStep.Delay1s,               _delay_1s)
-//                  .Run(ControlPressureStep.StartControlPressure,    StartControlPressure)
-//                  .End(ControlPressureStep.End,                     End);
-//            return Runner.Status;
-//        }
-
-     
-//        private bool StartControlPressure()
-//        {
-
-//            _chamber.StartControlPressure(_controlPressureSetPoint, _controlFlowSetPoint);
-
-
-//            return true;
-//        }
-
-
-
-//        private bool End()
-//        {
-
-//            return true;
-//        }
-//        public void Abort()
-//        {
-//            _chamber.AbortControlPressure();
-//        }
-//    }
-//}

+ 11 - 11
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -141,7 +141,7 @@ namespace Venus_RT.Modules.PMs
         private readonly PMPartialPressureRoutine _pmPartialPressureRoutine;
         private readonly PMVATPerformanceRoutine _pmVATPerformanceRoutine;
 
-        private readonly PMHeatRoutine _pmHeatRoutine;
+        //private readonly PMHeatRoutine _pmHeatRoutine;
 
 
 
@@ -453,7 +453,7 @@ namespace Venus_RT.Modules.PMs
             _pmVATPerformanceRoutine = new PMVATPerformanceRoutine(_chamber);
             //_pmControlPressureRoutine = new PMControlPressureRoutine(_chamber);
 
-            _pmHeatRoutine = new PMHeatRoutine(_chamber);
+            //_pmHeatRoutine = new PMHeatRoutine(_chamber);
             fsm = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 50);
 
             //Idle
@@ -607,7 +607,7 @@ namespace Venus_RT.Modules.PMs
 
             // Place Wafer to PM
             Transition(PMState.Idle, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
-            Transition(PMState.Heating, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
+            //Transition(PMState.Heating, MSG.PreparePlace, FnStartPreparePlace, PMState.PreparePlace);
             Transition(PMState.PreparePlace, MSG.Abort, FnAbortPreparePlace, PMState.Idle);
             Transition(PMState.PreparePlace, FSM_MSG.TIMER, FnPreparePlaceTimeout, PMState.ReadyForPlace);
             Transition(PMState.PreparePlace, MSG.PreparePlace, null, PMState.PreparePlace);
@@ -1531,14 +1531,14 @@ namespace Venus_RT.Modules.PMs
             _pmVATPerformanceRoutine.Abort();
             return true;
         }
-        private bool FnStartHeat(object[] param)
-        {
-            if (ChamberType == JetChamber.Kepler2200A || ChamberType == JetChamber.Kepler2200B)
-            {
-                _pmHeatRoutine.Start();
-            }
-            return true;
-        }
+        //private bool FnStartHeat(object[] param)
+        //{
+        //    if (ChamberType == JetChamber.Kepler2200A || ChamberType == JetChamber.Kepler2200B)
+        //    {
+        //        _pmHeatRoutine.Start();
+        //    }
+        //    return true;
+        //}
         #endregion
 
         private void _debugRoutine()

+ 14 - 2
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -453,7 +453,19 @@ namespace Venus_RT.Modules.PMs
             currentRecipeResult.RecipeStepNumber = step.StepNo;
             currentRecipeResult.RecipeStepType = step.Type.ToString();
             currentRecipeResult.RecipeStepDescription = string.IsNullOrEmpty(step.Description) ? "" : step.Description;
-            currentRecipeResult.RecipeStepSetTime = step.Time;
+            switch (step.Type)
+            {
+                case StepType.Time:
+                    currentRecipeResult.RecipeStepSetTime =  step.Time;
+                    break;
+                case StepType.OverEtch:
+                    currentRecipeResult.RecipeStepSetTime =  (int)_processHelper.lastEPDStepTime / 1000 ;
+                    break;
+                default:
+                    currentRecipeResult.RecipeStepSetTime = null;
+                    break;
+            }
+            //currentRecipeResult.RecipeStepSetTime = step.Type==StepType.OverEtch? (int)_processHelper.lastEPDStepTime/1000:  step.Time;
             currentRecipeResult.RecipeType = _currentRecipe.Header.Type.ToString();
             currentRecipeResult.RecipeStepDuringTime = new System.TimeSpan(0, 0, System.Convert.ToInt32(_stepTime.ElapsedMilliseconds / 1000));
             var result = step.Run();
@@ -554,7 +566,7 @@ namespace Venus_RT.Modules.PMs
         {
             _currentRecipe.Steps[_currentStep].End();
             _faCallback.RecipeComplete(Module.ToString(), CurrentRunningRecipe);
-            RecipeFileManager.Instance.SaveAsRecipe2(Module.ToString(), _currentRecipe.Header.Type.ToString(), _currentRecipe.Header.Name, RecipeUnity.RecipeToString(_currentRecipe));
+            RecipeFileManager.Instance.SaveRecipe(Module.ToString(), _currentRecipe.Header.Type.ToString(), _currentRecipe.Header.Name, RecipeUnity.RecipeToString(_currentRecipe),false,false);
             _stepTime.Stop();
             WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Idle);
             WaferManager.Instance.UpdateWaferProcessStatus(Module, 0, EnumWaferProcessStatus.Completed);

+ 24 - 23
Venus/Venus_RT/Modules/PMs/ProcessDefine.cs

@@ -54,6 +54,7 @@ namespace Venus_RT.Modules.PMs
 
         private bool _isInstalledEPD;
         private Stopwatch _lastEPDStepTimeStopwatch;
+        public long lastEPDStepTime;
         public ProcessHelper(JetPMBase pm)
         {
             Chamber = pm;
@@ -828,38 +829,38 @@ namespace Venus_RT.Modules.PMs
                 Chamber.SetESCClampVoltage(0);
             }
             Chamber.SetBacksideHePressure(ProcessUnit.BacksideHelium);
-
-            List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
-            if (ProcessUnit.ToleranceMode != ToleranceMode.None)
-            {
-                toleranceObjects.Add(new ToleranceObject("BacksideHelium", ProcessUnit.BacksideHelium, ProcessUnit.HeliumWarningRange, ProcessUnit.HeliumAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
-                _HeliumToleranceChecker.Start(toleranceObjects);
-            }
+            Chamber.SetBacksideHeThreshold(ProcessUnit.MinHeFlow, ProcessUnit.MaxHeFlow);
+            //List<ToleranceObject> toleranceObjects = new List<ToleranceObject>();
+            //if (ProcessUnit.ToleranceMode != ToleranceMode.None)
+            //{
+            //    toleranceObjects.Add(new ToleranceObject("BacksideHelium", ProcessUnit.BacksideHelium, ProcessUnit.HeliumWarningRange, ProcessUnit.HeliumAlarmRange, ProcessUnit.ToleranceDelayTime, ProcessUnit.ToleranceMode));
+            //    _HeliumToleranceChecker.Start(toleranceObjects);
+            //}
             return RState.Running;
         }
         private RState ESCHVUnit_Check(ProcessUnitBase unit, RecipeStep step)
         {
             var ProcessUnit = unit as ESCHVUnit;
-            //if (Chamber.BackSideHeOutOfRange && step.ElapsedTime() > ProcessUnit.CheckDelay)
-            //{
-            //    LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, Backside Helium out of range.");
-            //    return RState.Failed;
-            //}
-            if (ProcessUnit.ToleranceMode != ToleranceMode.None)
+            if (Chamber.BackSideHeOutOfRange && step.ElapsedTime() > ProcessUnit.CheckDelay)
             {
-                return _HeliumToleranceChecker.Monitor(Chamber.HeliumFeedBack);
+                LOG.Write(eEvent.ERR_PROCESS, Chamber.Module, $"Step:{step.StepNo} failed, Backside Helium out of range.");
+                return RState.Failed;
             }
+            //if (ProcessUnit.ToleranceMode != ToleranceMode.None)
+            //{
+            //   return _HeliumToleranceChecker.Monitor(Chamber.HeliumFeedBack);
+            //}
             return RState.Running;
         }
         private void ESCHVUnit_End(ProcessUnitBase unit, RecipeStep step)
         {
-            //Chamber.SetESCClampVoltage(0);
-            //Chamber.SetBacksideHeThreshold(0, 0);
-            var ProcessUnit = unit as ESCHVUnit;
-            if (ProcessUnit.ToleranceMode != ToleranceMode.None)
-            {
-                _HeliumToleranceChecker.End();
-            }
+            Chamber.SetESCClampVoltage(0);
+            Chamber.SetBacksideHeThreshold(0, 0);
+            //var ProcessUnit = unit as ESCHVUnit;
+            //if (ProcessUnit.ToleranceMode != ToleranceMode.None)
+            //{
+            //    _HeliumToleranceChecker.End();
+            //}
         }
 
         private RState ProcessKitUnit_Start(ProcessUnitBase unit, RecipeStep step)
@@ -982,8 +983,8 @@ namespace Venus_RT.Modules.PMs
                 case StepType.Time:
                     return step.ElapsedTime() >= step.Time * 1000 ? RState.End : RState.Running;
                 case StepType.OverEtch:
-                    var time = _lastEPDStepTimeStopwatch.ElapsedMilliseconds;
-                    return step.ElapsedTime() >= (time * step.OverEtchPercent / 100) ? RState.End : RState.Running;
+                    lastEPDStepTime = _lastEPDStepTimeStopwatch.ElapsedMilliseconds * step.OverEtchPercent / 100;
+                    return step.ElapsedTime() >= lastEPDStepTime ? RState.End : RState.Running;
                 case StepType.EndPoint:
                     if (step.ElapsedTime() > step.MaxEndPointTime * 1000)
                     {

+ 0 - 1
Venus/Venus_RT/Venus_RT.csproj

@@ -280,7 +280,6 @@
     <Compile Include="Modules\PMs\LoadLockPumpRoutine.cs" />
     <Compile Include="Modules\PMs\LoadLockPurgeRoutine.cs" />
     <Compile Include="Modules\PMs\LoadLockVentRoutine.cs" />
-    <Compile Include="Modules\PMs\PMControlPressureRoutine.cs" />
     <Compile Include="Modules\PMs\PMPartialPressureRoutine.cs" />
     <Compile Include="Modules\PMs\PMEntity.cs" />
     <Compile Include="Modules\PMs\PMGaslinePurgeRoutine.cs" />