Kaynağa Gözat

解决pm界面不能run recipe bug

lixiang 1 yıl önce
ebeveyn
işleme
f0c8f8caa5

+ 15 - 6
Venus/Venus_MainPages/ViewModels/EfemViewModel.cs

@@ -801,8 +801,8 @@ namespace Venus_MainPages.ViewModels
             {
                 return;
             }
-            
-            if (oldValue.Action == RobotAction.None && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
+
+            if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
             {
                 var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
                 if (TMRobotMoveActionBladeTarget != null)
@@ -821,8 +821,12 @@ namespace Venus_MainPages.ViewModels
                 {
                     var robot1Robot1TAction= (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
                     await ChangePosition(robot1Robot1TAction);
-                    Robot1TAction = robot1Robot1TAction;
-                    await Task.Delay(1500);
+                    if (Robot1TAction != robot1Robot1TAction)
+                    {
+                        Robot1TAction = robot1Robot1TAction;
+                        await Task.Delay(600);
+                    }
+                    //await Task.Delay(1500);
                     Robot1XAction = WaferRobotXAction.Extend;
                     while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[0].WaferStatus == 0))
                     {
@@ -835,8 +839,13 @@ namespace Venus_MainPages.ViewModels
                     var robot2Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
 
                     await ChangePosition(robot2Robot1TAction);
-                    Robot2TAction = robot2Robot1TAction;
-                    await Task.Delay(1500);
+                    //Robot2TAction = robot2Robot1TAction;
+                    //await Task.Delay(1500);
+                    if (Robot2TAction != robot2Robot1TAction)
+                    {
+                        Robot2TAction = robot2Robot1TAction;
+                        await Task.Delay(600);
+                    }
                     Robot2XAction = WaferRobotXAction.Extend;
                     while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["EfemRobot"].WaferManager.Wafers[1].WaferStatus == 0))
                     {

+ 1 - 1
Venus/Venus_MainPages/ViewModels/OverVenusViewModel.cs

@@ -1397,7 +1397,7 @@ namespace Venus_MainPages.ViewModels
             ClearData();
             var recipePath = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName,"Process", recipeName + ".rcp");
             CurrentRecipe = Recipe.Load(File.ReadAllText(recipePath));
-            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.RunRecipe}", recipeName);
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.RunRecipe}", recipeName,true, ModuleManager.ModuleInfos[ModuleName].WaferManager.Wafers[0].WaferID);
         }
 
         private void OnSetChillerTemp()

+ 10 - 1
Venus/Venus_MainPages/ViewModels/RecipeViewModel.cs

@@ -2,6 +2,7 @@
 using Aitex.Core.RT.Log;
 using Aitex.Core.UI.View.Common;
 using MECF.Framework.Common.DataCenter;
+using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.OperationCenter;
 using Microsoft.VisualBasic;
 using Newtonsoft.Json;
@@ -206,7 +207,15 @@ namespace Venus_MainPages.ViewModels
         private void OnSaveRecipe()
         {
             CurrentRecipe.Header.EditTime = DateTime.Now.ToString();
-            SaveRecipe(CurrentRecipeName, RecipeUnity.RecipeToString(CurrentRecipe));
+            //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;
+            if (!di.Exists)
+            {
+                di.Create();
+            }
+            File.WriteAllText(newrecipePath, RecipeUnity.RecipeToString(CurrentRecipe));
             LoadHeadWrapPanel(headWrapPanel, CurrentRecipe);
         }
         private void OnSaveToRecipe(object obj)

+ 12 - 12
Venus/Venus_MainPages/ViewModels/TMOperationViewModel.cs

@@ -580,18 +580,18 @@ namespace Venus_MainPages.ViewModels
 
             
         }
-        private void UIEvents_PMDoorRaiseChangedEvent(DoorPara obj)
-        {
-            InvokeClient.Instance.Service.DoOperation($"{obj?.ModuleName}.SlitDoor.{obj?.IsOpen}");
-        }
-        private void UIEvents_LLTDoorRaiseChangedEvent(DoorPara obj)
-        {
-            InvokeClient.Instance.Service.DoOperation($"TM.{obj.ModuleName}TSlitDoor.{obj?.IsOpen}");
-        }
-        private void UIEvents_LLEDoorRaiseChangedEvent(DoorPara obj)
-        {
-            InvokeClient.Instance.Service.DoOperation($"TM.{obj.ModuleName}ESlitDoor.{obj?.IsOpen}");
-        }
+        //private void UIEvents_PMDoorRaiseChangedEvent(DoorPara obj)
+        //{
+        //    InvokeClient.Instance.Service.DoOperation($"{obj?.ModuleName}.SlitDoor.{obj?.IsOpen}");
+        //}
+        //private void UIEvents_LLTDoorRaiseChangedEvent(DoorPara obj)
+        //{
+        //    InvokeClient.Instance.Service.DoOperation($"TM.{obj.ModuleName}TSlitDoor.{obj?.IsOpen}");
+        //}
+        //private void UIEvents_LLEDoorRaiseChangedEvent(DoorPara obj)
+        //{
+        //    InvokeClient.Instance.Service.DoOperation($"TM.{obj.ModuleName}ESlitDoor.{obj?.IsOpen}");
+        //}
         #endregion
     }
 }

+ 81 - 43
Venus/Venus_MainPages/ViewModels/TMViewModel.cs

@@ -169,14 +169,16 @@ namespace Venus_MainPages.ViewModels
         int arm1oldWaferStatus = 100;
         int arm2oldWaferStatus = 100;
 
-        private async void RobotMoveInfoChanged(RobotMoveInfo oldValue,RobotMoveInfo newValue)
+        private async void RobotMoveInfoChanged(RobotMoveInfo oldValue, RobotMoveInfo newValue)
         {
-            if (oldValue == null ||newValue==null)
+            string RobotTarget;
+            if (oldValue == null || newValue == null)
             {
                 return;
             }
-            #region pick 和 place LL
-            if (oldValue.Action == RobotAction.None && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
+
+            #region Rotating
+            if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Rotating))
             {
                 var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
                 if (TMRobotMoveActionBladeTarget != null)
@@ -190,37 +192,19 @@ namespace Venus_MainPages.ViewModels
                 var values = RobotTarget.Split('.');
                 var arm = values[0];
                 var module = values[1];
-
                 if (arm == "ArmA")
                 {
                     Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
-                    await Task.Delay(600);
-                    Robot1XAction = WaferRobotXAction.Extend;
-                    //await Task.Delay(3000);
-                    while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus!= 0)|| (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus == 0))
-                    {
-                        await Task.Delay(100);
-                    }
-                    Robot1XAction = WaferRobotXAction.Retract;
                 }
                 else if (arm == "ArmB")
                 {
                     Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
-                    await Task.Delay(600);
-                    Robot2XAction = WaferRobotXAction.Extend;
-                    while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus == 0))
-                    {
-                        await Task.Delay(100);
-                    }
-                    //await Task.Delay(3000);
-                    Robot2XAction = WaferRobotXAction.Retract;
                 }
-            }       
-
+            }
             #endregion
 
-            #region pick 和 place pm
-            if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Extending)
+            #region pick 和 place LL
+            else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && (newValue.Action == RobotAction.Placing || newValue.Action == RobotAction.Picking))
             {
                 var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
                 if (TMRobotMoveActionBladeTarget != null)
@@ -234,21 +218,57 @@ namespace Venus_MainPages.ViewModels
                 var values = RobotTarget.Split('.');
                 var arm = values[0];
                 var module = values[1];
+
                 if (arm == "ArmA")
                 {
-                    Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
-                    await Task.Delay(1500);
+                    var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    if (waferRobotTAction != Robot1TAction)
+                    {
+                        Robot1TAction = waferRobotTAction;
+                    }
+                    else
+                    {
+                        //await Task.Delay(100);
+                    }
+                    await Task.Delay(600);
+
+                    //Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    //await Task.Delay(600);
                     Robot1XAction = WaferRobotXAction.Extend;
+                    while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus == 0))
+                    {
+                        await Task.Delay(100);
+                    }
+                    Robot1XAction = WaferRobotXAction.Retract;
                 }
                 else if (arm == "ArmB")
                 {
-                    Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
-                    await Task.Delay(1500);
+                    var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    if (waferRobotTAction != Robot2TAction)
+                    {
+                        Robot2TAction = waferRobotTAction;
+                    }
+                    else
+                    {
+                        //await Task.Delay(100);
+                    }
+                    await Task.Delay(600);
+
+                    //Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    //await Task.Delay(600);
                     Robot2XAction = WaferRobotXAction.Extend;
+                    while ((newValue.Action == RobotAction.Placing && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus != 0) || (newValue.Action == RobotAction.Picking && ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus == 0))
+                    {
+                        await Task.Delay(100);
+                    }
+                    Robot2XAction = WaferRobotXAction.Retract;
                 }
-
             }
-            if (oldValue.Action == RobotAction.None && newValue.Action == RobotAction.Retracting)
+
+            #endregion
+
+            #region pick 和 place pm
+            else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Extending)
             {
                 var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
                 if (TMRobotMoveActionBladeTarget != null)
@@ -261,20 +281,39 @@ namespace Venus_MainPages.ViewModels
                 }
                 var values = RobotTarget.Split('.');
                 var arm = values[0];
+                var module = values[1];
                 if (arm == "ArmA")
                 {
-                    Robot1XAction = WaferRobotXAction.Retract;
+                    var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    if (waferRobotTAction != Robot1TAction)
+                    {
+                        Robot1TAction = waferRobotTAction;
+                    }
+                    else
+                    {
+                        // await Task.Delay(100);
+                    }
+                    await Task.Delay(600);
+
+                    Robot1XAction = WaferRobotXAction.Extend;
                 }
                 else if (arm == "ArmB")
                 {
-                    Robot2XAction = WaferRobotXAction.Retract;
-                }
+                    var waferRobotTAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    if (waferRobotTAction != Robot2TAction)
+                    {
+                        Robot2TAction = waferRobotTAction;
+                    }
+                    else
+                    {
+                        // await Task.Delay(100);
+                    }
+                    await Task.Delay(600);
 
+                    Robot2XAction = WaferRobotXAction.Extend;
+                }
             }
-            #endregion
-
-            #region Rotating
-            if (oldValue.Action == RobotAction.None && (newValue.Action == RobotAction.Rotating))
+            else if ((oldValue.Action == RobotAction.None || oldValue.ArmTarget != newValue.ArmTarget) && newValue.Action == RobotAction.Retracting)
             {
                 var TMRobotMoveActionBladeTarget = newValue.BladeTarget;
                 if (TMRobotMoveActionBladeTarget != null)
@@ -287,19 +326,18 @@ namespace Venus_MainPages.ViewModels
                 }
                 var values = RobotTarget.Split('.');
                 var arm = values[0];
-                var module = values[1];
                 if (arm == "ArmA")
                 {
-                    Robot1TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    Robot1XAction = WaferRobotXAction.Retract;
                 }
                 else if (arm == "ArmB")
                 {
-                    Robot2TAction = (WaferRobotTAction)Enum.Parse(typeof(WaferRobotTAction), module, true);
+                    Robot2XAction = WaferRobotXAction.Retract;
                 }
             }
             #endregion
-            arm1oldWaferStatus = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[0].WaferStatus;
-            arm2oldWaferStatus = ModuleManager.ModuleInfos["TMRobot"].WaferManager.Wafers[1].WaferStatus;
+
+
         }
         private async void RobotActiont(string oldValue,string newValue)
         {

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

@@ -609,7 +609,7 @@ namespace Venus_RT.Modules.PMs
 
             OP.Subscribe($"{Module}.{RtOperation.MFCVerification}", (cmd, args) => CheckToPostMessage((int)MSG.MFCVerification, args));
 
-            OP.Subscribe($"{Module}.{RtOperation.RunRecipe}", (cmd, args) => CheckToPostMessage((int)MSG.RunRecipe, args[0]));
+            OP.Subscribe($"{Module}.{RtOperation.RunRecipe}", (cmd, args) => CheckToPostMessage((int)MSG.RunRecipe, args));
 
             OP.Subscribe($"{Module}.PartialPressureTest", (cmd, args) => CheckToPostMessage((int)MSG.PartialPressure, args[0], args[1]));
             OP.Subscribe($"{Module}.VATPerformanceTest", (cmd, args) => CheckToPostMessage((int)MSG.VATPerformance, args[0], args[1], args[2]));

+ 7 - 4
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -132,14 +132,17 @@ namespace Venus_RT.Modules.PMs
         public RState Start(params object[] objs)
         {
             string recipeName = (string)objs[0];
-            _withWafer = (bool)objs[2];
+            if (objs.Length >= 2)
+            {
+                _withWafer = (bool)objs[2];
+            }
             if (_withWafer && WaferManager.Instance.CheckNoWafer(Module, 0))
             {
                 Stop($"can not run process, no wafer at {Module}");
                 FaEvent.FaPostAlarm(Module.ToString(), $"can not run process, no wafer at {Module}");
                 return RState.Failed;
             }
-            else if(!_withWafer && WaferManager.Instance.CheckHasWafer(Module, 0))
+            else if (!_withWafer && WaferManager.Instance.CheckHasWafer(Module, 0))
             {
                 Stop($"can not run clean recipe{recipeName}, a wafer at {Module}");
                 FaEvent.FaPostAlarm(Module.ToString(), $"can not run clean recipe, a wafer at {Module}");
@@ -165,7 +168,7 @@ namespace Venus_RT.Modules.PMs
             currentRecipeResult = new RecipeResult();
             currentRecipeResult.RecipeName = recipeName;
 
-            string recipeContent = RecipeFileManager.Instance.LoadRecipe(_chamber.Name, recipeName, false,RecipeType.Process.ToString());
+            string recipeContent = RecipeFileManager.Instance.LoadRecipe(_chamber.Name, recipeName, false, RecipeType.Process.ToString());
             Recipe recipe = Recipe.Load(recipeContent);
             currentRecipeResult.RecipeStepCount = recipe.Steps.Count;
             if (recipe == null)
@@ -340,7 +343,7 @@ namespace Venus_RT.Modules.PMs
                     currentRecipeResult.RecipeCurrentCounter = _loopCounter == 0 ? 0 : 1;
 
                     _processHelper.isLoop = true;
-                    _processHelper.loopsteps= _currentRecipe.Steps[_currentStep].CycleNumber;
+                    _processHelper.loopsteps = _currentRecipe.Steps[_currentStep].CycleNumber;
                 }
                 else
                 {